From 510e22799601a3db86adaf193c6513dd76a25a59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Brzezi=C5=84ski?= Date: Wed, 9 Aug 2023 00:36:35 +0200 Subject: [PATCH] vtenc: Fix cosmetic issues Removes accidental GST_VIDEO_DECODER macro usage. Also sets the initial size of the output queue to avoid having to expand when first buffers come through. Part-of: --- subprojects/gst-plugins-bad/sys/applemedia/vtenc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/subprojects/gst-plugins-bad/sys/applemedia/vtenc.c b/subprojects/gst-plugins-bad/sys/applemedia/vtenc.c index df2d8f0b67..064eaae2ab 100644 --- a/subprojects/gst-plugins-bad/sys/applemedia/vtenc.c +++ b/subprojects/gst-plugins-bad/sys/applemedia/vtenc.c @@ -768,14 +768,14 @@ gst_vtenc_start (GstVideoEncoder * enc) self->is_flushing = FALSE; self->downstream_ret = GST_FLOW_OK; - self->output_queue = gst_queue_array_new (0); + self->output_queue = gst_queue_array_new (VTENC_OUTPUT_QUEUE_SIZE); /* Set clear_func to unref all remaining frames in gst_queue_array_free() */ gst_queue_array_set_clear_func (self->output_queue, (GDestroyNotify) gst_video_codec_frame_unref); /* Create the output task, but pause it immediately */ self->pause_task = TRUE; - if (!gst_pad_start_task (GST_VIDEO_DECODER_SRC_PAD (enc), + if (!gst_pad_start_task (GST_VIDEO_ENCODER_SRC_PAD (enc), (GstTaskFunction) gst_vtenc_loop, self, NULL)) { GST_ERROR_OBJECT (self, "failed to start output thread"); return FALSE; @@ -1741,7 +1741,7 @@ gst_vtenc_encode_frame (GstVTEnc * self, GstVideoCodecFrame * frame) /* If this condition changes later while we're still in this function, * it'll just fail on next frame encode or in _finish() */ - task_state = gst_pad_get_task_state (GST_VIDEO_DECODER_SRC_PAD (self)); + task_state = gst_pad_get_task_state (GST_VIDEO_ENCODER_SRC_PAD (self)); if (task_state == GST_TASK_STOPPED || task_state == GST_TASK_PAUSED) { /* Abort if our loop failed to push frames downstream... */ if (self->downstream_ret != GST_FLOW_OK) {