From e34f765a7e0ffe9910dde5374627cd9ab580bdb0 Mon Sep 17 00:00:00 2001 From: Nicolas Dufresne Date: Wed, 17 Apr 2024 16:55:31 -0400 Subject: [PATCH] v4l2codecs: Don't unref allocation query caps The caps obtained from parsing the allocation query is borrowed and should not be unreffed. This fixes criticals assertion introduced in 1.24.1. (gst-launch-1.0:242): GStreamer-CRITICAL **: 19:48:02.667: gst_mini_object_unref: assertion 'GST_MINI_OBJECT_REFCOUNT_VALUE (mini_object) > 0' failed Fixes: 5189e8b95630 ("v4l2codecs: decoders: Add DMA_DRM caps support") Closes #3462 Part-of: --- subprojects/gst-plugins-bad/sys/v4l2codecs/gstv4l2codecav1dec.c | 1 - subprojects/gst-plugins-bad/sys/v4l2codecs/gstv4l2codech264dec.c | 1 - subprojects/gst-plugins-bad/sys/v4l2codecs/gstv4l2codech265dec.c | 1 - .../gst-plugins-bad/sys/v4l2codecs/gstv4l2codecmpeg2dec.c | 1 - subprojects/gst-plugins-bad/sys/v4l2codecs/gstv4l2codecvp8dec.c | 1 - subprojects/gst-plugins-bad/sys/v4l2codecs/gstv4l2codecvp9dec.c | 1 - 6 files changed, 6 deletions(-) diff --git a/subprojects/gst-plugins-bad/sys/v4l2codecs/gstv4l2codecav1dec.c b/subprojects/gst-plugins-bad/sys/v4l2codecs/gstv4l2codecav1dec.c index eb85addad5..c031bebd3c 100644 --- a/subprojects/gst-plugins-bad/sys/v4l2codecs/gstv4l2codecav1dec.c +++ b/subprojects/gst-plugins-bad/sys/v4l2codecs/gstv4l2codecav1dec.c @@ -409,7 +409,6 @@ gst_v4l2_codec_av1_dec_decide_allocation (GstVideoDecoder * decoder, "DMABuf caps negotiated without the mandatory support of VideoMeta"); return FALSE; } - gst_caps_unref (caps); if (gst_query_get_n_allocation_pools (query) > 0) gst_query_parse_nth_allocation_pool (query, 0, NULL, NULL, &min, NULL); diff --git a/subprojects/gst-plugins-bad/sys/v4l2codecs/gstv4l2codech264dec.c b/subprojects/gst-plugins-bad/sys/v4l2codecs/gstv4l2codech264dec.c index 39f63923c9..2368e52de8 100644 --- a/subprojects/gst-plugins-bad/sys/v4l2codecs/gstv4l2codech264dec.c +++ b/subprojects/gst-plugins-bad/sys/v4l2codecs/gstv4l2codech264dec.c @@ -454,7 +454,6 @@ gst_v4l2_codec_h264_dec_decide_allocation (GstVideoDecoder * decoder, "DMABuf caps negotiated without the mandatory support of VideoMeta"); return FALSE; } - gst_caps_unref (caps); if (gst_query_get_n_allocation_pools (query) > 0) gst_query_parse_nth_allocation_pool (query, 0, NULL, NULL, &min, NULL); diff --git a/subprojects/gst-plugins-bad/sys/v4l2codecs/gstv4l2codech265dec.c b/subprojects/gst-plugins-bad/sys/v4l2codecs/gstv4l2codech265dec.c index 7be7aa311c..dd6db8cadf 100644 --- a/subprojects/gst-plugins-bad/sys/v4l2codecs/gstv4l2codech265dec.c +++ b/subprojects/gst-plugins-bad/sys/v4l2codecs/gstv4l2codech265dec.c @@ -483,7 +483,6 @@ gst_v4l2_codec_h265_dec_decide_allocation (GstVideoDecoder * decoder, "DMABuf caps negotiated without the mandatory support of VideoMeta"); return FALSE; } - gst_caps_unref (caps); if (gst_query_get_n_allocation_pools (query) > 0) gst_query_parse_nth_allocation_pool (query, 0, NULL, NULL, &min, NULL); diff --git a/subprojects/gst-plugins-bad/sys/v4l2codecs/gstv4l2codecmpeg2dec.c b/subprojects/gst-plugins-bad/sys/v4l2codecs/gstv4l2codecmpeg2dec.c index 1f833eb662..df68f1a662 100644 --- a/subprojects/gst-plugins-bad/sys/v4l2codecs/gstv4l2codecmpeg2dec.c +++ b/subprojects/gst-plugins-bad/sys/v4l2codecs/gstv4l2codecmpeg2dec.c @@ -376,7 +376,6 @@ gst_v4l2_codec_mpeg2_dec_decide_allocation (GstVideoDecoder * decoder, "DMABuf caps negotiated without the mandatory support of VideoMeta"); return FALSE; } - gst_caps_unref (caps); if (gst_query_get_n_allocation_pools (query) > 0) gst_query_parse_nth_allocation_pool (query, 0, NULL, NULL, &min, NULL); diff --git a/subprojects/gst-plugins-bad/sys/v4l2codecs/gstv4l2codecvp8dec.c b/subprojects/gst-plugins-bad/sys/v4l2codecs/gstv4l2codecvp8dec.c index 02d88e9f1f..285f699c68 100644 --- a/subprojects/gst-plugins-bad/sys/v4l2codecs/gstv4l2codecvp8dec.c +++ b/subprojects/gst-plugins-bad/sys/v4l2codecs/gstv4l2codecvp8dec.c @@ -320,7 +320,6 @@ gst_v4l2_codec_vp8_dec_decide_allocation (GstVideoDecoder * decoder, "DMABuf caps negotiated without the mandatory support of VideoMeta"); return FALSE; } - gst_caps_unref (caps); if (gst_query_get_n_allocation_pools (query) > 0) gst_query_parse_nth_allocation_pool (query, 0, NULL, NULL, &min, NULL); diff --git a/subprojects/gst-plugins-bad/sys/v4l2codecs/gstv4l2codecvp9dec.c b/subprojects/gst-plugins-bad/sys/v4l2codecs/gstv4l2codecvp9dec.c index 53be020b62..81d413e041 100644 --- a/subprojects/gst-plugins-bad/sys/v4l2codecs/gstv4l2codecvp9dec.c +++ b/subprojects/gst-plugins-bad/sys/v4l2codecs/gstv4l2codecvp9dec.c @@ -593,7 +593,6 @@ gst_v4l2_codec_vp9_dec_decide_allocation (GstVideoDecoder * decoder, "DMABuf caps negotiated without the mandatory support of VideoMeta"); return FALSE; } - gst_caps_unref (caps); if (gst_query_get_n_allocation_pools (query) > 0) gst_query_parse_nth_allocation_pool (query, 0, NULL, NULL, &min, NULL);