AW: Using PAD_PROBE_DROP and PAD_PROBE_PASS on trigger to selectively save images to filesink

Thornton, Keith keith.thornton at zeiss.com
Fri Sep 18 04:44:10 UTC 2020


Hi,
add some logging in your pad-probe (where you return DROP / REMOVED. The code which sets the pad-probe runs in one thread and the probe itself runs in the streaming thread. We can't see what happens in the first from this code sample. You will need some sort of synchronization between the threads. 
The first thread might be doing something which stops the pad-probe from doing its stuff.
You could also try GST_DEBUG=GST_EVENT*:4,GST_STATE*:4 or similar.
Gruesse

-----Ursprüngliche Nachricht-----
Von: gstreamer-devel <gstreamer-devel-bounces at lists.freedesktop.org> Im Auftrag von dlw
Gesendet: Donnerstag, 17. September 2020 21:58
An: gstreamer-devel at lists.freedesktop.org
Betreff: Using PAD_PROBE_DROP and PAD_PROBE_PASS on trigger to selectively save images to filesink

I've added a pad_probe on the src pad of a gstreamer filter element which is after a videotestsrc.

My goal is to use the pad_probe to drop all the buffers until I receive a trigger - keeping the pipeline PLAYING the entire time.

I have the pad_probe call_back successfully running on my trigger.

When I set up my pipeline I add the pad_probe with:

`_data0.probeid = gst_pad_add_probe(_data0.filterapad,
(GstPadProbeType)(GST_PAD_PROBE_TYPE_BLOCK ), pad_probe_link_cb, &_data0, NULL);`

The callback drops the buffer unless I set the trigger to TRUE. It then passes the buffer and resets the trigger.


static GstPadProbeReturn
 pad_probe_link_cb (GstPad * pad, GstPadProbeInfo * info, gpointer data_ptr) {

     //log_debug("%s", __func__);
     CustomData* data = (CustomData*)data_ptr; 
     if (data->trigger){
         log_debug("TRIGGER");

         //reset trigger
         data->trigger = false;
         
         return GST_PAD_PROBE_PASS;
     }

     return GST_PAD_PROBE_DROP;
  }

I have the pipeline running to a multifilesink but no files are being generated.  Is there another step I need to do to get the pipeline to pass the buffer all the way down to the filesink?



--
Sent from: https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fgstreamer-devel.966125.n4.nabble.com%2F&data=02%7C01%7C%7C956db8415cee495412d808d85b4cd93d%7C28042244bb514cd680347776fa3703e8%7C1%7C0%7C637359732903832357&sdata=Wxs548H5uJMBqWFhkcpRFki1rWYYhdUgACxL2L4ZPRY%3D&reserved=0
_______________________________________________
gstreamer-devel mailing list
gstreamer-devel at lists.freedesktop.org
https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Fgstreamer-devel&data=02%7C01%7C%7C956db8415cee495412d808d85b4cd93d%7C28042244bb514cd680347776fa3703e8%7C1%7C0%7C637359732903832357&sdata=4fQ7aaR%2BQRP3Hbv0f2Ubd%2FEYDDhB%2FSNfo%2BCpxwQFLrU%3D&reserved=0


More information about the gstreamer-devel mailing list