From 1794a44577053aa6943d086cba81f8d1d39059f9 Mon Sep 17 00:00:00 2001 From: He Junyan Date: Tue, 3 Nov 2020 01:59:46 +0800 Subject: [PATCH] va: pool: Check the force_videometa for all memory types. force_videometa should mean that the buffer must use video meta to map correctly. When the stride or the offset of the alloc_info is different from the src caps, the downstream must use video meta. So this flag should not link with the RAW caps only. All kinds of caps(memory:VAMemory, memory:DMABuf) should have this flag. Part-of: --- sys/va/gstvapool.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/sys/va/gstvapool.c b/sys/va/gstvapool.c index 9c7a768..6253235 100644 --- a/sys/va/gstvapool.c +++ b/sys/va/gstvapool.c @@ -169,16 +169,14 @@ gst_va_pool_set_config (GstBufferPool * pool, GstStructure * config) gst_video_alignment_reset (&vpool->video_align); } - if (gst_caps_is_raw (caps)) { - for (i = 0; i < GST_VIDEO_INFO_N_PLANES (&caps_info); i++) { - if (GST_VIDEO_INFO_PLANE_STRIDE (&orig_info, i) != - GST_VIDEO_INFO_PLANE_STRIDE (&alloc_info, i) || - GST_VIDEO_INFO_PLANE_OFFSET (&orig_info, i) != - GST_VIDEO_INFO_PLANE_OFFSET (&alloc_info, i)) { - GST_INFO_OBJECT (vpool, "Video meta is required in buffer."); - vpool->force_videometa = TRUE; - break; - } + for (i = 0; i < GST_VIDEO_INFO_N_PLANES (&caps_info); i++) { + if (GST_VIDEO_INFO_PLANE_STRIDE (&orig_info, i) != + GST_VIDEO_INFO_PLANE_STRIDE (&alloc_info, i) || + GST_VIDEO_INFO_PLANE_OFFSET (&orig_info, i) != + GST_VIDEO_INFO_PLANE_OFFSET (&alloc_info, i)) { + GST_INFO_OBJECT (vpool, "Video meta is required in buffer."); + vpool->force_videometa = TRUE; + break; } } -- 2.7.4