diff options
author | Víctor Manuel Jáquez Leal <vjaquez@igalia.com> | 2020-08-03 13:44:23 +0200 |
---|---|---|
committer | Víctor Manuel Jáquez Leal <vjaquez@igalia.com> | 2020-08-03 19:33:01 +0200 |
commit | 0cc1dccd8495afb16647f63287e1b23d2b790114 (patch) | |
tree | ef302798e36158e7bf817ddbf006ee334368d401 /sys/va/gstvah264dec.c | |
parent | aa664a4eca49161e3588897f2f402ead003f315a (diff) | |
download | gstreamer-plugins-bad-0cc1dccd8495afb16647f63287e1b23d2b790114.tar.gz |
va: h264dec: don't copy frames if VAMemory capsfeature is negotiated
Otherwise the VASurfaceID is lost.
Diffstat (limited to 'sys/va/gstvah264dec.c')
-rw-r--r-- | sys/va/gstvah264dec.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/sys/va/gstvah264dec.c b/sys/va/gstvah264dec.c index 4773916b0..320f40c48 100644 --- a/sys/va/gstvah264dec.c +++ b/sys/va/gstvah264dec.c @@ -1037,6 +1037,15 @@ _caps_is_dmabuf (GstVaH264Dec * self, GstCaps * caps) & VA_SURFACE_ATTRIB_MEM_TYPE_DRM_PRIME); } +static inline gboolean +_caps_is_va_memory (GstCaps * caps) +{ + GstCapsFeatures *features; + + features = gst_caps_get_features (caps, 0); + return gst_caps_features_contains (features, "memory:VAMemory"); +} + static inline void _shall_copy_frames (GstVaH264Dec * self, GstVideoInfo * info) { @@ -1083,7 +1092,8 @@ _try_allocator (GstVaH264Dec * self, GstAllocator * allocator, GstCaps * caps, } else if (GST_IS_VA_ALLOCATOR (allocator)) { if (!gst_va_allocator_try (allocator, ¶ms)) return FALSE; - _shall_copy_frames (self, ¶ms.info); + if (!_caps_is_va_memory (caps)) + _shall_copy_frames (self, ¶ms.info); } else { return FALSE; } @@ -1191,7 +1201,7 @@ gst_va_h264_dec_decide_allocation (GstVideoDecoder * decoder, GstQuery * query) } else { size = GST_VIDEO_INFO_SIZE (&info); - if (!self->has_videometa) { + if (!self->has_videometa && !_caps_is_va_memory (caps)) { GST_DEBUG_OBJECT (self, "making new other pool for copy"); self->other_pool = gst_video_buffer_pool_new (); config = gst_buffer_pool_get_config (self->other_pool); |