v4l2videoenc: fix activation of internal pool

Fix the buffer pool activation if the driver does not support VIDIOC_CREATE_BUFS
the same way as it was fixed for the v4l2videodec.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4235>
This commit is contained in:
Michael Tretter 2023-10-10 14:53:08 +02:00 committed by GStreamer Marge Bot
parent 5e72e1985a
commit 41ce99ebab

View file

@ -793,9 +793,22 @@ gst_v4l2_video_enc_handle_frame (GstVideoEncoder * encoder,
/* There is no reason to refuse this config */
if (!gst_buffer_pool_set_config (opool, config)) {
if (opool)
gst_object_unref (opool);
goto activate_failed;
config = gst_buffer_pool_get_config (opool);
if (gst_buffer_pool_config_validate_params (config,
self->input_state->caps, self->v4l2output->info.size, min,
min)) {
gst_structure_free (config);
if (opool)
gst_object_unref (opool);
goto activate_failed;
}
if (!gst_buffer_pool_set_config (opool, config)) {
if (opool)
gst_object_unref (opool);
goto activate_failed;
}
}
if (!gst_buffer_pool_set_active (opool, TRUE)) {