mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-25 19:21:06 +00:00
splitmuxsink: Override LATENCY query to pretend to downstream that we're not live
splitmuxsink can't possibly know how much latency it will introduce as it always keeps one GOP around before outputting something. This breaks the latency configuration of the pipeline and we're better off just pretending that everything downstream of the sinkpads is not live. Especially muxers that are based on aggregator and time out on the latency deadline can easily misbehave otherwise as the deadline will be exceeded usually. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7499>
This commit is contained in:
parent
e59056526a
commit
256a941d3a
1 changed files with 20 additions and 1 deletions
|
@ -3056,6 +3056,25 @@ handle_mq_input (GstPad * pad, GstPadProbeInfo * info, MqStreamCtx * ctx)
|
|||
default:
|
||||
return GST_PAD_PROBE_PASS;
|
||||
}
|
||||
} else if (info->type & GST_PAD_PROBE_TYPE_QUERY_UPSTREAM) {
|
||||
switch (GST_QUERY_TYPE (GST_QUERY (info->data))) {
|
||||
case GST_QUERY_LATENCY:
|
||||
// Override the latency query to pretend that everything downstream
|
||||
// of the sink pads is actually not live. splitmuxsink doesn't know
|
||||
// how much latency it will possibly introduce.
|
||||
if (info->type & GST_PAD_PROBE_TYPE_PUSH) {
|
||||
GST_DEBUG_OBJECT (pad,
|
||||
"Overriding latency query to pretend we're not live");
|
||||
gst_query_set_latency (info->data, FALSE, 0, GST_CLOCK_TIME_NONE);
|
||||
return GST_PAD_PROBE_HANDLED;
|
||||
} else {
|
||||
// Should not happen as we already handled it above.
|
||||
g_warn_if_reached ();
|
||||
return GST_PAD_PROBE_PASS;
|
||||
}
|
||||
default:
|
||||
return GST_PAD_PROBE_PASS;
|
||||
}
|
||||
}
|
||||
|
||||
buf = gst_pad_probe_info_get_buffer (info);
|
||||
|
@ -3713,7 +3732,7 @@ gst_splitmux_sink_request_new_pad (GstElement * element,
|
|||
ctx->sink_pad_block_id =
|
||||
gst_pad_add_probe (q_sink,
|
||||
GST_PAD_PROBE_TYPE_DATA_DOWNSTREAM | GST_PAD_PROBE_TYPE_EVENT_FLUSH |
|
||||
GST_PAD_PROBE_TYPE_QUERY_DOWNSTREAM,
|
||||
GST_PAD_PROBE_TYPE_QUERY_DOWNSTREAM | GST_PAD_PROBE_TYPE_QUERY_UPSTREAM,
|
||||
(GstPadProbeCallback) handle_mq_input, ctx, NULL);
|
||||
|
||||
GST_DEBUG_OBJECT (splitmux, "splitmuxsink pad %" GST_PTR_FORMAT
|
||||
|
|
Loading…
Reference in a new issue