mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-23 18:21:04 +00:00
videodecoder: make _release_frame external API
... so subclasses can release a frame all the way (also from frame list) without having to pass through _finish_frame or _drop_frame. The latter may not be applicable, or may or may not have already been called for the frame in question. See https://bugzilla.gnome.org/show_bug.cgi?id=693772
This commit is contained in:
parent
614d35d795
commit
40fc306017
2 changed files with 17 additions and 3 deletions
|
@ -436,8 +436,6 @@ static void gst_video_decoder_reset (GstVideoDecoder * decoder, gboolean full,
|
||||||
static GstFlowReturn gst_video_decoder_decode_frame (GstVideoDecoder * decoder,
|
static GstFlowReturn gst_video_decoder_decode_frame (GstVideoDecoder * decoder,
|
||||||
GstVideoCodecFrame * frame);
|
GstVideoCodecFrame * frame);
|
||||||
|
|
||||||
static void gst_video_decoder_release_frame (GstVideoDecoder * dec,
|
|
||||||
GstVideoCodecFrame * frame);
|
|
||||||
static GstClockTime gst_video_decoder_get_frame_duration (GstVideoDecoder *
|
static GstClockTime gst_video_decoder_get_frame_duration (GstVideoDecoder *
|
||||||
decoder, GstVideoCodecFrame * frame);
|
decoder, GstVideoCodecFrame * frame);
|
||||||
static GstVideoCodecFrame *gst_video_decoder_new_frame (GstVideoDecoder *
|
static GstVideoCodecFrame *gst_video_decoder_new_frame (GstVideoDecoder *
|
||||||
|
@ -2345,18 +2343,31 @@ no_output_buffer:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
/**
|
||||||
|
* gst_video_decoder_release_frame:
|
||||||
|
* @dec: a #GstVideoDecoder
|
||||||
|
* @frame: (transfer full): the #GstVideoCodecFrame to release
|
||||||
|
*
|
||||||
|
* Similar to gst_video_decoder_drop_frame(), but simply releases @frame
|
||||||
|
* without any processing other than removing it from list of pending frames,
|
||||||
|
* after which it is considered finished and released.
|
||||||
|
*
|
||||||
|
* Since: 1.4
|
||||||
|
*/
|
||||||
|
void
|
||||||
gst_video_decoder_release_frame (GstVideoDecoder * dec,
|
gst_video_decoder_release_frame (GstVideoDecoder * dec,
|
||||||
GstVideoCodecFrame * frame)
|
GstVideoCodecFrame * frame)
|
||||||
{
|
{
|
||||||
GList *link;
|
GList *link;
|
||||||
|
|
||||||
/* unref once from the list */
|
/* unref once from the list */
|
||||||
|
GST_VIDEO_DECODER_STREAM_LOCK (dec);
|
||||||
link = g_list_find (dec->priv->frames, frame);
|
link = g_list_find (dec->priv->frames, frame);
|
||||||
if (link) {
|
if (link) {
|
||||||
gst_video_codec_frame_unref (frame);
|
gst_video_codec_frame_unref (frame);
|
||||||
dec->priv->frames = g_list_delete_link (dec->priv->frames, link);
|
dec->priv->frames = g_list_delete_link (dec->priv->frames, link);
|
||||||
}
|
}
|
||||||
|
GST_VIDEO_DECODER_STREAM_UNLOCK (dec);
|
||||||
|
|
||||||
/* unref because this function takes ownership */
|
/* unref because this function takes ownership */
|
||||||
gst_video_codec_frame_unref (frame);
|
gst_video_codec_frame_unref (frame);
|
||||||
|
|
|
@ -366,6 +366,9 @@ GstFlowReturn gst_video_decoder_finish_frame (GstVideoDecoder *decoder,
|
||||||
GstFlowReturn gst_video_decoder_drop_frame (GstVideoDecoder *dec,
|
GstFlowReturn gst_video_decoder_drop_frame (GstVideoDecoder *dec,
|
||||||
GstVideoCodecFrame *frame);
|
GstVideoCodecFrame *frame);
|
||||||
|
|
||||||
|
void gst_video_decoder_release_frame (GstVideoDecoder * dec,
|
||||||
|
GstVideoCodecFrame * frame);
|
||||||
|
|
||||||
void gst_video_decoder_merge_tags (GstVideoDecoder *dec,
|
void gst_video_decoder_merge_tags (GstVideoDecoder *dec,
|
||||||
const GstTagList *tags,
|
const GstTagList *tags,
|
||||||
GstTagMergeMode mode);
|
GstTagMergeMode mode);
|
||||||
|
|
Loading…
Reference in a new issue