<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<div name="messageBodySection">
<div dir="auto">Apologies. I should have linked to the official repo instead <a href="https://github.com/GStreamer/gstreamer/blob/a02f0ea3922ffacde04731108b19fcfc8037e00a/subprojects/gstreamer/plugins/elements/gstinputselector.c#L1028-L1036" target="_blank">https://github.com/GStreamer/gstreamer/blob/a02f0ea3922ffacde04731108b19fcfc8037e00a/subprojects/gstreamer/plugins/elements/gstinputselector.c#L1028-L1036</a></div>
</div>
<div name="messageReplySection">On 18 Jun 2022, 12:51 PM +1000, John McDermott via gstreamer-devel <gstreamer-devel@lists.freedesktop.org>, wrote:<br />
<blockquote type="cite" style="border-left-color: grey; border-left-width: thin; border-left-style: solid; margin: 5px 5px;padding-left: 10px;">
<div name="messageBodySection">
<div dir="auto">Hello all,<br />
<br />
I’m trying to have a better grasp of how input-selector works. I see the following lines are responsible for advancing the active pad by reading off the pad’s buffer:<br />
<br />
while (!sel->eos && !sel->flushing && !selpad->flushing &&<br />
 (cached_buffer = g_queue_pop_head (selpad->cached_buffers))) {<br />
 GST_DEBUG_OBJECT (pad, "Cached buffers found, "<br />
 "invoking chain for cached buffer %p", cached_buffer->buffer);<br />
<br />
 selpad->segment = cached_buffer->segment;<br />
 selpad->events_pending = TRUE;<br />
 GST_INPUT_SELECTOR_UNLOCK (sel);<br />
 gst_selector_pad_chain (pad, parent, cached_buffer->buffer);<br />
<br />
<a href="https://github.com/Kurento/gstreamer/blob/master/plugins/elements/gstinputselector.c#L1006-L1014" target="_blank">https://github.com/Kurento/gstreamer/blob/master/plugins/elements/gstinputselector.c#L1006-L1014</a><br />
<br />
My take is that unless the element is flushing or EOS has been received, the recursion reads all cached buffers and pushes them to the source pad:<br />
<br />
res = gst_pad_push (sel->srcpad, buf);<br />
<br />
<a href="https://github.com/Kurento/gstreamer/blob/84c84bf8fb75d372bc740308e68d7c1030277b4f/plugins/elements/gstinputselector.c#L1109" target="_blank">https://github.com/Kurento/gstreamer/blob/84c84bf8fb75d372bc740308e68d7c1030277b4f/plugins/elements/gstinputselector.c#L1109</a><br />
<br />
But how is timing between cached buffers/frames respected? The cached buffers appear to be pushed to the source pad without timing checks.<br />
<br />
Thanks for any advice.<br />
<br />
John</div>
</div>
</blockquote>
</div>
</body>
</html>