From dfb62b9176a8f64c0d80ec04b72d204855f695a5 Mon Sep 17 00:00:00 2001 From: RSWilli Date: Wed, 27 Nov 2024 17:52:20 +0100 Subject: [PATCH] rename pad probe return constant since it was misleading --- examples/custom_events/main.go | 4 ++-- gst/constants.go | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/examples/custom_events/main.go b/examples/custom_events/main.go index 1445127..b158668 100644 --- a/examples/custom_events/main.go +++ b/examples/custom_events/main.go @@ -49,14 +49,14 @@ func createPipeline() (*gst.Pipeline, error) { // Extra check to make sure it is the right type. if ev.Type() != gst.EventTypeCustomDownstream { - return gst.PadProbeUnhandled + return gst.PadProbeHandled } // Unmarshal the event into our custom one var customEvent ExampleCustomEvent if err := ev.GetStructure().UnmarshalInto(&customEvent); err != nil { fmt.Println("Could not parse the custom event!") - return gst.PadProbeUnhandled + return gst.PadProbeHandled } // Log and act accordingly diff --git a/gst/constants.go b/gst/constants.go index b8f4b8c..fb0fa5e 100644 --- a/gst/constants.go +++ b/gst/constants.go @@ -456,11 +456,11 @@ type PadProbeReturn int // Type castings of ProbeReturns const ( - PadProbeDrop PadProbeReturn = C.GST_PAD_PROBE_DROP // (0) – drop data in data probes. For push mode this means that the data item is not sent downstream. For pull mode, it means that the data item is not passed upstream. In both cases, no other probes are called for this item and GST_FLOW_OK or TRUE is returned to the caller. - PadProbeOK PadProbeReturn = C.GST_PAD_PROBE_OK // (1) – normal probe return value. This leaves the probe in place, and defers decisions about dropping or passing data to other probes, if any. If there are no other probes, the default behavior for the probe type applies ('block' for blocking probes, and 'pass' for non-blocking probes). - PadProbeRemove PadProbeReturn = C.GST_PAD_PROBE_REMOVE // (2) – remove this probe. - PadProbePass PadProbeReturn = C.GST_PAD_PROBE_PASS // (3) – pass the data item in the block probe and block on the next item. - PadProbeUnhandled PadProbeReturn = C.GST_PAD_PROBE_HANDLED // (4) – Data has been handled in the probe and will not be forwarded further. For events and buffers this is the same behavior as GST_PAD_PROBE_DROP (except that in this case you need to unref the buffer or event yourself). For queries it will also return TRUE to the caller. The probe can also modify the GstFlowReturn value by using the GST_PAD_PROBE_INFO_FLOW_RETURN() accessor. Note that the resulting query must contain valid entries. Since: 1.6 + PadProbeDrop PadProbeReturn = C.GST_PAD_PROBE_DROP // (0) – drop data in data probes. For push mode this means that the data item is not sent downstream. For pull mode, it means that the data item is not passed upstream. In both cases, no other probes are called for this item and GST_FLOW_OK or TRUE is returned to the caller. + PadProbeOK PadProbeReturn = C.GST_PAD_PROBE_OK // (1) – normal probe return value. This leaves the probe in place, and defers decisions about dropping or passing data to other probes, if any. If there are no other probes, the default behavior for the probe type applies ('block' for blocking probes, and 'pass' for non-blocking probes). + PadProbeRemove PadProbeReturn = C.GST_PAD_PROBE_REMOVE // (2) – remove this probe. + PadProbePass PadProbeReturn = C.GST_PAD_PROBE_PASS // (3) – pass the data item in the block probe and block on the next item. + PadProbeHandled PadProbeReturn = C.GST_PAD_PROBE_HANDLED // (4) – Data has been handled in the probe and will not be forwarded further. For events and buffers this is the same behavior as GST_PAD_PROBE_DROP (except that in this case you need to unref the buffer or event yourself). For queries it will also return TRUE to the caller. The probe can also modify the GstFlowReturn value by using the GST_PAD_PROBE_INFO_FLOW_RETURN() accessor. Note that the resulting query must contain valid entries. Since: 1.6 ) // PadProbeType casts GstPadProbeType