mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-05 06:58:56 +00:00
videodecoder: small cleanups
This commit is contained in:
parent
9f591a0bd1
commit
3327d13f1b
1 changed files with 9 additions and 14 deletions
|
@ -1502,21 +1502,16 @@ gst_video_decoder_clear_queues (GstVideoDecoder * dec)
|
||||||
(GDestroyNotify) gst_mini_object_unref);
|
(GDestroyNotify) gst_mini_object_unref);
|
||||||
priv->output_queued = NULL;
|
priv->output_queued = NULL;
|
||||||
|
|
||||||
g_list_foreach (priv->gather, (GFunc) gst_mini_object_unref, NULL);
|
g_list_free_full (priv->gather, (GDestroyNotify) gst_mini_object_unref);
|
||||||
g_list_free (priv->gather);
|
|
||||||
priv->gather = NULL;
|
priv->gather = NULL;
|
||||||
g_list_foreach (priv->decode, (GFunc) gst_video_codec_frame_unref, NULL);
|
g_list_free_full (priv->decode, (GDestroyNotify) gst_video_codec_frame_unref);
|
||||||
g_list_free (priv->decode);
|
|
||||||
priv->decode = NULL;
|
priv->decode = NULL;
|
||||||
g_list_foreach (priv->parse, (GFunc) gst_mini_object_unref, NULL);
|
g_list_free_full (priv->parse, (GDestroyNotify) gst_mini_object_unref);
|
||||||
g_list_free (priv->parse);
|
|
||||||
priv->parse = NULL;
|
priv->parse = NULL;
|
||||||
g_list_foreach (priv->parse_gather, (GFunc) gst_video_codec_frame_unref,
|
g_list_free_full (priv->parse_gather,
|
||||||
NULL);
|
(GDestroyNotify) gst_video_codec_frame_unref);
|
||||||
g_list_free (priv->parse_gather);
|
|
||||||
priv->parse_gather = NULL;
|
priv->parse_gather = NULL;
|
||||||
g_list_foreach (priv->frames, (GFunc) gst_video_codec_frame_unref, NULL);
|
g_list_free_full (priv->frames, (GDestroyNotify) gst_video_codec_frame_unref);
|
||||||
g_list_free (priv->frames);
|
|
||||||
priv->frames = NULL;
|
priv->frames = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1554,8 +1549,7 @@ gst_video_decoder_reset (GstVideoDecoder * decoder, gboolean full)
|
||||||
priv->frame_offset = 0;
|
priv->frame_offset = 0;
|
||||||
gst_adapter_clear (priv->input_adapter);
|
gst_adapter_clear (priv->input_adapter);
|
||||||
gst_adapter_clear (priv->output_adapter);
|
gst_adapter_clear (priv->output_adapter);
|
||||||
g_list_foreach (priv->timestamps, (GFunc) g_free, NULL);
|
g_list_free_full (priv->timestamps, (GDestroyNotify) g_free);
|
||||||
g_list_free (priv->timestamps);
|
|
||||||
priv->timestamps = NULL;
|
priv->timestamps = NULL;
|
||||||
|
|
||||||
if (priv->current_frame) {
|
if (priv->current_frame) {
|
||||||
|
@ -2447,13 +2441,14 @@ gst_video_decoder_decode_frame (GstVideoDecoder * decoder,
|
||||||
GST_LOG_OBJECT (decoder, "PTS %" GST_TIME_FORMAT ", DTS %" GST_TIME_FORMAT,
|
GST_LOG_OBJECT (decoder, "PTS %" GST_TIME_FORMAT ", DTS %" GST_TIME_FORMAT,
|
||||||
GST_TIME_ARGS (frame->pts), GST_TIME_ARGS (frame->dts));
|
GST_TIME_ARGS (frame->pts), GST_TIME_ARGS (frame->dts));
|
||||||
GST_LOG_OBJECT (decoder, "dist %d", frame->distance_from_sync);
|
GST_LOG_OBJECT (decoder, "dist %d", frame->distance_from_sync);
|
||||||
|
|
||||||
|
gst_video_codec_frame_ref (frame);
|
||||||
priv->frames = g_list_append (priv->frames, frame);
|
priv->frames = g_list_append (priv->frames, frame);
|
||||||
frame->deadline =
|
frame->deadline =
|
||||||
gst_segment_to_running_time (&decoder->input_segment, GST_FORMAT_TIME,
|
gst_segment_to_running_time (&decoder->input_segment, GST_FORMAT_TIME,
|
||||||
frame->pts);
|
frame->pts);
|
||||||
|
|
||||||
/* do something with frame */
|
/* do something with frame */
|
||||||
gst_video_codec_frame_ref (frame);
|
|
||||||
ret = decoder_class->handle_frame (decoder, frame);
|
ret = decoder_class->handle_frame (decoder, frame);
|
||||||
if (ret != GST_FLOW_OK)
|
if (ret != GST_FLOW_OK)
|
||||||
GST_DEBUG_OBJECT (decoder, "flow error %s", gst_flow_get_name (ret));
|
GST_DEBUG_OBJECT (decoder, "flow error %s", gst_flow_get_name (ret));
|
||||||
|
|
Loading…
Reference in a new issue