an example of how to test for idle buffers using GST_PAD_PROBE_TYPE_IDLE

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

an example of how to test for idle buffers using GST_PAD_PROBE_TYPE_IDLE

vanderhoffer
Hi All,

I am having some issues with rtmpsink. Somewhere in my pipeline I am getting a buffer issue that is causing the rtmp feed to disconnect, even though the the pipeline reports GST_STATE_PLAYING

I have the following
elem_rtmp = gst_element_factory_make ("rtmpsink", "rtmpS");
elem_rtmp_pad_sink = gst_element_get_static_pad (elem_rtmp, "sink");
gst_pad_add_probe (elem_rtmp_pad_sink,GST_PAD_PROBE_TYPE_IDLE,doalert, NULL, NULL);



void *doalert(){
    printf("Probe reports no data\n");
}


Even though the stream disconnects, the probe never fires.
Have I got this wrong?

I do not want to block the element, just report when  the buffers stop flowing to it.

thx
Art
Reply | Threaded
Open this post in threaded view
|

Re: an example of how to test for idle buffers using GST_PAD_PROBE_TYPE_IDLE

Nicolas Dufresne-5
Le lundi 16 janvier 2017 à 15:02 -0800, vanderhoffer a écrit :

> I am having some issues with rtmpsink. Somewhere in my pipeline I am
> getting
> a buffer issue that is causing the rtmp feed to disconnect, even
> though the
> the pipeline reports GST_STATE_PLAYING
>
> I have the following
> /*elem_rtmp = gst_element_factory_make ("rtmpsink", "rtmpS");
> elem_rtmp_pad_sink = gst_element_get_static_pad (elem_rtmp, "sink"); 
> gst_pad_add_probe
> (elem_rtmp_pad_sink,GST_PAD_PROBE_TYPE_IDLE,doalert, NULL,
> NULL);*/
>
>
> /*void *doalert(){
>     printf("Probe reports no data\n");
> }*/
>
> Even though the stream disconnects, the probe never fires. 
> Have I got this wrong?
We have improved the documentation recently:

    When either one of GST_PAD_PROBE_TYPE_IDLE or
    GST_PAD_PROBE_TYPE_BLOCK is used, the probe will be a blocking
    probe.

>
> I do not want to block the element, just report when  the buffers
> stop
> flowing to it.

I have never tested that with an IDLE probe. The entire purpose of that
probe is to block the flow as soon as possible, rather then on the next
 buffer. But maybe returning GST_PAD_PROBE_PASS (rather then OK) will
prevent blocking. Let us know, you may also look into the code. It
looks like a strange use of this probe.

regards,
Nicolas
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (188 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: an example of how to test for idle buffers using GST_PAD_PROBE_TYPE_IDLE

vanderhoffer
Thanks Nicolas,

I could not get the probe to fire, so I rewrote it using gst_element_set_state() to ensure each pad was paused then play'd and this fixed the issue.

Thx
Art