From 5e72e1985a994be07331911d2cd3b934cbae6a1e Mon Sep 17 00:00:00 2001 From: Michael Tretter Date: Tue, 5 Sep 2023 17:54:31 +0200 Subject: [PATCH] v4l2videoenc: rename OUTPUT pool to opool There is a CAPTURE pool in the same function. While the CAPTURE pool is called cpool, using pool for the OUTPUT pool is confusing. Using opool for the OUTPUT pool makes it more obvious, which pool is used. Part-of: --- .../sys/v4l2/gstv4l2videoenc.c | 27 +++++++++---------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/subprojects/gst-plugins-good/sys/v4l2/gstv4l2videoenc.c b/subprojects/gst-plugins-good/sys/v4l2/gstv4l2videoenc.c index b311bd227e..5f1b38c772 100644 --- a/subprojects/gst-plugins-good/sys/v4l2/gstv4l2videoenc.c +++ b/subprojects/gst-plugins-good/sys/v4l2/gstv4l2videoenc.c @@ -770,8 +770,6 @@ gst_v4l2_video_enc_handle_frame (GstVideoEncoder * encoder, task_state = gst_pad_get_task_state (GST_VIDEO_ENCODER_SRC_PAD (self)); if (task_state == GST_TASK_STOPPED || task_state == GST_TASK_PAUSED) { - GstBufferPool *pool = gst_v4l2_object_get_buffer_pool (self->v4l2output); - /* It is possible that the processing thread stopped due to an error or * when the last buffer has been met during the draining process. */ if (self->output_flow != GST_FLOW_OK && @@ -780,14 +778,13 @@ gst_v4l2_video_enc_handle_frame (GstVideoEncoder * encoder, GST_DEBUG_OBJECT (self, "Processing loop stopped with error: %s, leaving", gst_flow_get_name (self->output_flow)); ret = self->output_flow; - if (pool) - gst_object_unref (pool); goto drop; } - /* Ensure input internal pool is active */ - if (!gst_buffer_pool_is_active (pool)) { - GstStructure *config = gst_buffer_pool_get_config (pool); + /* Ensure input internal output pool is active */ + GstBufferPool *opool = gst_v4l2_object_get_buffer_pool (self->v4l2output); + if (!gst_buffer_pool_is_active (opool)) { + GstStructure *config = gst_buffer_pool_get_config (opool); guint min = MAX (self->v4l2output->min_buffers, GST_V4L2_MIN_BUFFERS (self->v4l2output)); @@ -795,19 +792,19 @@ gst_v4l2_video_enc_handle_frame (GstVideoEncoder * encoder, self->v4l2output->info.size, min, min); /* There is no reason to refuse this config */ - if (!gst_buffer_pool_set_config (pool, config)) { - if (pool) - gst_object_unref (pool); + if (!gst_buffer_pool_set_config (opool, config)) { + if (opool) + gst_object_unref (opool); goto activate_failed; } - if (!gst_buffer_pool_set_active (pool, TRUE)) { - if (pool) - gst_object_unref (pool); + if (!gst_buffer_pool_set_active (opool, TRUE)) { + if (opool) + gst_object_unref (opool); goto activate_failed; } - if (pool) - gst_object_unref (pool); + if (opool) + gst_object_unref (opool); } {