mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-22 17:51:16 +00:00
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: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5164>
This commit is contained in:
parent
1233b8a027
commit
510e227996
1 changed files with 3 additions and 3 deletions
|
@ -768,14 +768,14 @@ gst_vtenc_start (GstVideoEncoder * enc)
|
||||||
self->is_flushing = FALSE;
|
self->is_flushing = FALSE;
|
||||||
self->downstream_ret = GST_FLOW_OK;
|
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() */
|
/* Set clear_func to unref all remaining frames in gst_queue_array_free() */
|
||||||
gst_queue_array_set_clear_func (self->output_queue,
|
gst_queue_array_set_clear_func (self->output_queue,
|
||||||
(GDestroyNotify) gst_video_codec_frame_unref);
|
(GDestroyNotify) gst_video_codec_frame_unref);
|
||||||
|
|
||||||
/* Create the output task, but pause it immediately */
|
/* Create the output task, but pause it immediately */
|
||||||
self->pause_task = TRUE;
|
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)) {
|
(GstTaskFunction) gst_vtenc_loop, self, NULL)) {
|
||||||
GST_ERROR_OBJECT (self, "failed to start output thread");
|
GST_ERROR_OBJECT (self, "failed to start output thread");
|
||||||
return FALSE;
|
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,
|
/* If this condition changes later while we're still in this function,
|
||||||
* it'll just fail on next frame encode or in _finish() */
|
* 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) {
|
if (task_state == GST_TASK_STOPPED || task_state == GST_TASK_PAUSED) {
|
||||||
/* Abort if our loop failed to push frames downstream... */
|
/* Abort if our loop failed to push frames downstream... */
|
||||||
if (self->downstream_ret != GST_FLOW_OK) {
|
if (self->downstream_ret != GST_FLOW_OK) {
|
||||||
|
|
Loading…
Reference in a new issue