From 1d0507af896ca76d4629ce1a83ae8da356d4808a Mon Sep 17 00:00:00 2001 From: "Oleksij Rempel (Alexey Fisher)" Date: Wed, 4 Jan 2012 11:09:23 +0100 Subject: [PATCH] basevideodecoder: add option to hande alt frame data altref/invisible 'frame' do not describe some frame directly, so it can't be displayed and timestamps should not be updated. Fix bug: https://bugzilla.gnome.org/show_bug.cgi?id=655245 Signed-off-by: Oleksij Rempel (Alexey Fisher) --- gst-libs/gst/video/gstbasevideocodec.h | 4 ++++ gst-libs/gst/video/gstbasevideodecoder.c | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/gst-libs/gst/video/gstbasevideocodec.h b/gst-libs/gst/video/gstbasevideocodec.h index 41c2282a6e..7a76f9d12a 100644 --- a/gst-libs/gst/video/gstbasevideocodec.h +++ b/gst-libs/gst/video/gstbasevideocodec.h @@ -124,6 +124,10 @@ struct _GstVideoFrame gboolean is_sync_point; gboolean is_eos; + /* Frames that should not be pushed downstream and are + * not meant for display */ + gboolean decode_only; + GstBuffer *sink_buffer; GstBuffer *src_buffer; diff --git a/gst-libs/gst/video/gstbasevideodecoder.c b/gst-libs/gst/video/gstbasevideodecoder.c index 6a5554ea31..83255f4141 100644 --- a/gst-libs/gst/video/gstbasevideodecoder.c +++ b/gst-libs/gst/video/gstbasevideodecoder.c @@ -1411,6 +1411,11 @@ gst_base_video_decoder_prepare_finish_frame (GstBaseVideoDecoder * } g_list_free (events); + /* Check if the data should not be displayed. For example altref/invisible + * frame in vp8. In this case we should not update the timestamps. */ + if (frame->decode_only) + return; + if (GST_CLOCK_TIME_IS_VALID (frame->presentation_timestamp)) { if (frame->presentation_timestamp != base_video_decoder->timestamp_offset) { GST_DEBUG_OBJECT (base_video_decoder, @@ -1564,7 +1569,7 @@ gst_base_video_decoder_finish_frame (GstBaseVideoDecoder * base_video_decoder, base_video_decoder->processed++; /* no buffer data means this frame is skipped */ - if (!frame->src_buffer) { + if (!frame->src_buffer || frame->decode_only) { GST_DEBUG_OBJECT (base_video_decoder, "skipping frame %" GST_TIME_FORMAT, GST_TIME_ARGS (frame->presentation_timestamp)); goto done;