mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
va: h264dec: don't copy frames if VAMemory capsfeature is negotiated
Otherwise the VASurfaceID is lost.
This commit is contained in:
parent
aa664a4eca
commit
0cc1dccd84
1 changed files with 12 additions and 2 deletions
|
@ -1037,6 +1037,15 @@ _caps_is_dmabuf (GstVaH264Dec * self, GstCaps * caps)
|
||||||
& VA_SURFACE_ATTRIB_MEM_TYPE_DRM_PRIME);
|
& 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
|
static inline void
|
||||||
_shall_copy_frames (GstVaH264Dec * self, GstVideoInfo * info)
|
_shall_copy_frames (GstVaH264Dec * self, GstVideoInfo * info)
|
||||||
{
|
{
|
||||||
|
@ -1083,6 +1092,7 @@ _try_allocator (GstVaH264Dec * self, GstAllocator * allocator, GstCaps * caps,
|
||||||
} else if (GST_IS_VA_ALLOCATOR (allocator)) {
|
} else if (GST_IS_VA_ALLOCATOR (allocator)) {
|
||||||
if (!gst_va_allocator_try (allocator, ¶ms))
|
if (!gst_va_allocator_try (allocator, ¶ms))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
if (!_caps_is_va_memory (caps))
|
||||||
_shall_copy_frames (self, ¶ms.info);
|
_shall_copy_frames (self, ¶ms.info);
|
||||||
} else {
|
} else {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -1191,7 +1201,7 @@ gst_va_h264_dec_decide_allocation (GstVideoDecoder * decoder, GstQuery * query)
|
||||||
} else {
|
} else {
|
||||||
size = GST_VIDEO_INFO_SIZE (&info);
|
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");
|
GST_DEBUG_OBJECT (self, "making new other pool for copy");
|
||||||
self->other_pool = gst_video_buffer_pool_new ();
|
self->other_pool = gst_video_buffer_pool_new ();
|
||||||
config = gst_buffer_pool_get_config (self->other_pool);
|
config = gst_buffer_pool_get_config (self->other_pool);
|
||||||
|
|
Loading…
Reference in a new issue