mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-16 21:36:35 +00:00
avviddec: Implement SKIP and new SKIP_KEY_UNITS_ONLY flags
Respect any skip flags set in the incoming segment. https://bugzilla.gnome.org/show_bug.cgi?id=735666
This commit is contained in:
parent
99fb9bb207
commit
5758e82eaf
1 changed files with 22 additions and 10 deletions
|
@ -1072,12 +1072,22 @@ gst_ffmpegviddec_do_qos (GstFFMpegVidDec * ffmpegdec,
|
||||||
GstVideoCodecFrame * frame, gboolean * mode_switch)
|
GstVideoCodecFrame * frame, gboolean * mode_switch)
|
||||||
{
|
{
|
||||||
GstClockTimeDiff diff;
|
GstClockTimeDiff diff;
|
||||||
|
GstSegmentFlags skip_flags =
|
||||||
|
GST_VIDEO_DECODER_INPUT_SEGMENT (ffmpegdec).flags;
|
||||||
|
|
||||||
*mode_switch = FALSE;
|
*mode_switch = FALSE;
|
||||||
|
|
||||||
if (frame == NULL)
|
if (frame == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (skip_flags & GST_SEGMENT_FLAG_TRICKMODE_KEY_UNITS) {
|
||||||
|
ffmpegdec->context->skip_frame = AVDISCARD_NONKEY;
|
||||||
|
*mode_switch = TRUE;
|
||||||
|
} else if (skip_flags & GST_SEGMENT_FLAG_TRICKMODE) {
|
||||||
|
ffmpegdec->context->skip_frame = AVDISCARD_NONREF;
|
||||||
|
*mode_switch = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
diff =
|
diff =
|
||||||
gst_video_decoder_get_max_decode_time (GST_VIDEO_DECODER (ffmpegdec),
|
gst_video_decoder_get_max_decode_time (GST_VIDEO_DECODER (ffmpegdec),
|
||||||
frame);
|
frame);
|
||||||
|
@ -1088,6 +1098,7 @@ gst_ffmpegviddec_do_qos (GstFFMpegVidDec * ffmpegdec,
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (ffmpegdec, "decoding time %" G_GINT64_FORMAT, diff);
|
GST_DEBUG_OBJECT (ffmpegdec, "decoding time %" G_GINT64_FORMAT, diff);
|
||||||
|
|
||||||
|
if (*mode_switch == FALSE) {
|
||||||
if (diff > 0 && ffmpegdec->context->skip_frame != AVDISCARD_DEFAULT) {
|
if (diff > 0 && ffmpegdec->context->skip_frame != AVDISCARD_DEFAULT) {
|
||||||
ffmpegdec->context->skip_frame = AVDISCARD_DEFAULT;
|
ffmpegdec->context->skip_frame = AVDISCARD_DEFAULT;
|
||||||
*mode_switch = TRUE;
|
*mode_switch = TRUE;
|
||||||
|
@ -1101,6 +1112,7 @@ gst_ffmpegviddec_do_qos (GstFFMpegVidDec * ffmpegdec,
|
||||||
"QOS: hurry up, diff %" G_GINT64_FORMAT " >= 0", diff);
|
"QOS: hurry up, diff %" G_GINT64_FORMAT " >= 0", diff);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* get an outbuf buffer with the current picture */
|
/* get an outbuf buffer with the current picture */
|
||||||
static GstFlowReturn
|
static GstFlowReturn
|
||||||
|
|
Loading…
Reference in a new issue