probe type mask and a callback.
gulong gst_pad_add_probe (GstPad *pad,
- GstProbeType mask,
+ GstPadProbeType mask,
GstPadProbeCallback callback,
gpointer user_data,
GDestroyNotify destroy_data);
typedef enum
{
- GST_PROBE_TYPE_INVALID = 0,
+ GST_PAD_PROBE_TYPE_INVALID = 0,
/* flags to control blocking */
- GST_PROBE_TYPE_IDLE = (1 << 0),
- GST_PROBE_TYPE_BLOCK = (1 << 1),
+ GST_PAD_PROBE_TYPE_IDLE = (1 << 0),
+ GST_PAD_PROBE_TYPE_BLOCK = (1 << 1),
/* flags to select datatypes */
- GST_PROBE_TYPE_BUFFER = (1 << 2),
- GST_PROBE_TYPE_BUFFER_LIST = (1 << 3),
- GST_PROBE_TYPE_EVENT = (1 << 4),
+ GST_PAD_PROBE_TYPE_BUFFER = (1 << 2),
+ GST_PAD_PROBE_TYPE_BUFFER_LIST = (1 << 3),
+ GST_PAD_PROBE_TYPE_EVENT = (1 << 4),
/* flags to select scheduling mode */
- GST_PROBE_TYPE_PUSH = (1 << 5),
- GST_PROBE_TYPE_PULL = (1 << 6),
- } GstProbeType;
+ GST_PAD_PROBE_TYPE_PUSH = (1 << 5),
+ GST_PAD_PROBE_TYPE_PULL = (1 << 6),
+ } GstPadProbeType;
When adding a probe with the IDLE or BLOCK flag, the probe will become a
blocking probe (see below). Otherwise the probe will be a DATA probe.
The probe callback is defined as:
- GstProbeReturn (*GstPadProbeCallback) (GstPad *pad, GstProbeType type,
+ GstPadProbeReturn (*GstPadProbeCallback) (GstPad *pad, GstPadProbeType type,
gpointer type_data,
gpointer user_data);
typedef enum
{
- GST_PROBE_DROP,
- GST_PROBE_OK,
- GST_PROBE_REMOVE,
- GST_PROBE_PASS,
- } GstProbeReturn;
-
- GST_PROBE_OK is the normal return value. DROP will drop the item that is
- currently being probed. GST_PROBE_REMOVE the currently executing probe from the
+ GST_PAD_PROBE_DROP,
+ GST_PAD_PROBE_OK,
+ GST_PAD_PROBE_REMOVE,
+ GST_PAD_PROBE_PASS,
+ } GstPadProbeReturn;
+
+ GST_PAD_PROBE_OK is the normal return value. DROP will drop the item that is
+ currently being probed. GST_PAD_PROBE_REMOVE the currently executing probe from the
list of probes.
- GST_PROBE_PASS is relevant for blocking probes and will temporarily unblock the
+ GST_PAD_PROBE_PASS is relevant for blocking probes and will temporarily unblock the
pad and let the item trough, it will then block again on the next item.
callback is thus only called when there is new data on the pad.
The blocking probe is removed with gst_pad_remove_probe() or when the probe
- callback return GST_PROBE_REMOVE. In both cases, and if this was the last
+ callback return GST_PAD_PROBE_REMOVE. In both cases, and if this was the last
blocking probe on the pad, the pad is unblocked and dataflow can continue.
Push dataflow
-------------
-All probes have the GST_PROBE_TYPE_PUSH flag set in the callbacks.
+All probes have the GST_PAD_PROBE_TYPE_PUSH flag set in the callbacks.
In push based scheduling, the blocking probe is called first with the data item.
Then the data probes are called before the peer pad chain or event function is
Pull dataflow
-------------
-All probes have the GST_PROBE_TYPE_PULL flag set in the callbacks.
+All probes have the GST_PAD_PROBE_TYPE_PULL flag set in the callbacks.
The gst_pad_pull_range() call will first trigger the BLOCK probes without a DATA
item. This allows the pad to be linked before the peer pad is resolved.
GST_PAD_LINK_CHECK_DEFAULT
GstFlowReturn
GstActivateMode
-GstProbeReturn
-GstProbeType
-GST_PROBE_TYPE_BLOCKING
-GST_PROBE_TYPE_DATA
-GST_PROBE_TYPE_SCHEDULING
+GstPadProbeReturn
+GstPadProbeType
+GST_PAD_PROBE_TYPE_BLOCKING
+GST_PAD_PROBE_TYPE_DATA
+GST_PAD_PROBE_TYPE_SCHEDULING
<SUBSECTION Application>
gst_pad_get_name
gst_pad_set_blocked(), gst_pad_set_blocked_async(),
gst_pad_set_blocked_async_full() are removed, use the gst_pad_add_probe()
- method with the GST_PROBE_TYPE_BLOCK to get the same result as the async
+ method with the GST_PAD_PROBE_TYPE_BLOCK to get the same result as the async
blocking version. There is no more sync version of blocking, this is in
general dangerous and can be implemented using the callbacks if needed.
g_type_class_ref (gst_memory_flags_get_type ());
g_type_class_ref (gst_map_flags_get_type ());
g_type_class_ref (gst_caps_intersect_mode_get_type ());
- g_type_class_ref (gst_probe_type_get_type ());
- g_type_class_ref (gst_probe_return_get_type ());
+ g_type_class_ref (gst_pad_probe_type_get_type ());
+ g_type_class_ref (gst_pad_probe_return_get_type ());
g_type_class_ref (gst_segment_flags_get_type ());
_priv_gst_event_initialize ();
g_type_class_unref (g_type_class_peek (gst_memory_flags_get_type ()));
g_type_class_unref (g_type_class_peek (gst_map_flags_get_type ()));
g_type_class_unref (g_type_class_peek (gst_caps_intersect_mode_get_type ()));
- g_type_class_unref (g_type_class_peek (gst_probe_type_get_type ()));
- g_type_class_unref (g_type_class_peek (gst_probe_return_get_type ()));
+ g_type_class_unref (g_type_class_peek (gst_pad_probe_type_get_type ()));
+ g_type_class_unref (g_type_class_peek (gst_pad_probe_return_get_type ()));
g_type_class_unref (g_type_class_peek (gst_segment_flags_get_type ()));
gst_deinitialized = TRUE;
typedef struct
{
GstPad *pad;
- GstProbeType mask;
+ GstPadProbeType mask;
gpointer type_data;
- GstProbeReturn ret;
+ GstPadProbeReturn ret;
gboolean pass;
guint cookie;
} ProbeMarshall;
* MT safe.
*/
gulong
-gst_pad_add_probe (GstPad * pad, GstProbeType mask,
+gst_pad_add_probe (GstPad * pad, GstPadProbeType mask,
GstPadProbeCallback callback, gpointer user_data,
GDestroyNotify destroy_data)
{
* This means that _add_probe() might return a valid probeid ...
* which will potentially never be called if the pad
* is activated in the wrong direction */
- if (G_UNLIKELY ((mask & GST_PROBE_TYPE_PUSH) &&
+ if (G_UNLIKELY ((mask & GST_PAD_PROBE_TYPE_PUSH) &&
(GST_PAD_ACTIVATE_MODE (pad) == GST_ACTIVATE_PULL)))
goto wrong_direction;
- if (G_UNLIKELY ((mask & GST_PROBE_TYPE_PULL) &&
+ if (G_UNLIKELY ((mask & GST_PAD_PROBE_TYPE_PULL) &&
(GST_PAD_ACTIVATE_MODE (pad) == GST_ACTIVATE_PUSH)))
goto wrong_direction;
/* when no contraints are given for the types, assume all types are
* acceptable */
- if ((mask & GST_PROBE_TYPE_DATA) == 0)
- mask |= GST_PROBE_TYPE_DATA;
- if ((mask & GST_PROBE_TYPE_SCHEDULING) == 0)
- mask |= GST_PROBE_TYPE_SCHEDULING;
+ if ((mask & GST_PAD_PROBE_TYPE_DATA) == 0)
+ mask |= GST_PAD_PROBE_TYPE_DATA;
+ if ((mask & GST_PAD_PROBE_TYPE_SCHEDULING) == 0)
+ mask |= GST_PAD_PROBE_TYPE_SCHEDULING;
/* store our flags and other fields */
hook->flags |= (mask << G_HOOK_FLAG_USER_SHIFT);
GST_CAT_LOG_OBJECT (GST_CAT_SCHEDULING, pad, "got probe id %lu", res);
- if (mask & GST_PROBE_TYPE_BLOCKING) {
+ if (mask & GST_PAD_PROBE_TYPE_BLOCKING) {
/* we have a block probe */
pad->num_blocked++;
GST_OBJECT_FLAG_SET (pad, GST_PAD_BLOCKED);
}
/* call the callback if we need to be called for idle callbacks */
- if ((mask & GST_PROBE_TYPE_IDLE) && (callback != NULL)) {
+ if ((mask & GST_PAD_PROBE_TYPE_IDLE) && (callback != NULL)) {
if (pad->priv->using > 0) {
/* the pad is in use, we can't signal the idle callback yet. Since we set the
* flag above, the last thread to leave the push will do the callback. New
"pad is idle, trigger idle callback");
GST_OBJECT_UNLOCK (pad);
- callback (pad, GST_PROBE_TYPE_IDLE, NULL, user_data);
+ callback (pad, GST_PAD_PROBE_TYPE_IDLE, NULL, user_data);
}
} else {
GST_OBJECT_UNLOCK (pad);
static void
cleanup_hook (GstPad * pad, GHook * hook)
{
- GstProbeType type;
+ GstPadProbeType type;
type = (hook->flags) >> G_HOOK_FLAG_USER_SHIFT;
- if (type & GST_PROBE_TYPE_BLOCKING) {
+ if (type & GST_PAD_PROBE_TYPE_BLOCKING) {
/* unblock when we remove the last blocking probe */
pad->num_blocked--;
GST_DEBUG_OBJECT (pad, "remove blocking probe, now %d left",
probe_hook_marshal (GHook * hook, ProbeMarshall * data)
{
GstPad *pad = data->pad;
- GstProbeType flags;
+ GstPadProbeType flags;
GstPadProbeCallback callback;
- GstProbeReturn ret;
+ GstPadProbeReturn ret;
/* if we have called this callback, do nothing */
if (PROBE_COOKIE (hook) == data->cookie)
flags = hook->flags >> G_HOOK_FLAG_USER_SHIFT;
/* one of the data types */
- if ((flags & GST_PROBE_TYPE_DATA & data->mask) == 0)
+ if ((flags & GST_PAD_PROBE_TYPE_DATA & data->mask) == 0)
return;
/* one of the scheduling types */
- if ((flags & GST_PROBE_TYPE_SCHEDULING & data->mask) == 0)
+ if ((flags & GST_PAD_PROBE_TYPE_SCHEDULING & data->mask) == 0)
return;
/* all of the blocking types must match */
- if ((flags & GST_PROBE_TYPE_BLOCKING) !=
- (data->mask & GST_PROBE_TYPE_BLOCKING))
+ if ((flags & GST_PAD_PROBE_TYPE_BLOCKING) !=
+ (data->mask & GST_PAD_PROBE_TYPE_BLOCKING))
return;
GST_CAT_LOG_OBJECT (GST_CAT_SCHEDULING, pad,
GST_OBJECT_LOCK (pad);
switch (ret) {
- case GST_PROBE_REMOVE:
+ case GST_PAD_PROBE_REMOVE:
/* remove the probe */
GST_DEBUG_OBJECT (pad, "asked to remove hook");
cleanup_hook (pad, hook);
break;
- case GST_PROBE_DROP:
+ case GST_PAD_PROBE_DROP:
/* need to drop the data, make sure other probes don't get called
* anymore */
GST_DEBUG_OBJECT (pad, "asked to drop item");
- data->mask = GST_PROBE_TYPE_INVALID;
- data->ret = GST_PROBE_DROP;
+ data->mask = GST_PAD_PROBE_TYPE_INVALID;
+ data->ret = GST_PAD_PROBE_DROP;
break;
- case GST_PROBE_PASS:
+ case GST_PAD_PROBE_PASS:
/* inform the pad block to let things pass */
GST_DEBUG_OBJECT (pad, "asked to pass item");
data->pass = TRUE;
PROBE_FULL(pad, mask, data, label, GST_FLOW_OK);
static GstFlowReturn
-do_probe_callbacks (GstPad * pad, GstProbeType mask, gpointer type_data,
+do_probe_callbacks (GstPad * pad, GstPadProbeType mask, gpointer type_data,
GstFlowReturn defaultval)
{
ProbeMarshall data;
data.pad = pad;
data.mask = mask;
data.type_data = type_data;
- data.ret = GST_PROBE_OK;
+ data.ret = GST_PAD_PROBE_OK;
data.pass = FALSE;
data.cookie = pad->priv->probe_cookie++;
goto again;
}
- if (data.ret == GST_PROBE_DROP)
+ if (data.ret == GST_PAD_PROBE_DROP)
goto dropped;
if (data.pass)
goto passed;
- if (mask & GST_PROBE_TYPE_BLOCK) {
+ if (mask & GST_PAD_PROBE_TYPE_BLOCK) {
while (GST_PAD_IS_BLOCKED (pad)) {
GST_CAT_LOG_OBJECT (GST_CAT_SCHEDULING, pad,
"we are blocked %d times", pad->num_blocked);
* checking for that little extra speed.
*/
static inline GstFlowReturn
-gst_pad_chain_data_unchecked (GstPad * pad, GstProbeType type, void *data)
+gst_pad_chain_data_unchecked (GstPad * pad, GstPadProbeType type, void *data)
{
GstFlowReturn ret;
gboolean needs_events;
goto events_error;
}
- PROBE (pad, GST_PROBE_TYPE_PUSH | type, data, probe_stopped);
+ PROBE (pad, GST_PAD_PROBE_TYPE_PUSH | type, data, probe_stopped);
GST_OBJECT_UNLOCK (pad);
* the data to the wrong function. This is not really a
* problem since functions are assigned at creation time
* and don't change that often... */
- if (G_LIKELY (type & GST_PROBE_TYPE_BUFFER)) {
+ if (G_LIKELY (type & GST_PAD_PROBE_TYPE_BUFFER)) {
GstPadChainFunction chainfunc;
if (G_UNLIKELY ((chainfunc = GST_PAD_CHAINFUNC (pad)) == NULL))
g_return_val_if_fail (GST_PAD_IS_SINK (pad), GST_FLOW_ERROR);
g_return_val_if_fail (GST_IS_BUFFER (buffer), GST_FLOW_ERROR);
- return gst_pad_chain_data_unchecked (pad, GST_PROBE_TYPE_BUFFER, buffer);
+ return gst_pad_chain_data_unchecked (pad, GST_PAD_PROBE_TYPE_BUFFER, buffer);
}
static GstFlowReturn
for (i = 0; i < len; i++) {
buffer = gst_buffer_list_get (list, i);
ret =
- gst_pad_chain_data_unchecked (pad, GST_PROBE_TYPE_BUFFER,
+ gst_pad_chain_data_unchecked (pad, GST_PAD_PROBE_TYPE_BUFFER,
gst_buffer_ref (buffer));
if (ret != GST_FLOW_OK)
break;
g_return_val_if_fail (GST_PAD_IS_SINK (pad), GST_FLOW_ERROR);
g_return_val_if_fail (GST_IS_BUFFER_LIST (list), GST_FLOW_ERROR);
- return gst_pad_chain_data_unchecked (pad, GST_PROBE_TYPE_BUFFER_LIST, list);
+ return gst_pad_chain_data_unchecked (pad, GST_PAD_PROBE_TYPE_BUFFER_LIST,
+ list);
}
static GstFlowReturn
-gst_pad_push_data (GstPad * pad, GstProbeType type, void *data)
+gst_pad_push_data (GstPad * pad, GstPadProbeType type, void *data)
{
GstPad *peer;
GstFlowReturn ret;
if (G_UNLIKELY (GST_PAD_IS_FLUSHING (pad)))
goto flushing;
- type |= GST_PROBE_TYPE_PUSH;
+ type |= GST_PAD_PROBE_TYPE_PUSH;
/* do block probes */
- PROBE (pad, type | GST_PROBE_TYPE_BLOCK, data, probe_stopped);
+ PROBE (pad, type | GST_PAD_PROBE_TYPE_BLOCK, data, probe_stopped);
/* do post-blocking probes */
PROBE (pad, type, data, probe_stopped);
pad->priv->using--;
if (pad->priv->using == 0) {
/* pad is not active anymore, trigger idle callbacks */
- PROBE_FULL (pad, GST_PROBE_TYPE_PUSH | GST_PROBE_TYPE_IDLE, NULL,
+ PROBE_FULL (pad, GST_PAD_PROBE_TYPE_PUSH | GST_PAD_PROBE_TYPE_IDLE, NULL,
probe_stopped, ret);
}
GST_OBJECT_UNLOCK (pad);
g_return_val_if_fail (GST_PAD_IS_SRC (pad), GST_FLOW_ERROR);
g_return_val_if_fail (GST_IS_BUFFER (buffer), GST_FLOW_ERROR);
- return gst_pad_push_data (pad, GST_PROBE_TYPE_BUFFER, buffer);
+ return gst_pad_push_data (pad, GST_PAD_PROBE_TYPE_BUFFER, buffer);
}
/**
g_return_val_if_fail (GST_PAD_IS_SRC (pad), GST_FLOW_ERROR);
g_return_val_if_fail (GST_IS_BUFFER_LIST (list), GST_FLOW_ERROR);
- return gst_pad_push_data (pad, GST_PROBE_TYPE_BUFFER_LIST, list);
+ return gst_pad_push_data (pad, GST_PAD_PROBE_TYPE_BUFFER_LIST, list);
}
static GstFlowReturn
/* can only fire the signal if we have a valid buffer */
GST_OBJECT_LOCK (pad);
- PROBE (pad, GST_PROBE_TYPE_PULL | GST_PROBE_TYPE_BUFFER, *buffer,
+ PROBE (pad, GST_PAD_PROBE_TYPE_PULL | GST_PAD_PROBE_TYPE_BUFFER, *buffer,
probe_stopped);
GST_OBJECT_UNLOCK (pad);
if (G_UNLIKELY (GST_PAD_IS_FLUSHING (pad)))
goto flushing;
- PROBE (pad, GST_PROBE_TYPE_PULL | GST_PROBE_TYPE_BLOCK, NULL,
+ PROBE (pad, GST_PAD_PROBE_TYPE_PULL | GST_PAD_PROBE_TYPE_BLOCK, NULL,
pre_probe_stopped);
if (G_UNLIKELY ((peer = GST_PAD_PEER (pad)) == NULL))
pad->priv->using--;
if (pad->priv->using == 0) {
/* pad is not active anymore, trigger idle callbacks */
- PROBE (pad, GST_PROBE_TYPE_PULL | GST_PROBE_TYPE_IDLE, NULL,
+ PROBE (pad, GST_PAD_PROBE_TYPE_PULL | GST_PAD_PROBE_TYPE_IDLE, NULL,
post_probe_stopped);
}
if (G_UNLIKELY (ret != GST_FLOW_OK))
goto pull_range_failed;
- PROBE (pad, GST_PROBE_TYPE_PULL | GST_PROBE_TYPE_BUFFER, buffer,
+ PROBE (pad, GST_PAD_PROBE_TYPE_PULL | GST_PAD_PROBE_TYPE_BUFFER, buffer,
post_probe_stopped);
needs_events = GST_PAD_NEEDS_EVENTS (pad);
/* Remove sticky EOS events */
GST_LOG_OBJECT (pad, "Removing pending EOS events");
- gst_event_replace (&pad->
- priv->events[GST_EVENT_STICKY_IDX_TYPE (GST_EVENT_EOS)].pending,
- NULL);
- gst_event_replace (&pad->
- priv->events[GST_EVENT_STICKY_IDX_TYPE (GST_EVENT_EOS)].event, NULL);
+ gst_event_replace (&pad->priv->
+ events[GST_EVENT_STICKY_IDX_TYPE (GST_EVENT_EOS)].pending, NULL);
+ gst_event_replace (&pad->priv->
+ events[GST_EVENT_STICKY_IDX_TYPE (GST_EVENT_EOS)].event, NULL);
if (G_UNLIKELY (GST_PAD_IS_BLOCKED (pad))) {
GST_LOG_OBJECT (pad, "Pad is blocked, not forwarding flush-stop");
if (G_UNLIKELY (GST_PAD_IS_FLUSHING (pad)))
goto flushed;
- PROBE (pad, GST_PROBE_TYPE_PUSH | GST_PROBE_TYPE_EVENT
- | GST_PROBE_TYPE_BLOCK, event, probe_stopped);
+ PROBE (pad, GST_PAD_PROBE_TYPE_PUSH | GST_PAD_PROBE_TYPE_EVENT
+ | GST_PAD_PROBE_TYPE_BLOCK, event, probe_stopped);
break;
}
}
/* send probes after modifying the events above */
- PROBE (pad, GST_PROBE_TYPE_PUSH | GST_PROBE_TYPE_EVENT, event, probe_stopped);
+ PROBE (pad, GST_PAD_PROBE_TYPE_PUSH | GST_PAD_PROBE_TYPE_EVENT, event,
+ probe_stopped);
/* now check the peer pad */
if (peerpad == NULL)
pad->priv->using--;
if (pad->priv->using == 0) {
/* pad is not active anymore, trigger idle callbacks */
- PROBE (pad, GST_PROBE_TYPE_PUSH | GST_PROBE_TYPE_IDLE, NULL, probe_stopped);
+ PROBE (pad, GST_PAD_PROBE_TYPE_PUSH | GST_PAD_PROBE_TYPE_IDLE, NULL,
+ probe_stopped);
}
GST_OBJECT_UNLOCK (pad);
}
/* Remove pending EOS events */
GST_LOG_OBJECT (pad, "Removing pending EOS events");
- gst_event_replace (&pad->
- priv->events[GST_EVENT_STICKY_IDX_TYPE (GST_EVENT_EOS)].pending,
- NULL);
- gst_event_replace (&pad->
- priv->events[GST_EVENT_STICKY_IDX_TYPE (GST_EVENT_EOS)].event, NULL);
+ gst_event_replace (&pad->priv->
+ events[GST_EVENT_STICKY_IDX_TYPE (GST_EVENT_EOS)].pending, NULL);
+ gst_event_replace (&pad->priv->
+ events[GST_EVENT_STICKY_IDX_TYPE (GST_EVENT_EOS)].event, NULL);
GST_OBJECT_UNLOCK (pad);
/* grab stream lock */
if (G_UNLIKELY (GST_PAD_IS_FLUSHING (pad)))
goto flushing;
- PROBE (pad, GST_PROBE_TYPE_PUSH | GST_PROBE_TYPE_EVENT, event,
+ PROBE (pad, GST_PAD_PROBE_TYPE_PUSH | GST_PAD_PROBE_TYPE_EVENT, event,
probe_stopped);
break;
typedef gboolean (*GstPadForwardFunction) (GstPad *pad, gpointer user_data);
/**
- * GstProbeType:
- * @GST_PROBE_TYPE_INVALID: invalid probe type
- * @GST_PROBE_TYPE_IDLE: probe idle pads and block
- * @GST_PROBE_TYPE_BLOCK: probe and block pads
- * @GST_PROBE_TYPE_BUFFER: probe buffers
- * @GST_PROBE_TYPE_BUFFER_LIST: probe buffer lists
- * @GST_PROBE_TYPE_EVENT: probe events
- * @GST_PROBE_TYPE_PUSH: probe push
- * @GST_PROBE_TYPE_PULL: probe pull
+ * GstPadProbeType:
+ * @GST_PAD_PROBE_TYPE_INVALID: invalid probe type
+ * @GST_PAD_PROBE_TYPE_IDLE: probe idle pads and block
+ * @GST_PAD_PROBE_TYPE_BLOCK: probe and block pads
+ * @GST_PAD_PROBE_TYPE_BUFFER: probe buffers
+ * @GST_PAD_PROBE_TYPE_BUFFER_LIST: probe buffer lists
+ * @GST_PAD_PROBE_TYPE_EVENT: probe events
+ * @GST_PAD_PROBE_TYPE_PUSH: probe push
+ * @GST_PAD_PROBE_TYPE_PULL: probe pull
*
* The different probing types that can occur. When either one of
- * @GST_PROBE_TYPE_IDLE or @GST_PROBE_TYPE_BLOCK is used, the probe will be a
+ * @GST_PAD_PROBE_TYPE_IDLE or @GST_PAD_PROBE_TYPE_BLOCK is used, the probe will be a
* blocking probe.
*/
typedef enum
{
- GST_PROBE_TYPE_INVALID = 0,
+ GST_PAD_PROBE_TYPE_INVALID = 0,
/* flags to control blocking */
- GST_PROBE_TYPE_IDLE = (1 << 0),
- GST_PROBE_TYPE_BLOCK = (1 << 1),
+ GST_PAD_PROBE_TYPE_IDLE = (1 << 0),
+ GST_PAD_PROBE_TYPE_BLOCK = (1 << 1),
/* flags to select datatypes */
- GST_PROBE_TYPE_BUFFER = (1 << 2),
- GST_PROBE_TYPE_BUFFER_LIST = (1 << 3),
- GST_PROBE_TYPE_EVENT = (1 << 4),
+ GST_PAD_PROBE_TYPE_BUFFER = (1 << 2),
+ GST_PAD_PROBE_TYPE_BUFFER_LIST = (1 << 3),
+ GST_PAD_PROBE_TYPE_EVENT = (1 << 4),
/* flags to select scheduling mode */
- GST_PROBE_TYPE_PUSH = (1 << 5),
- GST_PROBE_TYPE_PULL = (1 << 6),
-} GstProbeType;
+ GST_PAD_PROBE_TYPE_PUSH = (1 << 5),
+ GST_PAD_PROBE_TYPE_PULL = (1 << 6),
+} GstPadProbeType;
-#define GST_PROBE_TYPE_BLOCKING (GST_PROBE_TYPE_IDLE | GST_PROBE_TYPE_BLOCK)
-#define GST_PROBE_TYPE_DATA (GST_PROBE_TYPE_BUFFER | GST_PROBE_TYPE_EVENT | \
- GST_PROBE_TYPE_BUFFER_LIST)
-#define GST_PROBE_TYPE_SCHEDULING (GST_PROBE_TYPE_PUSH | GST_PROBE_TYPE_PULL)
+#define GST_PAD_PROBE_TYPE_BLOCKING (GST_PAD_PROBE_TYPE_IDLE | GST_PAD_PROBE_TYPE_BLOCK)
+#define GST_PAD_PROBE_TYPE_DATA (GST_PAD_PROBE_TYPE_BUFFER | GST_PAD_PROBE_TYPE_EVENT | \
+ GST_PAD_PROBE_TYPE_BUFFER_LIST)
+#define GST_PAD_PROBE_TYPE_SCHEDULING (GST_PAD_PROBE_TYPE_PUSH | GST_PAD_PROBE_TYPE_PULL)
/**
- * GstProbeReturn:
- * @GST_PROBE_OK: normal probe return value
- * @GST_PROBE_DROP: drop data in data probes
- * @GST_PROBE_REMOVE: remove probe
- * @GST_PROBE_PASS: pass the data item in the block probe and block on
+ * GstPadProbeReturn:
+ * @GST_PAD_PROBE_OK: normal probe return value
+ * @GST_PAD_PROBE_DROP: drop data in data probes
+ * @GST_PAD_PROBE_REMOVE: remove probe
+ * @GST_PAD_PROBE_PASS: pass the data item in the block probe and block on
* the next item
*
* Different return values for the #GstPadProbeCallback.
*/
typedef enum
{
- GST_PROBE_DROP,
- GST_PROBE_OK,
- GST_PROBE_REMOVE,
- GST_PROBE_PASS,
-} GstProbeReturn;
+ GST_PAD_PROBE_DROP,
+ GST_PAD_PROBE_OK,
+ GST_PAD_PROBE_REMOVE,
+ GST_PAD_PROBE_PASS,
+} GstPadProbeReturn;
/**
* GstPadProbeCallback
* Callback used by gst_pad_add_probe(). Gets called to notify about the current
* blocking type.
*/
-typedef GstProbeReturn (*GstPadProbeCallback) (GstPad *pad, GstProbeType type,
+typedef GstPadProbeReturn (*GstPadProbeCallback) (GstPad *pad, GstPadProbeType type,
gpointer type_data, gpointer user_data);
/**
gboolean gst_pad_activate_push (GstPad *pad, gboolean active);
gulong gst_pad_add_probe (GstPad *pad,
- GstProbeType mask,
+ GstPadProbeType mask,
GstPadProbeCallback callback,
gpointer user_data,
GDestroyNotify destroy_data);
/* called for every buffer. Waits until the global "buf" variable is unset,
* then sets it to the buffer received, and signals. */
static gboolean
-buffer_probe (GstPad * pad, GstProbeType type, GstBuffer * buffer,
+buffer_probe (GstPad * pad, GstPadProbeType type, GstBuffer * buffer,
gpointer unused)
{
g_mutex_lock (lock);
{
GstStateChangeReturn ret;
- id = gst_pad_add_probe (pad, GST_PROBE_TYPE_BUFFER,
+ id = gst_pad_add_probe (pad, GST_PAD_PROBE_TYPE_BUFFER,
(GstPadProbeCallback) buffer_probe, NULL, NULL);
cond = g_cond_new ();
};
static gboolean
-source_pad_data_cb (GstPad * pad, GstProbeType type, GstMiniObject * data,
+source_pad_data_cb (GstPad * pad, GstPadProbeType type, GstMiniObject * data,
GstStreamConsistency * consist)
{
if (GST_IS_BUFFER (data)) {
consist = g_new0 (GstStreamConsistency, 1);
consist->pad = g_object_ref (pad);
consist->probeid =
- gst_pad_add_probe (pad, GST_PROBE_TYPE_DATA,
+ gst_pad_add_probe (pad, GST_PAD_PROBE_TYPE_DATA,
(GstPadProbeCallback) source_pad_data_cb, consist, NULL);
return consist;
GST_STATIC_CAPS_ANY);
/* Data probe cb to drop everything but count buffers and events */
-static GstProbeReturn
-probe_cb (GstPad * pad, GstProbeType type, GstMiniObject * obj,
+static GstPadProbeReturn
+probe_cb (GstPad * pad, GstPadProbeType type, GstMiniObject * obj,
gpointer user_data)
{
gint count = 0;
g_object_set_data (G_OBJECT (pad), count_type, GINT_TO_POINTER (count));
/* drop everything */
- return GST_PROBE_DROP;
+ return GST_PAD_PROBE_DROP;
}
/* Create and link output pad: selector:src%d ! output_pad */
/* add probe */
probe_id =
- gst_pad_add_probe (output_pad, GST_PROBE_TYPE_DATA,
+ gst_pad_add_probe (output_pad, GST_PAD_PROBE_TYPE_DATA,
(GstPadProbeCallback) probe_cb, NULL, NULL);
g_object_set_data (G_OBJECT (output_pad), "probe_id",
GINT_TO_POINTER (probe_id));
}
/* add probe */
probe_id =
- gst_pad_add_probe (output_pad, GST_PROBE_TYPE_DATA,
+ gst_pad_add_probe (output_pad, GST_PAD_PROBE_TYPE_DATA,
(GstPadProbeCallback) probe_cb, NULL, NULL);
g_object_set_data (G_OBJECT (output_pad), "probe_id",
GINT_TO_POINTER (probe_id));
static GMutex *blocked_lock;
static GCond *blocked_cond;
-static GstProbeReturn
-pad_blocked_cb (GstPad * pad, GstProbeType type, gpointer type_data,
+static GstPadProbeReturn
+pad_blocked_cb (GstPad * pad, GstPadProbeType type, gpointer type_data,
gpointer user_data)
{
g_mutex_lock (blocked_lock);
g_cond_signal (blocked_cond);
g_mutex_unlock (blocked_lock);
- return GST_PROBE_OK;
+ return GST_PAD_PROBE_OK;
}
GST_START_TEST (test_add_live2)
GST_DEBUG ("blocking srcpad");
/* block source pad */
srcpad = gst_element_get_static_pad (src, "src");
- id = gst_pad_add_probe (srcpad, GST_PROBE_TYPE_BLOCK, pad_blocked_cb, NULL,
- NULL);
+ id = gst_pad_add_probe (srcpad, GST_PAD_PROBE_TYPE_BLOCK, pad_blocked_cb,
+ NULL, NULL);
/* set source to PAUSED without adding it to the pipeline */
ret = gst_element_set_state (src, GST_STATE_PAUSED);
static GstEvent *got_event_before_q, *got_event_after_q;
static GTimeVal got_event_time;
-static GstProbeReturn
-event_probe (GstPad * pad, GstProbeType type, gpointer type_data,
+static GstPadProbeReturn
+event_probe (GstPad * pad, GstPadProbeType type, gpointer type_data,
gpointer user_data)
{
GstMiniObject *data = type_data;
}
}
- return GST_PROBE_OK;
+ return GST_PAD_PROBE_OK;
}
g_mutex_unlock (data->lock);
}
-static GstProbeReturn
-signal_blocked (GstPad * pad, GstProbeType type, gpointer type_data,
+static GstPadProbeReturn
+signal_blocked (GstPad * pad, GstPadProbeType type, gpointer type_data,
gpointer user_data)
{
SignalData *data = (SignalData *) user_data;
signal_data_signal (data);
GST_DEBUG ("signal done %p", data);
- return GST_PROBE_OK;
+ return GST_PAD_PROBE_OK;
}
static void test_event
signal_data_init (&data);
/* We block the pad so the stream lock is released and we can send the event */
- id = gst_pad_add_probe (fake_srcpad, GST_PROBE_TYPE_BLOCK,
+ id = gst_pad_add_probe (fake_srcpad, GST_PAD_PROBE_TYPE_BLOCK,
signal_blocked, &data, NULL);
fail_unless (id != 0);
/* add pad-probes to faksrc.src and fakesink.sink */
fail_if ((srcpad = gst_element_get_static_pad (fakesrc, "src")) == NULL);
- gst_pad_add_probe (srcpad, GST_PROBE_TYPE_EVENT,
+ gst_pad_add_probe (srcpad, GST_PAD_PROBE_TYPE_EVENT,
event_probe, GINT_TO_POINTER (TRUE), NULL);
fail_if ((sinkpad = gst_element_get_static_pad (fakesink, "sink")) == NULL);
- gst_pad_add_probe (sinkpad, GST_PROBE_TYPE_EVENT,
+ gst_pad_add_probe (sinkpad, GST_PAD_PROBE_TYPE_EVENT,
event_probe, GINT_TO_POINTER (FALSE), NULL);
/* Upstream events */
GCond *cond;
} BlockData;
-static GstProbeReturn
-block_callback (GstPad * pad, GstProbeType type, gpointer type_data,
+static GstPadProbeReturn
+block_callback (GstPad * pad, GstPadProbeType type, gpointer type_data,
gpointer user_data)
{
BlockData *block_data = (BlockData *) user_data;
g_cond_signal (block_data->cond);
g_mutex_unlock (block_data->mutex);
- return GST_PROBE_OK;
+ return GST_PAD_PROBE_OK;
}
GST_START_TEST (test_ghost_pads_block)
block_data.cond = g_cond_new ();
g_mutex_lock (block_data.mutex);
- gst_pad_add_probe (srcghost, GST_PROBE_TYPE_BLOCK, block_callback,
+ gst_pad_add_probe (srcghost, GST_PAD_PROBE_TYPE_BLOCK, block_callback,
&block_data, NULL);
gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_PLAYING);
/* and wait now */
block_data.cond = g_cond_new ();
g_mutex_lock (block_data.mutex);
- gst_pad_add_probe (srcghost, GST_PROBE_TYPE_BLOCK, block_callback,
+ gst_pad_add_probe (srcghost, GST_PAD_PROBE_TYPE_BLOCK, block_callback,
&block_data, NULL);
gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_PLAYING);
/* and wait now */
GST_END_TEST;
-static GstProbeReturn
-_probe_handler (GstPad * pad, GstProbeType type, GstBuffer * buffer,
+static GstPadProbeReturn
+_probe_handler (GstPad * pad, GstPadProbeType type, GstBuffer * buffer,
gpointer userdata)
{
gint ret = GPOINTER_TO_INT (userdata);
if (ret == 1)
- return GST_PROBE_OK;
+ return GST_PAD_PROBE_OK;
- return GST_PROBE_DROP;
+ return GST_PAD_PROBE_DROP;
}
GST_START_TEST (test_push_unlinked)
/* adding a probe that returns FALSE will drop the buffer without trying
* to chain */
- id = gst_pad_add_probe (src, GST_PROBE_TYPE_BUFFER,
+ id = gst_pad_add_probe (src, GST_PAD_PROBE_TYPE_BUFFER,
(GstPadProbeCallback) _probe_handler, GINT_TO_POINTER (0), NULL);
buffer = gst_buffer_new ();
gst_buffer_ref (buffer);
/* adding a probe that returns TRUE will still chain the buffer,
* and hence drop because pad is unlinked */
- id = gst_pad_add_probe (src, GST_PROBE_TYPE_BUFFER,
+ id = gst_pad_add_probe (src, GST_PAD_PROBE_TYPE_BUFFER,
(GstPadProbeCallback) _probe_handler, GINT_TO_POINTER (1), NULL);
buffer = gst_buffer_new ();
gst_buffer_ref (buffer);
/* adding a probe that returns FALSE will drop the buffer without trying
* to chain */
- id = gst_pad_add_probe (src, GST_PROBE_TYPE_BUFFER,
+ id = gst_pad_add_probe (src, GST_PAD_PROBE_TYPE_BUFFER,
(GstPadProbeCallback) _probe_handler, GINT_TO_POINTER (0), NULL);
buffer = gst_buffer_new ();
gst_buffer_ref (buffer);
fail_unless_equals_int (g_list_length (buffers), 0);
/* adding a probe that returns TRUE will still chain the buffer */
- id = gst_pad_add_probe (src, GST_PROBE_TYPE_BUFFER,
+ id = gst_pad_add_probe (src, GST_PAD_PROBE_TYPE_BUFFER,
(GstPadProbeCallback) _probe_handler, GINT_TO_POINTER (1), NULL);
buffer = gst_buffer_new ();
gst_buffer_ref (buffer);
static gulong id;
-static GstProbeReturn
-block_async_cb (GstPad * pad, GstProbeType type, gpointer type_data,
+static GstPadProbeReturn
+block_async_cb (GstPad * pad, GstPadProbeType type, gpointer type_data,
gpointer user_data)
{
gboolean *bool_user_data = (gboolean *) user_data;
- fail_unless ((type & GST_PROBE_TYPE_BLOCK) != 0);
+ fail_unless ((type & GST_PAD_PROBE_TYPE_BLOCK) != 0);
/* here we should have blocked == 0 unblocked == 0 */
fail_unless (bool_user_data[0] == FALSE);
gst_pad_remove_probe (pad, id);
bool_user_data[1] = TRUE;
- return GST_PROBE_OK;
+ return GST_PAD_PROBE_OK;
}
GST_START_TEST (test_block_async)
fail_unless (pad != NULL);
gst_pad_set_active (pad, TRUE);
- id = gst_pad_add_probe (pad, GST_PROBE_TYPE_BLOCK, block_async_cb, &data,
+ id = gst_pad_add_probe (pad, GST_PAD_PROBE_TYPE_BLOCK, block_async_cb, &data,
NULL);
fail_unless (data[0] == FALSE);
*state = 2;
}
-static GstProbeReturn
-block_async_full_cb (GstPad * pad, GstProbeType type, gpointer type_data,
+static GstPadProbeReturn
+block_async_full_cb (GstPad * pad, GstPadProbeType type, gpointer type_data,
gpointer user_data)
{
*(gint *) user_data = (gint) TRUE;
gst_pad_push_event (pad, gst_event_new_flush_start ());
GST_DEBUG ("setting state to 1");
- return GST_PROBE_OK;
+ return GST_PAD_PROBE_OK;
}
GST_START_TEST (test_block_async_full_destroy)
fail_unless (pad != NULL);
gst_pad_set_active (pad, TRUE);
- id = gst_pad_add_probe (pad, GST_PROBE_TYPE_BLOCK, block_async_full_cb,
+ id = gst_pad_add_probe (pad, GST_PAD_PROBE_TYPE_BLOCK, block_async_full_cb,
&state, block_async_full_destroy);
fail_unless (state == 0);
fail_unless (pad != NULL);
gst_pad_set_active (pad, TRUE);
- (void) gst_pad_add_probe (pad, GST_PROBE_TYPE_BLOCK, block_async_full_cb,
+ (void) gst_pad_add_probe (pad, GST_PAD_PROBE_TYPE_BLOCK, block_async_full_cb,
&state, block_async_full_destroy);
gst_pad_push (pad, gst_buffer_new ());
}
#endif
-static GstProbeReturn
-block_async_second_no_flush (GstPad * pad, GstProbeType type,
+static GstPadProbeReturn
+block_async_second_no_flush (GstPad * pad, GstPadProbeType type,
gpointer type_data, gpointer user_data)
{
gboolean *bool_user_data = (gboolean *) user_data;
GST_DEBUG ("second probe called");
- fail_unless (type & GST_PROBE_TYPE_BLOCK);
+ fail_unless (type & GST_PAD_PROBE_TYPE_BLOCK);
fail_unless (bool_user_data[0] == TRUE);
fail_unless (bool_user_data[1] == FALSE);
GST_DEBUG ("removing second probe with id %lu", id);
gst_pad_remove_probe (pad, id);
- return GST_PROBE_OK;
+ return GST_PAD_PROBE_OK;
}
-static GstProbeReturn
-block_async_first_no_flush (GstPad * pad, GstProbeType type, gpointer type_data,
- gpointer user_data)
+static GstPadProbeReturn
+block_async_first_no_flush (GstPad * pad, GstPadProbeType type,
+ gpointer type_data, gpointer user_data)
{
static int n_calls = 0;
gboolean *bool_user_data = (gboolean *) user_data;
- fail_unless (type & GST_PROBE_TYPE_BLOCK);
+ fail_unless (type & GST_PAD_PROBE_TYPE_BLOCK);
GST_DEBUG ("first probe called");
GST_DEBUG ("adding second probe");
/* replace block_async_first with block_async_second so next time the pad is
* blocked the latter should be called */
- id = gst_pad_add_probe (pad, GST_PROBE_TYPE_BLOCK,
+ id = gst_pad_add_probe (pad, GST_PAD_PROBE_TYPE_BLOCK,
block_async_second_no_flush, user_data, NULL);
GST_DEBUG ("added probe with id %lu", id);
- return GST_PROBE_OK;
+ return GST_PAD_PROBE_OK;
}
GST_START_TEST (test_block_async_replace_callback_no_flush)
gst_pad_set_active (pad, TRUE);
GST_DEBUG ("adding probe");
- id = gst_pad_add_probe (pad, GST_PROBE_TYPE_BLOCK,
+ id = gst_pad_add_probe (pad, GST_PAD_PROBE_TYPE_BLOCK,
block_async_first_no_flush, bool_user_data, NULL);
GST_DEBUG ("added probe with id %lu", id);
fail_if (id == 0);
static GCond *probe_cond;
static gboolean
-sink_pad_probe (GstPad * pad, GstProbeType type, GstBuffer * buffer,
+sink_pad_probe (GstPad * pad, GstPadProbeType type, GstBuffer * buffer,
GstClockTime * first_timestamp)
{
fail_if (GST_BUFFER_TIMESTAMP (buffer) == GST_CLOCK_TIME_NONE,
gst_element_link (fakesrc, fakesink);
sink = gst_element_get_static_pad (fakesink, "sink");
- gst_pad_add_probe (sink, GST_PROBE_TYPE_BUFFER,
+ gst_pad_add_probe (sink, GST_PAD_PROBE_TYPE_BUFFER,
(GstPadProbeCallback) sink_pad_probe, &observed, NULL);
fail_unless (gst_element_set_state (pipeline, GST_STATE_PAUSED)
static int n_buffer_probes = 0;
static int n_event_probes = 0;
-static GstProbeReturn
-probe_do_nothing (GstPad * pad, GstProbeType type, gpointer type_data,
+static GstPadProbeReturn
+probe_do_nothing (GstPad * pad, GstPadProbeType type, gpointer type_data,
gpointer data)
{
GstMiniObject *obj = type_data;
GST_DEBUG_OBJECT (pad, "is buffer:%d", GST_IS_BUFFER (obj));
- return GST_PROBE_OK;
+ return GST_PAD_PROBE_OK;
}
-static GstProbeReturn
-data_probe (GstPad * pad, GstProbeType type, gpointer type_data, gpointer data)
+static GstPadProbeReturn
+data_probe (GstPad * pad, GstPadProbeType type, gpointer type_data,
+ gpointer data)
{
GstMiniObject *obj = type_data;
n_data_probes++;
GST_DEBUG_OBJECT (pad, "data probe %d", n_data_probes);
g_assert (GST_IS_BUFFER (obj) || GST_IS_EVENT (obj));
g_assert (data == SPECIAL_POINTER (0));
- return GST_PROBE_OK;
+ return GST_PAD_PROBE_OK;
}
-static GstProbeReturn
-buffer_probe (GstPad * pad, GstProbeType type, gpointer type_data,
+static GstPadProbeReturn
+buffer_probe (GstPad * pad, GstPadProbeType type, gpointer type_data,
gpointer data)
{
GstBuffer *obj = type_data;
GST_DEBUG_OBJECT (pad, "buffer probe %d", n_buffer_probes);
g_assert (GST_IS_BUFFER (obj));
g_assert (data == SPECIAL_POINTER (1));
- return GST_PROBE_OK;
+ return GST_PAD_PROBE_OK;
}
-static GstProbeReturn
-event_probe (GstPad * pad, GstProbeType type, gpointer type_data, gpointer data)
+static GstPadProbeReturn
+event_probe (GstPad * pad, GstPadProbeType type, gpointer type_data,
+ gpointer data)
{
GstEvent *obj = type_data;
n_event_probes++;
n_event_probes, GST_EVENT_TYPE_NAME (obj));
g_assert (GST_IS_EVENT (obj));
g_assert (data == SPECIAL_POINTER (2));
- return GST_PROBE_OK;
+ return GST_PAD_PROBE_OK;
}
GST_START_TEST (test_buffer_probe_n_times)
pad = gst_element_get_static_pad (fakesink, "sink");
/* add the probes we need for the test */
- gst_pad_add_probe (pad, GST_PROBE_TYPE_DATA, data_probe, SPECIAL_POINTER (0),
- NULL);
- gst_pad_add_probe (pad, GST_PROBE_TYPE_BUFFER, buffer_probe,
+ gst_pad_add_probe (pad, GST_PAD_PROBE_TYPE_DATA, data_probe,
+ SPECIAL_POINTER (0), NULL);
+ gst_pad_add_probe (pad, GST_PAD_PROBE_TYPE_BUFFER, buffer_probe,
SPECIAL_POINTER (1), NULL);
- gst_pad_add_probe (pad, GST_PROBE_TYPE_EVENT, event_probe,
+ gst_pad_add_probe (pad, GST_PAD_PROBE_TYPE_EVENT, event_probe,
SPECIAL_POINTER (2), NULL);
/* add some string probes just to test that the data is free'd
* properly as it should be */
- gst_pad_add_probe (pad, GST_PROBE_TYPE_DATA, probe_do_nothing,
+ gst_pad_add_probe (pad, GST_PAD_PROBE_TYPE_DATA, probe_do_nothing,
g_strdup ("data probe string"), (GDestroyNotify) g_free);
- gst_pad_add_probe (pad, GST_PROBE_TYPE_BUFFER, probe_do_nothing,
+ gst_pad_add_probe (pad, GST_PAD_PROBE_TYPE_BUFFER, probe_do_nothing,
g_strdup ("buffer probe string"), (GDestroyNotify) g_free);
- gst_pad_add_probe (pad, GST_PROBE_TYPE_EVENT, probe_do_nothing,
+ gst_pad_add_probe (pad, GST_PAD_PROBE_TYPE_EVENT, probe_do_nothing,
g_strdup ("event probe string"), (GDestroyNotify) g_free);
gst_object_unref (pad);
static int n_buffer_probes_once = 0;
static int n_event_probes_once = 0;
-static GstProbeReturn
-data_probe_once (GstPad * pad, GstProbeType type, GstMiniObject * obj,
+static GstPadProbeReturn
+data_probe_once (GstPad * pad, GstPadProbeType type, GstMiniObject * obj,
guint * data)
{
n_data_probes_once++;
gst_pad_remove_probe (pad, *data);
- return GST_PROBE_OK;
+ return GST_PAD_PROBE_OK;
}
-static GstProbeReturn
-buffer_probe_once (GstPad * pad, GstProbeType type, GstBuffer * obj,
+static GstPadProbeReturn
+buffer_probe_once (GstPad * pad, GstPadProbeType type, GstBuffer * obj,
guint * data)
{
n_buffer_probes_once++;
gst_pad_remove_probe (pad, *data);
- return GST_PROBE_OK;
+ return GST_PAD_PROBE_OK;
}
-static GstProbeReturn
-event_probe_once (GstPad * pad, GstProbeType type, GstEvent * obj, guint * data)
+static GstPadProbeReturn
+event_probe_once (GstPad * pad, GstPadProbeType type, GstEvent * obj,
+ guint * data)
{
n_event_probes_once++;
g_assert (GST_IS_EVENT (obj));
gst_pad_remove_probe (pad, *data);
- return GST_PROBE_OK;
+ return GST_PAD_PROBE_OK;
}
GST_START_TEST (test_buffer_probe_once)
pad = gst_element_get_static_pad (fakesink, "sink");
id1 =
- gst_pad_add_probe (pad, GST_PROBE_TYPE_DATA,
+ gst_pad_add_probe (pad, GST_PAD_PROBE_TYPE_DATA,
(GstPadProbeCallback) data_probe_once, &id1, NULL);
id2 =
- gst_pad_add_probe (pad, GST_PROBE_TYPE_BUFFER,
+ gst_pad_add_probe (pad, GST_PAD_PROBE_TYPE_BUFFER,
(GstPadProbeCallback) buffer_probe_once, &id2, NULL);
id3 =
- gst_pad_add_probe (pad, GST_PROBE_TYPE_EVENT,
+ gst_pad_add_probe (pad, GST_PAD_PROBE_TYPE_EVENT,
(GstPadProbeCallback) event_probe_once, &id3, NULL);
gst_object_unref (pad);
#include <gst/check/gstcheck.h>
#include <gst/base/gstbasesrc.h>
-static GstProbeReturn
-eos_event_counter (GstObject * pad, GstProbeType type, GstEvent * event,
+static GstPadProbeReturn
+eos_event_counter (GstObject * pad, GstPadProbeType type, GstEvent * event,
guint * p_num_eos)
{
fail_unless (event != NULL);
if (GST_EVENT_TYPE (event) == GST_EVENT_EOS)
*p_num_eos += 1;
- return GST_PROBE_OK;
+ return GST_PAD_PROBE_OK;
}
/* basesrc_eos_events_push_live_op:
srcpad = gst_element_get_static_pad (src, "src");
fail_unless (srcpad != NULL);
- probe = gst_pad_add_probe (srcpad, GST_PROBE_TYPE_EVENT,
+ probe = gst_pad_add_probe (srcpad, GST_PAD_PROBE_TYPE_EVENT,
(GstPadProbeCallback) eos_event_counter, &num_eos, NULL);
bus = gst_element_get_bus (pipe);
srcpad = gst_element_get_static_pad (src, "src");
fail_unless (srcpad != NULL);
- probe = gst_pad_add_probe (srcpad, GST_PROBE_TYPE_EVENT,
+ probe = gst_pad_add_probe (srcpad, GST_PAD_PROBE_TYPE_EVENT,
(GstPadProbeCallback) eos_event_counter, &num_eos, NULL);
bus = gst_element_get_bus (pipe);
srcpad = gst_element_get_static_pad (src, "src");
fail_unless (srcpad != NULL);
- probe = gst_pad_add_probe (srcpad, GST_PROBE_TYPE_EVENT,
+ probe = gst_pad_add_probe (srcpad, GST_PAD_PROBE_TYPE_EVENT,
(GstPadProbeCallback) eos_event_counter, &num_eos, NULL);
gst_element_set_state (pipe, GST_STATE_PLAYING);
srcpad = gst_element_get_static_pad (src, "src");
fail_unless (srcpad != NULL);
- probe = gst_pad_add_probe (srcpad, GST_PROBE_TYPE_EVENT,
+ probe = gst_pad_add_probe (srcpad, GST_PAD_PROBE_TYPE_EVENT,
(GstPadProbeCallback) eos_event_counter, &num_eos, NULL);
bus = gst_element_get_bus (pipe);
srcpad = gst_element_get_static_pad (src, "src");
fail_unless (srcpad != NULL);
- probe = gst_pad_add_probe (srcpad, GST_PROBE_TYPE_EVENT,
+ probe = gst_pad_add_probe (srcpad, GST_PAD_PROBE_TYPE_EVENT,
(GstPadProbeCallback) eos_event_counter, &num_eos, NULL);
bus = gst_element_get_bus (pipe);
srcpad = gst_element_get_static_pad (src, "src");
fail_unless (srcpad != NULL);
- probe = gst_pad_add_probe (srcpad, GST_PROBE_TYPE_EVENT,
+ probe = gst_pad_add_probe (srcpad, GST_PAD_PROBE_TYPE_EVENT,
(GstPadProbeCallback) eos_event_counter, &num_eos, NULL);
bus = gst_element_get_bus (pipe);
GST_END_TEST;
-static GstProbeReturn
-segment_event_catcher (GstObject * pad, GstProbeType type, GstEvent * event,
+static GstPadProbeReturn
+segment_event_catcher (GstObject * pad, GstPadProbeType type, GstEvent * event,
gpointer * user_data)
{
GstEvent **last_event = (GstEvent **) user_data;
*last_event = gst_event_copy (event);
}
- return GST_PROBE_OK;
+ return GST_PAD_PROBE_OK;
}
/* basesrc_seek_events_rate_update:
probe_pad = gst_element_get_static_pad (sink, "sink");
fail_unless (probe_pad != NULL);
- probe = gst_pad_add_probe (probe_pad, GST_PROBE_TYPE_EVENT,
+ probe = gst_pad_add_probe (probe_pad, GST_PAD_PROBE_TYPE_EVENT,
(GstPadProbeCallback) segment_event_catcher, &seg_event, NULL);
/* prepare the seek */
#include <gst/gst.h>
-static GstProbeReturn
-modify_caps (GstObject * pad, GstProbeType type, GstEvent * event,
+static GstPadProbeReturn
+modify_caps (GstObject * pad, GstPadProbeType type, GstEvent * event,
gpointer data)
{
GstElement *filter = GST_ELEMENT (data);
fail_unless (GST_IS_EVENT (event));
if (GST_EVENT_TYPE (event) != GST_EVENT_EOS)
- return GST_PROBE_OK;
+ return GST_PAD_PROBE_OK;
/* trigger caps negotiation error */
caps = gst_caps_new_empty_simple ("video/x-raw-rgb");
g_object_set (filter, "caps", caps, NULL);
gst_caps_unref (caps);
- return GST_PROBE_OK;
+ return GST_PAD_PROBE_OK;
}
GST_START_TEST (test_queue)
pad = gst_element_get_static_pad (queue, "sink");
fail_unless (pad != NULL);
probe =
- gst_pad_add_probe (pad, GST_PROBE_TYPE_EVENT,
+ gst_pad_add_probe (pad, GST_PAD_PROBE_TYPE_EVENT,
(GstPadProbeCallback) modify_caps, filter, NULL);
bus = gst_element_get_bus (pipeline);
{
static gsize id = 0;
static const GFlagsValue values[] = {
- {C_FLAGS (GST_PROBE_TYPE_INVALID), "GST_PROBE_TYPE_INVALID", "invalid"},
- {C_FLAGS (GST_PROBE_TYPE_IDLE), "GST_PROBE_TYPE_IDLE", "idle"},
- {C_FLAGS (GST_PROBE_TYPE_BLOCK), "GST_PROBE_TYPE_BLOCK", "block"},
- {C_FLAGS (GST_PROBE_TYPE_BUFFER), "GST_PROBE_TYPE_BUFFER", "buffer"},
- {C_FLAGS (GST_PROBE_TYPE_BUFFER_LIST), "GST_PROBE_TYPE_BUFFER_LIST",
+ {C_FLAGS (GST_PAD_PROBE_TYPE_INVALID), "GST_PAD_PROBE_TYPE_INVALID",
+ "invalid"},
+ {C_FLAGS (GST_PAD_PROBE_TYPE_IDLE), "GST_PAD_PROBE_TYPE_IDLE", "idle"},
+ {C_FLAGS (GST_PAD_PROBE_TYPE_BLOCK), "GST_PAD_PROBE_TYPE_BLOCK", "block"},
+ {C_FLAGS (GST_PAD_PROBE_TYPE_BUFFER), "GST_PAD_PROBE_TYPE_BUFFER",
+ "buffer"},
+ {C_FLAGS (GST_PAD_PROBE_TYPE_BUFFER_LIST), "GST_PAD_PROBE_TYPE_BUFFER_LIST",
"buffer-list"},
- {C_FLAGS (GST_PROBE_TYPE_EVENT), "GST_PROBE_TYPE_EVENT", "event"},
- {C_FLAGS (GST_PROBE_TYPE_PUSH), "GST_PROBE_TYPE_PUSH", "push"},
- {C_FLAGS (GST_PROBE_TYPE_PULL), "GST_PROBE_TYPE_PULL", "pull"},
+ {C_FLAGS (GST_PAD_PROBE_TYPE_EVENT), "GST_PAD_PROBE_TYPE_EVENT", "event"},
+ {C_FLAGS (GST_PAD_PROBE_TYPE_PUSH), "GST_PAD_PROBE_TYPE_PUSH", "push"},
+ {C_FLAGS (GST_PAD_PROBE_TYPE_PULL), "GST_PAD_PROBE_TYPE_PULL", "pull"},
{0, NULL, NULL}
};
if (g_once_init_enter (&id)) {
- GType tmp = g_flags_register_static ("GstProbeType", values);
+ GType tmp = g_flags_register_static ("GstPadProbeType", values);
g_once_init_leave (&id, tmp);
}
{
static gsize id = 0;
static const GEnumValue values[] = {
- {C_ENUM (GST_PROBE_DROP), "GST_PROBE_DROP", "drop"},
- {C_ENUM (GST_PROBE_OK), "GST_PROBE_OK", "ok"},
- {C_ENUM (GST_PROBE_REMOVE), "GST_PROBE_REMOVE", "remove"},
- {C_ENUM (GST_PROBE_PASS), "GST_PROBE_PASS", "pass"},
+ {C_ENUM (GST_PAD_PROBE_DROP), "GST_PAD_PROBE_DROP", "drop"},
+ {C_ENUM (GST_PAD_PROBE_OK), "GST_PAD_PROBE_OK", "ok"},
+ {C_ENUM (GST_PAD_PROBE_REMOVE), "GST_PAD_PROBE_REMOVE", "remove"},
+ {C_ENUM (GST_PAD_PROBE_PASS), "GST_PAD_PROBE_PASS", "pass"},
{0, NULL, NULL}
};
if (g_once_init_enter (&id)) {
- GType tmp = g_enum_register_static ("GstProbeReturn", values);
+ GType tmp = g_enum_register_static ("GstPadProbeReturn", values);
g_once_init_leave (&id, tmp);
}
gst_pad_peer_get_caps
gst_pad_peer_query
gst_pad_presence_get_type
+ gst_pad_probe_return_get_type
+ gst_pad_probe_type_get_type
gst_pad_proxy_getcaps
gst_pad_pull_range
gst_pad_push
gst_preset_set_meta
gst_print_element_args
gst_print_pad_caps
- gst_probe_return_get_type
- gst_probe_type_get_type
gst_progress_type_get_type
gst_proxy_pad_acceptcaps_default
gst_proxy_pad_chain_default