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

dlw dlwalter at protonmail.com
Thu Sep 17 19:57:46 UTC 2020


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: http://gstreamer-devel.966125.n4.nabble.com/


More information about the gstreamer-devel mailing list