h265parse: Set duration on buffers base on framerate

This commit is contained in:
Zeeshan Ali 2018-07-28 14:54:42 +02:00 committed by GStreamer Merge Bot
parent 158d69fd45
commit 355719bae7

View file

@ -2288,9 +2288,15 @@ gst_h265_parse_parse_frame (GstBaseParse * parse, GstBaseParseFrame * frame)
gst_h265_parse_update_src_caps (h265parse, NULL); gst_h265_parse_update_src_caps (h265parse, NULL);
/* Fixme: Implement timestamp interpolation based on SEI Messagses */ if (h265parse->fps_num > 0 && h265parse->fps_den > 0) {
GST_FIXME_OBJECT (h265parse, GstH265SPS *sps = h265parse->nalparser->last_sps;
"Implement timestamp/duration interpolation based on SEI message"); GstClockTime val;
val = (sps != NULL && sps->profile_tier_level.interlaced_source_flag) ?
GST_SECOND / 2 : GST_SECOND;
GST_BUFFER_DURATION (buffer) = gst_util_uint64_scale (val,
h265parse->fps_den, h265parse->fps_num);
}
if (h265parse->keyframe) if (h265parse->keyframe)
GST_BUFFER_FLAG_UNSET (buffer, GST_BUFFER_FLAG_DELTA_UNIT); GST_BUFFER_FLAG_UNSET (buffer, GST_BUFFER_FLAG_DELTA_UNIT);