pad: rename GstProbeType and GstProbeReturn to GstPadProbe{Type,Return}

Better now than later in the cycle. These might come in handy:

sed -i -e 's/GstProbeReturn/GstPadProbeReturn/g'   `git grep GstProbeReturn  | sed -e 's/:.*//' | sort -u`
sed -i -e 's/GST_PROBE_/GST_PAD_PROBE_/g'          `git grep GST_PROBE_      | sed -e 's/:.*//' | sort -u`
sed -i -e 's/GstProbeType/GstPadProbeType/g'       `git grep GstProbeType    | sed -e 's/:.*//' | sort -u`
This commit is contained in:
Tim-Philipp Müller 2011-11-01 00:13:35 +00:00
parent f19b7d1125
commit bffc9207b5
19 changed files with 257 additions and 251 deletions

View file

@ -31,7 +31,7 @@ Overview
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);
@ -45,21 +45,21 @@ Overview
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.
@ -71,7 +71,7 @@ Overview
The probe callback is defined as:
GstProbeReturn (*GstPadProbeCallback) (GstPad *pad, GstProbeType type,
GstPadProbeReturn (*GstPadProbeCallback) (GstPad *pad, GstPadProbeType type,
gpointer type_data,
gpointer user_data);
@ -84,17 +84,17 @@ Overview
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;
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_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.
@ -120,7 +120,7 @@ Blocking probes
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.
@ -135,7 +135,7 @@ Non-Blocking probes
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
@ -189,7 +189,7 @@ The push dataflow probe behavior is the same for buffers and biderectional event
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.

View file

@ -1544,11 +1544,11 @@ GstPadLinkCheck
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

View file

@ -104,7 +104,7 @@ The 0.11 porting guide
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.

View file

@ -757,8 +757,8 @@ init_post (GOptionContext * context, GOptionGroup * group, gpointer data,
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 ();
@ -1127,8 +1127,8 @@ gst_deinit (void)
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;

View file

@ -124,9 +124,9 @@ typedef struct
typedef struct
{
GstPad *pad;
GstProbeType mask;
GstPadProbeType mask;
gpointer type_data;
GstProbeReturn ret;
GstPadProbeReturn ret;
gboolean pass;
guint cookie;
} ProbeMarshall;
@ -1054,7 +1054,7 @@ gst_pad_is_active (GstPad * pad)
* 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)
{
@ -1071,10 +1071,10 @@ gst_pad_add_probe (GstPad * pad, GstProbeType mask,
* 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;
@ -1086,10 +1086,10 @@ gst_pad_add_probe (GstPad * pad, GstProbeType mask,
/* 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);
@ -1111,7 +1111,7 @@ gst_pad_add_probe (GstPad * pad, GstProbeType mask,
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);
@ -1120,7 +1120,7 @@ gst_pad_add_probe (GstPad * pad, GstProbeType mask,
}
/* 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
@ -1134,7 +1134,7 @@ gst_pad_add_probe (GstPad * pad, GstProbeType mask,
"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);
@ -1154,11 +1154,11 @@ wrong_direction:
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",
@ -3340,9 +3340,9 @@ static void
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)
@ -3353,14 +3353,14 @@ probe_hook_marshal (GHook * hook, ProbeMarshall * data)
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,
@ -3377,19 +3377,19 @@ probe_hook_marshal (GHook * hook, ProbeMarshall * data)
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;
@ -3413,7 +3413,7 @@ probe_hook_marshal (GHook * hook, ProbeMarshall * data)
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;
@ -3422,7 +3422,7 @@ do_probe_callbacks (GstPad * pad, GstProbeType mask, gpointer type_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++;
@ -3440,13 +3440,13 @@ again:
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);
@ -3589,7 +3589,7 @@ done:
* 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;
@ -3610,7 +3610,7 @@ gst_pad_chain_data_unchecked (GstPad * pad, GstProbeType type, void *data)
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);
@ -3619,7 +3619,7 @@ gst_pad_chain_data_unchecked (GstPad * pad, GstProbeType type, void *data)
* 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))
@ -3736,7 +3736,7 @@ gst_pad_chain (GstPad * pad, GstBuffer * buffer)
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
@ -3754,7 +3754,7 @@ gst_pad_chain_list_default (GstPad * pad, GstBufferList * list)
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;
@ -3798,11 +3798,12 @@ gst_pad_chain_list (GstPad * pad, GstBufferList * list)
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;
@ -3811,10 +3812,10 @@ gst_pad_push_data (GstPad * pad, GstProbeType type, void *data)
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);
@ -3835,7 +3836,7 @@ gst_pad_push_data (GstPad * pad, GstProbeType type, void *data)
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);
@ -3907,7 +3908,7 @@ gst_pad_push (GstPad * pad, GstBuffer * buffer)
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);
}
/**
@ -3943,7 +3944,7 @@ gst_pad_push_list (GstPad * pad, GstBufferList * list)
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
@ -3975,7 +3976,7 @@ gst_pad_get_range_unchecked (GstPad * pad, guint64 offset, guint size,
/* 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);
@ -4096,7 +4097,7 @@ gst_pad_pull_range (GstPad * pad, guint64 offset, guint size,
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))
@ -4114,14 +4115,14 @@ gst_pad_pull_range (GstPad * pad, guint64 offset, guint size,
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);
@ -4243,11 +4244,10 @@ gst_pad_push_event (GstPad * pad, GstEvent * event)
/* 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");
@ -4314,15 +4314,16 @@ gst_pad_push_event (GstPad * pad, GstEvent * event)
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)
@ -4349,7 +4350,8 @@ gst_pad_push_event (GstPad * pad, GstEvent * event)
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);
@ -4455,11 +4457,10 @@ gst_pad_send_event (GstPad * pad, GstEvent * event)
}
/* 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 */
@ -4527,7 +4528,7 @@ gst_pad_send_event (GstPad * pad, GstEvent * event)
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;

View file

@ -466,57 +466,57 @@ typedef void (*GstPadFixateCapsFunction) (GstPad *pad, GstCaps *caps);
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
@ -528,7 +528,7 @@ typedef enum
* 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);
/**
@ -814,7 +814,7 @@ gboolean gst_pad_activate_pull (GstPad *pad, gboolean active);
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);

View file

@ -38,7 +38,7 @@ static gulong id;
/* 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);
@ -82,7 +82,7 @@ gst_buffer_straw_start_pipeline (GstElement * bin, GstPad * pad)
{
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 ();

View file

@ -42,7 +42,7 @@ struct _GstStreamConsistency
};
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)) {
@ -120,7 +120,7 @@ gst_consistency_checker_new (GstPad * pad)
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;

View file

@ -34,8 +34,8 @@ static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src",
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;
@ -57,7 +57,7 @@ probe_cb (GstPad * pad, GstProbeType type, GstMiniObject * obj,
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 */
@ -76,7 +76,7 @@ setup_output_pad (GstElement * element, GstStaticPadTemplate * tmpl)
/* 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));
@ -317,7 +317,7 @@ run_input_selector_buffer_count (gint num_input_pads,
}
/* 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));

View file

@ -763,8 +763,8 @@ GST_END_TEST;
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);
@ -772,7 +772,7 @@ pad_blocked_cb (GstPad * pad, GstProbeType type, gpointer type_data,
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)
@ -803,8 +803,8 @@ 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);

View file

@ -269,8 +269,8 @@ static GTimeVal sent_event_time;
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;
@ -311,7 +311,7 @@ event_probe (GstPad * pad, GstProbeType type, gpointer type_data,
}
}
return GST_PROBE_OK;
return GST_PAD_PROBE_OK;
}
@ -360,8 +360,8 @@ signal_data_wait (SignalData * data)
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;
@ -370,7 +370,7 @@ signal_blocked (GstPad * pad, GstProbeType type, gpointer type_data,
signal_data_signal (data);
GST_DEBUG ("signal done %p", data);
return GST_PROBE_OK;
return GST_PAD_PROBE_OK;
}
static void test_event
@ -400,7 +400,7 @@ 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);
@ -485,11 +485,11 @@ GST_START_TEST (send_custom_events)
/* 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 */

View file

@ -479,8 +479,8 @@ typedef struct
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;
@ -490,7 +490,7 @@ block_callback (GstPad * pad, GstProbeType type, gpointer type_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)
@ -518,7 +518,7 @@ 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 */
@ -560,7 +560,7 @@ GST_START_TEST (test_ghost_pads_probes)
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 */

View file

@ -250,16 +250,16 @@ GST_START_TEST (test_name_is_valid)
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)
@ -297,7 +297,7 @@ 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);
@ -308,7 +308,7 @@ GST_START_TEST (test_push_unlinked)
/* 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);
@ -388,7 +388,7 @@ GST_START_TEST (test_push_linked)
/* 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);
@ -399,7 +399,7 @@ GST_START_TEST (test_push_linked)
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);
@ -689,13 +689,13 @@ GST_END_TEST;
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);
@ -706,7 +706,7 @@ block_async_cb (GstPad * pad, GstProbeType type, gpointer type_data,
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)
@ -720,7 +720,7 @@ 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);
@ -798,8 +798,8 @@ block_async_full_destroy (gpointer user_data)
*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;
@ -807,7 +807,7 @@ block_async_full_cb (GstPad * pad, GstProbeType type, gpointer type_data,
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)
@ -821,7 +821,7 @@ 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);
@ -850,7 +850,7 @@ GST_START_TEST (test_block_async_full_destroy_dispose)
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 ());
@ -895,15 +895,15 @@ unblock_async_not_called (GstPad * pad, gboolean blocked, gpointer user_data)
}
#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);
@ -914,17 +914,17 @@ block_async_second_no_flush (GstPad * pad, GstProbeType type,
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");
@ -944,11 +944,11 @@ block_async_first_no_flush (GstPad * pad, GstProbeType type, gpointer type_data,
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)
@ -961,7 +961,7 @@ 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);

View file

@ -238,7 +238,7 @@ static GMutex *probe_lock;
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,
@ -274,7 +274,7 @@ GST_START_TEST (test_base_time)
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)

View file

@ -32,28 +32,29 @@ static int n_data_probes = 0;
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;
@ -61,11 +62,12 @@ buffer_probe (GstPad * pad, GstProbeType type, gpointer 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++;
@ -73,7 +75,7 @@ event_probe (GstPad * pad, GstProbeType type, gpointer type_data, gpointer data)
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)
@ -95,20 +97,20 @@ 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);
@ -137,8 +139,8 @@ static int n_data_probes_once = 0;
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++;
@ -146,11 +148,11 @@ data_probe_once (GstPad * pad, GstProbeType type, GstMiniObject * obj,
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++;
@ -158,18 +160,19 @@ buffer_probe_once (GstPad * pad, GstProbeType type, GstBuffer * obj,
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)
@ -191,13 +194,13 @@ 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);

View file

@ -27,8 +27,8 @@
#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);
@ -37,7 +37,7 @@ eos_event_counter (GstObject * pad, GstProbeType type, GstEvent * event,
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:
@ -77,7 +77,7 @@ GST_START_TEST (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);
@ -155,7 +155,7 @@ GST_START_TEST (basesrc_eos_events_push)
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);
@ -222,7 +222,7 @@ GST_START_TEST (basesrc_eos_events_pull_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);
gst_element_set_state (pipe, GST_STATE_PLAYING);
@ -294,7 +294,7 @@ GST_START_TEST (basesrc_eos_events_pull)
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);
@ -364,7 +364,7 @@ GST_START_TEST (basesrc_eos_events_push_live_eos)
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);
@ -441,7 +441,7 @@ GST_START_TEST (basesrc_eos_events_pull_live_eos)
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);
@ -482,8 +482,8 @@ GST_START_TEST (basesrc_eos_events_pull_live_eos)
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;
@ -497,7 +497,7 @@ segment_event_catcher (GstObject * pad, GstProbeType type, GstEvent * event,
*last_event = gst_event_copy (event);
}
return GST_PROBE_OK;
return GST_PAD_PROBE_OK;
}
/* basesrc_seek_events_rate_update:
@ -535,7 +535,7 @@ GST_START_TEST (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 */

View file

@ -23,8 +23,8 @@
#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);
@ -34,14 +34,14 @@ modify_caps (GstObject * pad, GstProbeType type, GstEvent * event,
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)
@ -71,7 +71,7 @@ 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);

View file

@ -1172,20 +1172,22 @@ gst_probe_type_get_type (void)
{
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);
}
@ -1197,15 +1199,15 @@ gst_probe_return_get_type (void)
{
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);
}

View file

@ -692,6 +692,8 @@ EXPORTS
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
@ -829,8 +831,6 @@ EXPORTS
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