mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-07 07:58:51 +00:00
tsdemux: Report latency (700ms)
This commit is contained in:
parent
c492b00b69
commit
8f433e1677
1 changed files with 25 additions and 0 deletions
|
@ -395,6 +395,7 @@ gst_ts_demux_srcpad_query_types (GstPad * pad)
|
||||||
static const GstQueryType query_types[] = {
|
static const GstQueryType query_types[] = {
|
||||||
GST_QUERY_DURATION,
|
GST_QUERY_DURATION,
|
||||||
GST_QUERY_SEEKING,
|
GST_QUERY_SEEKING,
|
||||||
|
GST_QUERY_LATENCY,
|
||||||
0
|
0
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -425,6 +426,30 @@ gst_ts_demux_srcpad_query (GstPad * pad, GstQuery * query)
|
||||||
res = FALSE;
|
res = FALSE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case GST_QUERY_LATENCY:
|
||||||
|
{
|
||||||
|
GST_DEBUG ("query latency");
|
||||||
|
res = gst_pad_peer_query (base->sinkpad, query);
|
||||||
|
if (res && base->upstream_live) {
|
||||||
|
GstClockTime min_lat, max_lat;
|
||||||
|
gboolean live;
|
||||||
|
|
||||||
|
/* According to H.222.0
|
||||||
|
Annex D.0.3 (System Time Clock recovery in the decoder)
|
||||||
|
and D.0.2 (Audio and video presentation synchronization)
|
||||||
|
|
||||||
|
We can end up with an interval of up to 700ms between valid
|
||||||
|
PCR/SCR. We therefore allow a latency of 700ms for that.
|
||||||
|
*/
|
||||||
|
gst_query_parse_latency (query, &live, &min_lat, &max_lat);
|
||||||
|
if (min_lat != -1)
|
||||||
|
min_lat += 700 * GST_MSECOND;
|
||||||
|
if (max_lat != -1)
|
||||||
|
max_lat += 700 * GST_MSECOND;
|
||||||
|
gst_query_set_latency (query, live, min_lat, max_lat);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
case GST_QUERY_SEEKING:
|
case GST_QUERY_SEEKING:
|
||||||
GST_DEBUG ("query seeking");
|
GST_DEBUG ("query seeking");
|
||||||
gst_query_parse_seeking (query, &format, NULL, NULL, NULL);
|
gst_query_parse_seeking (query, &format, NULL, NULL, NULL);
|
||||||
|
|
Loading…
Reference in a new issue