From: Nicolas Dufresne Date: Thu, 19 May 2022 19:51:03 +0000 (-0400) Subject: v4l2videodec: Fix activation of internal pool X-Git-Tag: 1.22.0~1381 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7c40fcb66e3453df03276d9fc12416e2f1fa28fc;p=platform%2Fupstream%2Fgstreamer.git v4l2videodec: Fix activation of internal pool If the driver does not support VIDIOC_CREATE_BUFS ioctl, the pool configuration may get changed, which requires a validation. This would fail to activate a pool in a case it shouldn't normally fail unless we are out of memory. Part-of: --- diff --git a/subprojects/gst-plugins-good/sys/v4l2/gstv4l2videodec.c b/subprojects/gst-plugins-good/sys/v4l2/gstv4l2videodec.c index b586174..540d182 100644 --- a/subprojects/gst-plugins-good/sys/v4l2/gstv4l2videodec.c +++ b/subprojects/gst-plugins-good/sys/v4l2/gstv4l2videodec.c @@ -824,8 +824,18 @@ gst_v4l2_video_dec_handle_frame (GstVideoDecoder * decoder, self->v4l2output->info.size, min, max); /* There is no reason to refuse this config */ - if (!gst_buffer_pool_set_config (pool, config)) - goto activate_failed; + if (!gst_buffer_pool_set_config (pool, config)) { + config = gst_buffer_pool_get_config (pool); + + if (!gst_buffer_pool_config_validate_params (config, + self->input_state->caps, self->v4l2output->info.size, min, max)) { + gst_structure_free (config); + goto activate_failed; + } + + if (!gst_buffer_pool_set_config (pool, config)) + goto activate_failed; + } if (!gst_buffer_pool_set_active (pool, TRUE)) goto activate_failed;