<div dir="ltr">Hi!<div><br></div><div>Thank you. I tried with the code below:</div><div><br></div><div><div>static void check_latency (GstElement *element){</div><div><br></div><div> GstQuery * query;</div><div> gboolean live;</div><div> GstClockTime min_latency, max_latency;</div><div><br></div><div> g_print ( "DELAY: latency query\n" );</div><div><br></div><div> query = gst_query_new_latency();</div><div> if (!gst_element_query(GST_ELEMENT_CAST (element), query)){</div><div> g_print ( "DELAY: error getting latency\n" );</div><div> } else {</div><div> gst_query_parse_latency (query, &live, &min_latency, &max_latency);</div><div> gst_query_unref(query);</div><div> g_print ( "DELAY: min_latency %lu %" GST_TIME_FORMAT "ms\n",min_latency, GST_TIME_ARGS(min_latency) );</div><div> }</div><div><br></div><div>}</div></div><div><br></div><div>I am calling it from this tick_latency call using the sink element as parameter:</div><div><br></div><div><div>static gboolean tick_latency (gpointer data)</div><div>{</div><div> check_latency(sink);</div><div> return TRUE;</div><div>}</div></div><div><br></div><div>g_timeout_add (100, tick_latency, NULL);<br></div><div><br></div><div>However, the result is always zero. Do you see a problem? A reason to be zero?</div><div>In the log (below) this zero latency is returned through the pipeline.</div><div><br></div><div>Thanks for the help, don't know other way to collect this delay value.</div><div><br></div><div>[]s</div><div>Rafael</div><div><br></div><div><div>DELAY: latency query</div><div>0:00:23.013069583 25082 0x1710600 DEBUG query gstquery.c:674:gst_query_new_custom: creating new query 0x190acf0 latency</div><div>0:00:23.013155881 25082 0x1710600 DEBUG basesink gstbasesink.c:1120:gst_base_sink_query_latency:<enc_tx_sink> we are ready for LATENCY query</div><div>0:00:23.013261063 25082 0x1710600 DEBUG query gstquery.c:674:gst_query_new_custom: creating new query 0x190aa30 latency</div><div>0:00:23.013284896 25082 0x1710600 DEBUG GST_PADS gstpad.c:4042:gst_pad_peer_query:<enc_tx_sink:sink> peer query 0x190aa30 (latency)</div><div>0:00:23.013402964 25082 0x1710600 DEBUG GST_PADS gstpad.c:3915:gst_pad_query:<enc_tx_rtppay:src> doing query 0x190aa30 (latency)</div><div>0:00:23.013573045 25082 0x1710600 DEBUG query gstquery.c:674:gst_query_new_custom: creating new query 0x190aca0 latency</div><div>0:00:23.013616803 25082 0x1710600 DEBUG GST_PADS gstpad.c:4042:gst_pad_peer_query:<enc_tx_rtppay:sink> peer query 0x190aca0 (latency)</div><div>0:00:23.013671896 25082 0x1710600 DEBUG GST_PADS gstpad.c:3915:gst_pad_query:<enc_tx_enc:src> doing query 0x190aca0 (latency)</div><div>0:00:23.013740225 25082 0x1710600 DEBUG videoencoder gstvideoencoder.c:1298:gst_video_encoder_src_query:<enc_tx_enc> received query 7683, latency</div><div>0:00:23.013768880 25082 0x1710600 LOG videoencoder gstvideoencoder.c:1233:gst_video_encoder_src_query_default:<enc_tx_enc> handling query: latency query: 0x190aca0, GstQueryLatency, live=(boolean)false, min-latency=(guint64)0, max-latency=(guint64)18446744073709551615;</div><div>0:00:23.013812794 25082 0x1710600 DEBUG GST_PADS gstpad.c:4042:gst_pad_peer_query:<enc_tx_enc:sink> peer query 0x190aca0 (latency)</div><div>0:00:23.013868931 25082 0x1710600 DEBUG GST_PADS gstpad.c:3915:gst_pad_query:<enc_tx_videoparse:src> doing query 0x190aca0 (latency)</div><div>0:00:23.013923871 25082 0x1710600 DEBUG rawparse gstrawparse.c:957:gst_raw_parse_src_query: src_query latency</div><div>0:00:23.014137909 25082 0x1710600 DEBUG query gstquery.c:674:gst_query_new_custom: creating new query 0x190a850 latency</div><div>0:00:23.014193904 25082 0x1710600 DEBUG GST_PADS gstpad.c:4042:gst_pad_peer_query:<enc_tx_videoparse:sink> peer query 0x190a850 (latency)</div><div>0:00:23.014248918 25082 0x1710600 DEBUG GST_PADS gstpad.c:3915:gst_pad_query:<enc_tx_src:src> doing query 0x190a850 (latency)</div><div>0:00:23.014306937 25082 0x1710600 LOG basesrc gstbasesrc.c:733:gst_base_src_query_latency:<enc_tx_src> latency: live 0, min 0:00:00.000000000, max 0:00:00.000000000</div><div>0:00:23.014329539 25082 0x1710600 LOG basesrc gstbasesrc.c:1188:gst_base_src_default_query:<enc_tx_src> report latency: live 0, min 0:00:00.000000000, max 0:00:00.000000000</div><div>0:00:23.014358112 25082 0x1710600 DEBUG basesrc gstbasesrc.c:1296:gst_base_src_default_query:<enc_tx_src> query latency returns 1</div><div>0:00:23.014426751 25082 0x1710600 DEBUG GST_PADS gstpad.c:3938:gst_pad_query:<enc_tx_src:src> sent query 0x190a850 (latency), result 1</div><div>0:00:23.014483790 25082 0x1710600 LOG GST_PADS gstpad.c:3216:query_latency_default_fold:<enc_tx_videoparse:sink> got latency live:false min:0 max:0</div><div>0:00:23.014596087 25082 0x1710600 LOG GST_PADS gstpad.c:3287:gst_pad_query_latency_default:<enc_tx_videoparse:src> got latency live:false min:0 max:-1</div><div>0:00:23.014624050 25082 0x1710600 DEBUG GST_PADS gstpad.c:3372:gst_pad_query_default:<enc_tx_videoparse:src> not forwarding 0x190aca0 (latency) query</div><div>0:00:23.014672412 25082 0x1710600 DEBUG GST_PADS gstpad.c:3938:gst_pad_query:<enc_tx_videoparse:src> sent query 0x190aca0 (latency), result 1</div><div>0:00:23.014745701 25082 0x1710600 DEBUG videoencoder gstvideoencoder.c:1262:gst_video_encoder_src_query_default:<enc_tx_enc> Peer latency: live 0, min 0:00:00.000000000 max 99:99:99.999999999</div><div>0:00:23.014782668 25082 0x1710600 DEBUG GST_PADS gstpad.c:3938:gst_pad_query:<enc_tx_enc:src> sent query 0x190aca0 (latency), result 1</div><div>0:00:23.014823211 25082 0x1710600 LOG GST_PADS gstpad.c:3216:query_latency_default_fold:<enc_tx_rtppay:sink> got latency live:false min:0 max:-1</div><div>0:00:23.014909482 25082 0x1710600 LOG GST_PADS gstpad.c:3287:gst_pad_query_latency_default:<enc_tx_rtppay:src> got latency live:false min:0 max:-1</div><div>0:00:23.014937584 25082 0x1710600 DEBUG GST_PADS gstpad.c:3372:gst_pad_query_default:<enc_tx_rtppay:src> not forwarding 0x190aa30 (latency) query</div><div>0:00:23.014991787 25082 0x1710600 DEBUG GST_PADS gstpad.c:3938:gst_pad_query:<enc_tx_rtppay:src> sent query 0x190aa30 (latency), result 1</div><div>0:00:23.015118808 25082 0x1710600 DEBUG basesink gstbasesink.c:1162:gst_base_sink_query_latency:<enc_tx_sink> latency query: live: 1, have_latency 1, upstream: 0, min 0:00:00.000000000, max 99:99:99.999999999</div><div>0:00:23.015140338 25082 0x1710600 DEBUG basesink gstbasesink.c:4915:default_element_query:<enc_tx_sink> query latency returns 1</div><div>DELAY: min_latency 0 0:00:00.000000000ms</div></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 14 March 2018 at 13:29, Baby Octopus <span dir="ltr"><<a href="mailto:jagadishkamathk@gmail.com" target="_blank">jagadishkamathk@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">To get latency, do a query through gst_query_parse_latency() and get the<br>
min_latency. Max latency will<br>
you the max amount of time the data can get buffered in the pipeline<br>
<br>
~BO<br>
<br>
<br>
<br>
--<br>
Sent from: <a href="http://gstreamer-devel.966125.n4.nabble.com/" rel="noreferrer" target="_blank">http://gstreamer-devel.966125.<wbr>n4.nabble.com/</a><br>
<div class="HOEnZb"><div class="h5">______________________________<wbr>_________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.<wbr>freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/gstreamer-<wbr>devel</a><br>
</div></div></blockquote></div><br></div>