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. probe type mask and a callback.
gulong gst_pad_add_probe (GstPad *pad, gulong gst_pad_add_probe (GstPad *pad,
GstProbeType mask, GstPadProbeType mask,
GstPadProbeCallback callback, GstPadProbeCallback callback,
gpointer user_data, gpointer user_data,
GDestroyNotify destroy_data); GDestroyNotify destroy_data);
@ -45,21 +45,21 @@ Overview
typedef enum typedef enum
{ {
GST_PROBE_TYPE_INVALID = 0, GST_PAD_PROBE_TYPE_INVALID = 0,
/* flags to control blocking */ /* flags to control blocking */
GST_PROBE_TYPE_IDLE = (1 << 0), GST_PAD_PROBE_TYPE_IDLE = (1 << 0),
GST_PROBE_TYPE_BLOCK = (1 << 1), GST_PAD_PROBE_TYPE_BLOCK = (1 << 1),
/* flags to select datatypes */ /* flags to select datatypes */
GST_PROBE_TYPE_BUFFER = (1 << 2), GST_PAD_PROBE_TYPE_BUFFER = (1 << 2),
GST_PROBE_TYPE_BUFFER_LIST = (1 << 3), GST_PAD_PROBE_TYPE_BUFFER_LIST = (1 << 3),
GST_PROBE_TYPE_EVENT = (1 << 4), GST_PAD_PROBE_TYPE_EVENT = (1 << 4),
/* flags to select scheduling mode */ /* flags to select scheduling mode */
GST_PROBE_TYPE_PUSH = (1 << 5), GST_PAD_PROBE_TYPE_PUSH = (1 << 5),
GST_PROBE_TYPE_PULL = (1 << 6), GST_PAD_PROBE_TYPE_PULL = (1 << 6),
} GstProbeType; } GstPadProbeType;
When adding a probe with the IDLE or BLOCK flag, the probe will become a 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. blocking probe (see below). Otherwise the probe will be a DATA probe.
@ -71,7 +71,7 @@ Overview
The probe callback is defined as: The probe callback is defined as:
GstProbeReturn (*GstPadProbeCallback) (GstPad *pad, GstProbeType type, GstPadProbeReturn (*GstPadProbeCallback) (GstPad *pad, GstPadProbeType type,
gpointer type_data, gpointer type_data,
gpointer user_data); gpointer user_data);
@ -84,17 +84,17 @@ Overview
typedef enum typedef enum
{ {
GST_PROBE_DROP, GST_PAD_PROBE_DROP,
GST_PROBE_OK, GST_PAD_PROBE_OK,
GST_PROBE_REMOVE, GST_PAD_PROBE_REMOVE,
GST_PROBE_PASS, GST_PAD_PROBE_PASS,
} GstProbeReturn; } GstPadProbeReturn;
GST_PROBE_OK is the normal return value. DROP will drop the item that is GST_PAD_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 currently being probed. GST_PAD_PROBE_REMOVE the currently executing probe from the
list of probes. 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. 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. 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 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. blocking probe on the pad, the pad is unblocked and dataflow can continue.
@ -135,7 +135,7 @@ Non-Blocking probes
Push dataflow 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. 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 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 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 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. 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 GST_PAD_LINK_CHECK_DEFAULT
GstFlowReturn GstFlowReturn
GstActivateMode GstActivateMode
GstProbeReturn GstPadProbeReturn
GstProbeType GstPadProbeType
GST_PROBE_TYPE_BLOCKING GST_PAD_PROBE_TYPE_BLOCKING
GST_PROBE_TYPE_DATA GST_PAD_PROBE_TYPE_DATA
GST_PROBE_TYPE_SCHEDULING GST_PAD_PROBE_TYPE_SCHEDULING
<SUBSECTION Application> <SUBSECTION Application>
gst_pad_get_name 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(), gst_pad_set_blocked_async(),
gst_pad_set_blocked_async_full() are removed, use the gst_pad_add_probe() 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 blocking version. There is no more sync version of blocking, this is in
general dangerous and can be implemented using the callbacks if needed. 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_memory_flags_get_type ());
g_type_class_ref (gst_map_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_caps_intersect_mode_get_type ());
g_type_class_ref (gst_probe_type_get_type ()); g_type_class_ref (gst_pad_probe_type_get_type ());
g_type_class_ref (gst_probe_return_get_type ()); g_type_class_ref (gst_pad_probe_return_get_type ());
g_type_class_ref (gst_segment_flags_get_type ()); g_type_class_ref (gst_segment_flags_get_type ());
_priv_gst_event_initialize (); _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_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_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_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_pad_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_return_get_type ()));
g_type_class_unref (g_type_class_peek (gst_segment_flags_get_type ())); g_type_class_unref (g_type_class_peek (gst_segment_flags_get_type ()));
gst_deinitialized = TRUE; gst_deinitialized = TRUE;

View file

@ -124,9 +124,9 @@ typedef struct
typedef struct typedef struct
{ {
GstPad *pad; GstPad *pad;
GstProbeType mask; GstPadProbeType mask;
gpointer type_data; gpointer type_data;
GstProbeReturn ret; GstPadProbeReturn ret;
gboolean pass; gboolean pass;
guint cookie; guint cookie;
} ProbeMarshall; } ProbeMarshall;
@ -1054,7 +1054,7 @@ gst_pad_is_active (GstPad * pad)
* MT safe. * MT safe.
*/ */
gulong gulong
gst_pad_add_probe (GstPad * pad, GstProbeType mask, gst_pad_add_probe (GstPad * pad, GstPadProbeType mask,
GstPadProbeCallback callback, gpointer user_data, GstPadProbeCallback callback, gpointer user_data,
GDestroyNotify destroy_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 ... * This means that _add_probe() might return a valid probeid ...
* which will potentially never be called if the pad * which will potentially never be called if the pad
* is activated in the wrong direction */ * 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))) (GST_PAD_ACTIVATE_MODE (pad) == GST_ACTIVATE_PULL)))
goto wrong_direction; 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))) (GST_PAD_ACTIVATE_MODE (pad) == GST_ACTIVATE_PUSH)))
goto wrong_direction; 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 /* when no contraints are given for the types, assume all types are
* acceptable */ * acceptable */
if ((mask & GST_PROBE_TYPE_DATA) == 0) if ((mask & GST_PAD_PROBE_TYPE_DATA) == 0)
mask |= GST_PROBE_TYPE_DATA; mask |= GST_PAD_PROBE_TYPE_DATA;
if ((mask & GST_PROBE_TYPE_SCHEDULING) == 0) if ((mask & GST_PAD_PROBE_TYPE_SCHEDULING) == 0)
mask |= GST_PROBE_TYPE_SCHEDULING; mask |= GST_PAD_PROBE_TYPE_SCHEDULING;
/* store our flags and other fields */ /* store our flags and other fields */
hook->flags |= (mask << G_HOOK_FLAG_USER_SHIFT); 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); 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 */ /* we have a block probe */
pad->num_blocked++; pad->num_blocked++;
GST_OBJECT_FLAG_SET (pad, GST_PAD_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 */ /* 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) { if (pad->priv->using > 0) {
/* the pad is in use, we can't signal the idle callback yet. Since we set the /* 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 * 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"); "pad is idle, trigger idle callback");
GST_OBJECT_UNLOCK (pad); GST_OBJECT_UNLOCK (pad);
callback (pad, GST_PROBE_TYPE_IDLE, NULL, user_data); callback (pad, GST_PAD_PROBE_TYPE_IDLE, NULL, user_data);
} }
} else { } else {
GST_OBJECT_UNLOCK (pad); GST_OBJECT_UNLOCK (pad);
@ -1154,11 +1154,11 @@ wrong_direction:
static void static void
cleanup_hook (GstPad * pad, GHook * hook) cleanup_hook (GstPad * pad, GHook * hook)
{ {
GstProbeType type; GstPadProbeType type;
type = (hook->flags) >> G_HOOK_FLAG_USER_SHIFT; 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 */ /* unblock when we remove the last blocking probe */
pad->num_blocked--; pad->num_blocked--;
GST_DEBUG_OBJECT (pad, "remove blocking probe, now %d left", GST_DEBUG_OBJECT (pad, "remove blocking probe, now %d left",
@ -3340,9 +3340,9 @@ static void
probe_hook_marshal (GHook * hook, ProbeMarshall * data) probe_hook_marshal (GHook * hook, ProbeMarshall * data)
{ {
GstPad *pad = data->pad; GstPad *pad = data->pad;
GstProbeType flags; GstPadProbeType flags;
GstPadProbeCallback callback; GstPadProbeCallback callback;
GstProbeReturn ret; GstPadProbeReturn ret;
/* if we have called this callback, do nothing */ /* if we have called this callback, do nothing */
if (PROBE_COOKIE (hook) == data->cookie) 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; flags = hook->flags >> G_HOOK_FLAG_USER_SHIFT;
/* one of the data types */ /* 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; return;
/* one of the scheduling types */ /* 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; return;
/* all of the blocking types must match */ /* all of the blocking types must match */
if ((flags & GST_PROBE_TYPE_BLOCKING) != if ((flags & GST_PAD_PROBE_TYPE_BLOCKING) !=
(data->mask & GST_PROBE_TYPE_BLOCKING)) (data->mask & GST_PAD_PROBE_TYPE_BLOCKING))
return; return;
GST_CAT_LOG_OBJECT (GST_CAT_SCHEDULING, pad, GST_CAT_LOG_OBJECT (GST_CAT_SCHEDULING, pad,
@ -3377,19 +3377,19 @@ probe_hook_marshal (GHook * hook, ProbeMarshall * data)
GST_OBJECT_LOCK (pad); GST_OBJECT_LOCK (pad);
switch (ret) { switch (ret) {
case GST_PROBE_REMOVE: case GST_PAD_PROBE_REMOVE:
/* remove the probe */ /* remove the probe */
GST_DEBUG_OBJECT (pad, "asked to remove hook"); GST_DEBUG_OBJECT (pad, "asked to remove hook");
cleanup_hook (pad, hook); cleanup_hook (pad, hook);
break; break;
case GST_PROBE_DROP: case GST_PAD_PROBE_DROP:
/* need to drop the data, make sure other probes don't get called /* need to drop the data, make sure other probes don't get called
* anymore */ * anymore */
GST_DEBUG_OBJECT (pad, "asked to drop item"); GST_DEBUG_OBJECT (pad, "asked to drop item");
data->mask = GST_PROBE_TYPE_INVALID; data->mask = GST_PAD_PROBE_TYPE_INVALID;
data->ret = GST_PROBE_DROP; data->ret = GST_PAD_PROBE_DROP;
break; break;
case GST_PROBE_PASS: case GST_PAD_PROBE_PASS:
/* inform the pad block to let things pass */ /* inform the pad block to let things pass */
GST_DEBUG_OBJECT (pad, "asked to pass item"); GST_DEBUG_OBJECT (pad, "asked to pass item");
data->pass = TRUE; data->pass = TRUE;
@ -3413,7 +3413,7 @@ probe_hook_marshal (GHook * hook, ProbeMarshall * data)
PROBE_FULL(pad, mask, data, label, GST_FLOW_OK); PROBE_FULL(pad, mask, data, label, GST_FLOW_OK);
static GstFlowReturn static GstFlowReturn
do_probe_callbacks (GstPad * pad, GstProbeType mask, gpointer type_data, do_probe_callbacks (GstPad * pad, GstPadProbeType mask, gpointer type_data,
GstFlowReturn defaultval) GstFlowReturn defaultval)
{ {
ProbeMarshall data; ProbeMarshall data;
@ -3422,7 +3422,7 @@ do_probe_callbacks (GstPad * pad, GstProbeType mask, gpointer type_data,
data.pad = pad; data.pad = pad;
data.mask = mask; data.mask = mask;
data.type_data = type_data; data.type_data = type_data;
data.ret = GST_PROBE_OK; data.ret = GST_PAD_PROBE_OK;
data.pass = FALSE; data.pass = FALSE;
data.cookie = pad->priv->probe_cookie++; data.cookie = pad->priv->probe_cookie++;
@ -3440,13 +3440,13 @@ again:
goto again; goto again;
} }
if (data.ret == GST_PROBE_DROP) if (data.ret == GST_PAD_PROBE_DROP)
goto dropped; goto dropped;
if (data.pass) if (data.pass)
goto passed; goto passed;
if (mask & GST_PROBE_TYPE_BLOCK) { if (mask & GST_PAD_PROBE_TYPE_BLOCK) {
while (GST_PAD_IS_BLOCKED (pad)) { while (GST_PAD_IS_BLOCKED (pad)) {
GST_CAT_LOG_OBJECT (GST_CAT_SCHEDULING, pad, GST_CAT_LOG_OBJECT (GST_CAT_SCHEDULING, pad,
"we are blocked %d times", pad->num_blocked); "we are blocked %d times", pad->num_blocked);
@ -3589,7 +3589,7 @@ done:
* checking for that little extra speed. * checking for that little extra speed.
*/ */
static inline GstFlowReturn 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; GstFlowReturn ret;
gboolean needs_events; gboolean needs_events;
@ -3610,7 +3610,7 @@ gst_pad_chain_data_unchecked (GstPad * pad, GstProbeType type, void *data)
goto events_error; 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); 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 * the data to the wrong function. This is not really a
* problem since functions are assigned at creation time * problem since functions are assigned at creation time
* and don't change that often... */ * 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; GstPadChainFunction chainfunc;
if (G_UNLIKELY ((chainfunc = GST_PAD_CHAINFUNC (pad)) == NULL)) 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_PAD_IS_SINK (pad), GST_FLOW_ERROR);
g_return_val_if_fail (GST_IS_BUFFER (buffer), 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 static GstFlowReturn
@ -3754,7 +3754,7 @@ gst_pad_chain_list_default (GstPad * pad, GstBufferList * list)
for (i = 0; i < len; i++) { for (i = 0; i < len; i++) {
buffer = gst_buffer_list_get (list, i); buffer = gst_buffer_list_get (list, i);
ret = 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)); gst_buffer_ref (buffer));
if (ret != GST_FLOW_OK) if (ret != GST_FLOW_OK)
break; 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_PAD_IS_SINK (pad), GST_FLOW_ERROR);
g_return_val_if_fail (GST_IS_BUFFER_LIST (list), 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 static GstFlowReturn
gst_pad_push_data (GstPad * pad, GstProbeType type, void *data) gst_pad_push_data (GstPad * pad, GstPadProbeType type, void *data)
{ {
GstPad *peer; GstPad *peer;
GstFlowReturn ret; GstFlowReturn ret;
@ -3811,10 +3812,10 @@ gst_pad_push_data (GstPad * pad, GstProbeType type, void *data)
if (G_UNLIKELY (GST_PAD_IS_FLUSHING (pad))) if (G_UNLIKELY (GST_PAD_IS_FLUSHING (pad)))
goto flushing; goto flushing;
type |= GST_PROBE_TYPE_PUSH; type |= GST_PAD_PROBE_TYPE_PUSH;
/* do block probes */ /* 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 */ /* do post-blocking probes */
PROBE (pad, type, data, probe_stopped); PROBE (pad, type, data, probe_stopped);
@ -3835,7 +3836,7 @@ gst_pad_push_data (GstPad * pad, GstProbeType type, void *data)
pad->priv->using--; pad->priv->using--;
if (pad->priv->using == 0) { if (pad->priv->using == 0) {
/* pad is not active anymore, trigger idle callbacks */ /* 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); probe_stopped, ret);
} }
GST_OBJECT_UNLOCK (pad); 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_PAD_IS_SRC (pad), GST_FLOW_ERROR);
g_return_val_if_fail (GST_IS_BUFFER (buffer), 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_PAD_IS_SRC (pad), GST_FLOW_ERROR);
g_return_val_if_fail (GST_IS_BUFFER_LIST (list), 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 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 */ /* can only fire the signal if we have a valid buffer */
GST_OBJECT_LOCK (pad); 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); probe_stopped);
GST_OBJECT_UNLOCK (pad); 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))) if (G_UNLIKELY (GST_PAD_IS_FLUSHING (pad)))
goto flushing; 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); pre_probe_stopped);
if (G_UNLIKELY ((peer = GST_PAD_PEER (pad)) == NULL)) 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--; pad->priv->using--;
if (pad->priv->using == 0) { if (pad->priv->using == 0) {
/* pad is not active anymore, trigger idle callbacks */ /* 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); post_probe_stopped);
} }
if (G_UNLIKELY (ret != GST_FLOW_OK)) if (G_UNLIKELY (ret != GST_FLOW_OK))
goto pull_range_failed; 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); post_probe_stopped);
needs_events = GST_PAD_NEEDS_EVENTS (pad); needs_events = GST_PAD_NEEDS_EVENTS (pad);
@ -4243,11 +4244,10 @@ gst_pad_push_event (GstPad * pad, GstEvent * event)
/* Remove sticky EOS events */ /* Remove sticky EOS events */
GST_LOG_OBJECT (pad, "Removing pending EOS events"); GST_LOG_OBJECT (pad, "Removing pending EOS events");
gst_event_replace (&pad-> gst_event_replace (&pad->priv->
priv->events[GST_EVENT_STICKY_IDX_TYPE (GST_EVENT_EOS)].pending, events[GST_EVENT_STICKY_IDX_TYPE (GST_EVENT_EOS)].pending, NULL);
NULL); gst_event_replace (&pad->priv->
gst_event_replace (&pad-> events[GST_EVENT_STICKY_IDX_TYPE (GST_EVENT_EOS)].event, NULL);
priv->events[GST_EVENT_STICKY_IDX_TYPE (GST_EVENT_EOS)].event, NULL);
if (G_UNLIKELY (GST_PAD_IS_BLOCKED (pad))) { if (G_UNLIKELY (GST_PAD_IS_BLOCKED (pad))) {
GST_LOG_OBJECT (pad, "Pad is blocked, not forwarding flush-stop"); 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))) if (G_UNLIKELY (GST_PAD_IS_FLUSHING (pad)))
goto flushed; goto flushed;
PROBE (pad, GST_PROBE_TYPE_PUSH | GST_PROBE_TYPE_EVENT PROBE (pad, GST_PAD_PROBE_TYPE_PUSH | GST_PAD_PROBE_TYPE_EVENT
| GST_PROBE_TYPE_BLOCK, event, probe_stopped); | GST_PAD_PROBE_TYPE_BLOCK, event, probe_stopped);
break; break;
} }
} }
/* send probes after modifying the events above */ /* 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 */ /* now check the peer pad */
if (peerpad == NULL) if (peerpad == NULL)
@ -4349,7 +4350,8 @@ gst_pad_push_event (GstPad * pad, GstEvent * event)
pad->priv->using--; pad->priv->using--;
if (pad->priv->using == 0) { if (pad->priv->using == 0) {
/* pad is not active anymore, trigger idle callbacks */ /* 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); GST_OBJECT_UNLOCK (pad);
@ -4455,11 +4457,10 @@ gst_pad_send_event (GstPad * pad, GstEvent * event)
} }
/* Remove pending EOS events */ /* Remove pending EOS events */
GST_LOG_OBJECT (pad, "Removing pending EOS events"); GST_LOG_OBJECT (pad, "Removing pending EOS events");
gst_event_replace (&pad-> gst_event_replace (&pad->priv->
priv->events[GST_EVENT_STICKY_IDX_TYPE (GST_EVENT_EOS)].pending, events[GST_EVENT_STICKY_IDX_TYPE (GST_EVENT_EOS)].pending, NULL);
NULL); gst_event_replace (&pad->priv->
gst_event_replace (&pad-> events[GST_EVENT_STICKY_IDX_TYPE (GST_EVENT_EOS)].event, NULL);
priv->events[GST_EVENT_STICKY_IDX_TYPE (GST_EVENT_EOS)].event, NULL);
GST_OBJECT_UNLOCK (pad); GST_OBJECT_UNLOCK (pad);
/* grab stream lock */ /* grab stream lock */
@ -4527,7 +4528,7 @@ gst_pad_send_event (GstPad * pad, GstEvent * event)
if (G_UNLIKELY (GST_PAD_IS_FLUSHING (pad))) if (G_UNLIKELY (GST_PAD_IS_FLUSHING (pad)))
goto flushing; 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); probe_stopped);
break; break;

View file

@ -466,57 +466,57 @@ typedef void (*GstPadFixateCapsFunction) (GstPad *pad, GstCaps *caps);
typedef gboolean (*GstPadForwardFunction) (GstPad *pad, gpointer user_data); typedef gboolean (*GstPadForwardFunction) (GstPad *pad, gpointer user_data);
/** /**
* GstProbeType: * GstPadProbeType:
* @GST_PROBE_TYPE_INVALID: invalid probe type * @GST_PAD_PROBE_TYPE_INVALID: invalid probe type
* @GST_PROBE_TYPE_IDLE: probe idle pads and block * @GST_PAD_PROBE_TYPE_IDLE: probe idle pads and block
* @GST_PROBE_TYPE_BLOCK: probe and block pads * @GST_PAD_PROBE_TYPE_BLOCK: probe and block pads
* @GST_PROBE_TYPE_BUFFER: probe buffers * @GST_PAD_PROBE_TYPE_BUFFER: probe buffers
* @GST_PROBE_TYPE_BUFFER_LIST: probe buffer lists * @GST_PAD_PROBE_TYPE_BUFFER_LIST: probe buffer lists
* @GST_PROBE_TYPE_EVENT: probe events * @GST_PAD_PROBE_TYPE_EVENT: probe events
* @GST_PROBE_TYPE_PUSH: probe push * @GST_PAD_PROBE_TYPE_PUSH: probe push
* @GST_PROBE_TYPE_PULL: probe pull * @GST_PAD_PROBE_TYPE_PULL: probe pull
* *
* The different probing types that can occur. When either one of * 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. * blocking probe.
*/ */
typedef enum typedef enum
{ {
GST_PROBE_TYPE_INVALID = 0, GST_PAD_PROBE_TYPE_INVALID = 0,
/* flags to control blocking */ /* flags to control blocking */
GST_PROBE_TYPE_IDLE = (1 << 0), GST_PAD_PROBE_TYPE_IDLE = (1 << 0),
GST_PROBE_TYPE_BLOCK = (1 << 1), GST_PAD_PROBE_TYPE_BLOCK = (1 << 1),
/* flags to select datatypes */ /* flags to select datatypes */
GST_PROBE_TYPE_BUFFER = (1 << 2), GST_PAD_PROBE_TYPE_BUFFER = (1 << 2),
GST_PROBE_TYPE_BUFFER_LIST = (1 << 3), GST_PAD_PROBE_TYPE_BUFFER_LIST = (1 << 3),
GST_PROBE_TYPE_EVENT = (1 << 4), GST_PAD_PROBE_TYPE_EVENT = (1 << 4),
/* flags to select scheduling mode */ /* flags to select scheduling mode */
GST_PROBE_TYPE_PUSH = (1 << 5), GST_PAD_PROBE_TYPE_PUSH = (1 << 5),
GST_PROBE_TYPE_PULL = (1 << 6), GST_PAD_PROBE_TYPE_PULL = (1 << 6),
} GstProbeType; } GstPadProbeType;
#define GST_PROBE_TYPE_BLOCKING (GST_PROBE_TYPE_IDLE | GST_PROBE_TYPE_BLOCK) #define GST_PAD_PROBE_TYPE_BLOCKING (GST_PAD_PROBE_TYPE_IDLE | GST_PAD_PROBE_TYPE_BLOCK)
#define GST_PROBE_TYPE_DATA (GST_PROBE_TYPE_BUFFER | GST_PROBE_TYPE_EVENT | \ #define GST_PAD_PROBE_TYPE_DATA (GST_PAD_PROBE_TYPE_BUFFER | GST_PAD_PROBE_TYPE_EVENT | \
GST_PROBE_TYPE_BUFFER_LIST) GST_PAD_PROBE_TYPE_BUFFER_LIST)
#define GST_PROBE_TYPE_SCHEDULING (GST_PROBE_TYPE_PUSH | GST_PROBE_TYPE_PULL) #define GST_PAD_PROBE_TYPE_SCHEDULING (GST_PAD_PROBE_TYPE_PUSH | GST_PAD_PROBE_TYPE_PULL)
/** /**
* GstProbeReturn: * GstPadProbeReturn:
* @GST_PROBE_OK: normal probe return value * @GST_PAD_PROBE_OK: normal probe return value
* @GST_PROBE_DROP: drop data in data probes * @GST_PAD_PROBE_DROP: drop data in data probes
* @GST_PROBE_REMOVE: remove probe * @GST_PAD_PROBE_REMOVE: remove probe
* @GST_PROBE_PASS: pass the data item in the block probe and block on * @GST_PAD_PROBE_PASS: pass the data item in the block probe and block on
* the next item * the next item
* *
* Different return values for the #GstPadProbeCallback. * Different return values for the #GstPadProbeCallback.
*/ */
typedef enum typedef enum
{ {
GST_PROBE_DROP, GST_PAD_PROBE_DROP,
GST_PROBE_OK, GST_PAD_PROBE_OK,
GST_PROBE_REMOVE, GST_PAD_PROBE_REMOVE,
GST_PROBE_PASS, GST_PAD_PROBE_PASS,
} GstProbeReturn; } GstPadProbeReturn;
/** /**
* GstPadProbeCallback * GstPadProbeCallback
@ -528,7 +528,7 @@ typedef enum
* Callback used by gst_pad_add_probe(). Gets called to notify about the current * Callback used by gst_pad_add_probe(). Gets called to notify about the current
* blocking type. * blocking type.
*/ */
typedef GstProbeReturn (*GstPadProbeCallback) (GstPad *pad, GstProbeType type, typedef GstPadProbeReturn (*GstPadProbeCallback) (GstPad *pad, GstPadProbeType type,
gpointer type_data, gpointer user_data); 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); gboolean gst_pad_activate_push (GstPad *pad, gboolean active);
gulong gst_pad_add_probe (GstPad *pad, gulong gst_pad_add_probe (GstPad *pad,
GstProbeType mask, GstPadProbeType mask,
GstPadProbeCallback callback, GstPadProbeCallback callback,
gpointer user_data, gpointer user_data,
GDestroyNotify destroy_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, /* called for every buffer. Waits until the global "buf" variable is unset,
* then sets it to the buffer received, and signals. */ * then sets it to the buffer received, and signals. */
static gboolean static gboolean
buffer_probe (GstPad * pad, GstProbeType type, GstBuffer * buffer, buffer_probe (GstPad * pad, GstPadProbeType type, GstBuffer * buffer,
gpointer unused) gpointer unused)
{ {
g_mutex_lock (lock); g_mutex_lock (lock);
@ -82,7 +82,7 @@ gst_buffer_straw_start_pipeline (GstElement * bin, GstPad * pad)
{ {
GstStateChangeReturn ret; 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); (GstPadProbeCallback) buffer_probe, NULL, NULL);
cond = g_cond_new (); cond = g_cond_new ();

View file

@ -42,7 +42,7 @@ struct _GstStreamConsistency
}; };
static gboolean static gboolean
source_pad_data_cb (GstPad * pad, GstProbeType type, GstMiniObject * data, source_pad_data_cb (GstPad * pad, GstPadProbeType type, GstMiniObject * data,
GstStreamConsistency * consist) GstStreamConsistency * consist)
{ {
if (GST_IS_BUFFER (data)) { if (GST_IS_BUFFER (data)) {
@ -120,7 +120,7 @@ gst_consistency_checker_new (GstPad * pad)
consist = g_new0 (GstStreamConsistency, 1); consist = g_new0 (GstStreamConsistency, 1);
consist->pad = g_object_ref (pad); consist->pad = g_object_ref (pad);
consist->probeid = 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); (GstPadProbeCallback) source_pad_data_cb, consist, NULL);
return consist; return consist;

View file

@ -34,8 +34,8 @@ static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src",
GST_STATIC_CAPS_ANY); GST_STATIC_CAPS_ANY);
/* Data probe cb to drop everything but count buffers and events */ /* Data probe cb to drop everything but count buffers and events */
static GstProbeReturn static GstPadProbeReturn
probe_cb (GstPad * pad, GstProbeType type, GstMiniObject * obj, probe_cb (GstPad * pad, GstPadProbeType type, GstMiniObject * obj,
gpointer user_data) gpointer user_data)
{ {
gint count = 0; 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)); g_object_set_data (G_OBJECT (pad), count_type, GINT_TO_POINTER (count));
/* drop everything */ /* drop everything */
return GST_PROBE_DROP; return GST_PAD_PROBE_DROP;
} }
/* Create and link output pad: selector:src%d ! output_pad */ /* Create and link output pad: selector:src%d ! output_pad */
@ -76,7 +76,7 @@ setup_output_pad (GstElement * element, GstStaticPadTemplate * tmpl)
/* add probe */ /* add probe */
probe_id = 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); (GstPadProbeCallback) probe_cb, NULL, NULL);
g_object_set_data (G_OBJECT (output_pad), "probe_id", g_object_set_data (G_OBJECT (output_pad), "probe_id",
GINT_TO_POINTER (probe_id)); GINT_TO_POINTER (probe_id));
@ -317,7 +317,7 @@ run_input_selector_buffer_count (gint num_input_pads,
} }
/* add probe */ /* add probe */
probe_id = 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); (GstPadProbeCallback) probe_cb, NULL, NULL);
g_object_set_data (G_OBJECT (output_pad), "probe_id", g_object_set_data (G_OBJECT (output_pad), "probe_id",
GINT_TO_POINTER (probe_id)); GINT_TO_POINTER (probe_id));

View file

@ -763,8 +763,8 @@ GST_END_TEST;
static GMutex *blocked_lock; static GMutex *blocked_lock;
static GCond *blocked_cond; static GCond *blocked_cond;
static GstProbeReturn static GstPadProbeReturn
pad_blocked_cb (GstPad * pad, GstProbeType type, gpointer type_data, pad_blocked_cb (GstPad * pad, GstPadProbeType type, gpointer type_data,
gpointer user_data) gpointer user_data)
{ {
g_mutex_lock (blocked_lock); 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_cond_signal (blocked_cond);
g_mutex_unlock (blocked_lock); g_mutex_unlock (blocked_lock);
return GST_PROBE_OK; return GST_PAD_PROBE_OK;
} }
GST_START_TEST (test_add_live2) GST_START_TEST (test_add_live2)
@ -803,8 +803,8 @@ GST_START_TEST (test_add_live2)
GST_DEBUG ("blocking srcpad"); GST_DEBUG ("blocking srcpad");
/* block source pad */ /* block source pad */
srcpad = gst_element_get_static_pad (src, "src"); srcpad = gst_element_get_static_pad (src, "src");
id = gst_pad_add_probe (srcpad, GST_PROBE_TYPE_BLOCK, pad_blocked_cb, NULL, id = gst_pad_add_probe (srcpad, GST_PAD_PROBE_TYPE_BLOCK, pad_blocked_cb,
NULL); NULL, NULL);
/* set source to PAUSED without adding it to the pipeline */ /* set source to PAUSED without adding it to the pipeline */
ret = gst_element_set_state (src, GST_STATE_PAUSED); 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 GstEvent *got_event_before_q, *got_event_after_q;
static GTimeVal got_event_time; static GTimeVal got_event_time;
static GstProbeReturn static GstPadProbeReturn
event_probe (GstPad * pad, GstProbeType type, gpointer type_data, event_probe (GstPad * pad, GstPadProbeType type, gpointer type_data,
gpointer user_data) gpointer user_data)
{ {
GstMiniObject *data = type_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); g_mutex_unlock (data->lock);
} }
static GstProbeReturn static GstPadProbeReturn
signal_blocked (GstPad * pad, GstProbeType type, gpointer type_data, signal_blocked (GstPad * pad, GstPadProbeType type, gpointer type_data,
gpointer user_data) gpointer user_data)
{ {
SignalData *data = (SignalData *) user_data; SignalData *data = (SignalData *) user_data;
@ -370,7 +370,7 @@ signal_blocked (GstPad * pad, GstProbeType type, gpointer type_data,
signal_data_signal (data); signal_data_signal (data);
GST_DEBUG ("signal done %p", data); GST_DEBUG ("signal done %p", data);
return GST_PROBE_OK; return GST_PAD_PROBE_OK;
} }
static void test_event static void test_event
@ -400,7 +400,7 @@ static void test_event
signal_data_init (&data); signal_data_init (&data);
/* We block the pad so the stream lock is released and we can send the event */ /* 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); signal_blocked, &data, NULL);
fail_unless (id != 0); fail_unless (id != 0);
@ -485,11 +485,11 @@ GST_START_TEST (send_custom_events)
/* add pad-probes to faksrc.src and fakesink.sink */ /* add pad-probes to faksrc.src and fakesink.sink */
fail_if ((srcpad = gst_element_get_static_pad (fakesrc, "src")) == NULL); 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); event_probe, GINT_TO_POINTER (TRUE), NULL);
fail_if ((sinkpad = gst_element_get_static_pad (fakesink, "sink")) == 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); event_probe, GINT_TO_POINTER (FALSE), NULL);
/* Upstream events */ /* Upstream events */

View file

@ -479,8 +479,8 @@ typedef struct
GCond *cond; GCond *cond;
} BlockData; } BlockData;
static GstProbeReturn static GstPadProbeReturn
block_callback (GstPad * pad, GstProbeType type, gpointer type_data, block_callback (GstPad * pad, GstPadProbeType type, gpointer type_data,
gpointer user_data) gpointer user_data)
{ {
BlockData *block_data = (BlockData *) 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_cond_signal (block_data->cond);
g_mutex_unlock (block_data->mutex); g_mutex_unlock (block_data->mutex);
return GST_PROBE_OK; return GST_PAD_PROBE_OK;
} }
GST_START_TEST (test_ghost_pads_block) GST_START_TEST (test_ghost_pads_block)
@ -518,7 +518,7 @@ GST_START_TEST (test_ghost_pads_block)
block_data.cond = g_cond_new (); block_data.cond = g_cond_new ();
g_mutex_lock (block_data.mutex); 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); &block_data, NULL);
gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_PLAYING); gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_PLAYING);
/* and wait now */ /* and wait now */
@ -560,7 +560,7 @@ GST_START_TEST (test_ghost_pads_probes)
block_data.cond = g_cond_new (); block_data.cond = g_cond_new ();
g_mutex_lock (block_data.mutex); 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); &block_data, NULL);
gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_PLAYING); gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_PLAYING);
/* and wait now */ /* and wait now */

View file

@ -250,16 +250,16 @@ GST_START_TEST (test_name_is_valid)
GST_END_TEST; GST_END_TEST;
static GstProbeReturn static GstPadProbeReturn
_probe_handler (GstPad * pad, GstProbeType type, GstBuffer * buffer, _probe_handler (GstPad * pad, GstPadProbeType type, GstBuffer * buffer,
gpointer userdata) gpointer userdata)
{ {
gint ret = GPOINTER_TO_INT (userdata); gint ret = GPOINTER_TO_INT (userdata);
if (ret == 1) 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) 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 /* adding a probe that returns FALSE will drop the buffer without trying
* to chain */ * 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); (GstPadProbeCallback) _probe_handler, GINT_TO_POINTER (0), NULL);
buffer = gst_buffer_new (); buffer = gst_buffer_new ();
gst_buffer_ref (buffer); 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, /* adding a probe that returns TRUE will still chain the buffer,
* and hence drop because pad is unlinked */ * 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); (GstPadProbeCallback) _probe_handler, GINT_TO_POINTER (1), NULL);
buffer = gst_buffer_new (); buffer = gst_buffer_new ();
gst_buffer_ref (buffer); 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 /* adding a probe that returns FALSE will drop the buffer without trying
* to chain */ * 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); (GstPadProbeCallback) _probe_handler, GINT_TO_POINTER (0), NULL);
buffer = gst_buffer_new (); buffer = gst_buffer_new ();
gst_buffer_ref (buffer); gst_buffer_ref (buffer);
@ -399,7 +399,7 @@ GST_START_TEST (test_push_linked)
fail_unless_equals_int (g_list_length (buffers), 0); fail_unless_equals_int (g_list_length (buffers), 0);
/* adding a probe that returns TRUE will still chain the buffer */ /* 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); (GstPadProbeCallback) _probe_handler, GINT_TO_POINTER (1), NULL);
buffer = gst_buffer_new (); buffer = gst_buffer_new ();
gst_buffer_ref (buffer); gst_buffer_ref (buffer);
@ -689,13 +689,13 @@ GST_END_TEST;
static gulong id; static gulong id;
static GstProbeReturn static GstPadProbeReturn
block_async_cb (GstPad * pad, GstProbeType type, gpointer type_data, block_async_cb (GstPad * pad, GstPadProbeType type, gpointer type_data,
gpointer user_data) gpointer user_data)
{ {
gboolean *bool_user_data = (gboolean *) 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 */ /* here we should have blocked == 0 unblocked == 0 */
fail_unless (bool_user_data[0] == FALSE); 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); gst_pad_remove_probe (pad, id);
bool_user_data[1] = TRUE; bool_user_data[1] = TRUE;
return GST_PROBE_OK; return GST_PAD_PROBE_OK;
} }
GST_START_TEST (test_block_async) GST_START_TEST (test_block_async)
@ -720,7 +720,7 @@ GST_START_TEST (test_block_async)
fail_unless (pad != NULL); fail_unless (pad != NULL);
gst_pad_set_active (pad, TRUE); 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); NULL);
fail_unless (data[0] == FALSE); fail_unless (data[0] == FALSE);
@ -798,8 +798,8 @@ block_async_full_destroy (gpointer user_data)
*state = 2; *state = 2;
} }
static GstProbeReturn static GstPadProbeReturn
block_async_full_cb (GstPad * pad, GstProbeType type, gpointer type_data, block_async_full_cb (GstPad * pad, GstPadProbeType type, gpointer type_data,
gpointer user_data) gpointer user_data)
{ {
*(gint *) user_data = (gint) TRUE; *(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_pad_push_event (pad, gst_event_new_flush_start ());
GST_DEBUG ("setting state to 1"); GST_DEBUG ("setting state to 1");
return GST_PROBE_OK; return GST_PAD_PROBE_OK;
} }
GST_START_TEST (test_block_async_full_destroy) GST_START_TEST (test_block_async_full_destroy)
@ -821,7 +821,7 @@ GST_START_TEST (test_block_async_full_destroy)
fail_unless (pad != NULL); fail_unless (pad != NULL);
gst_pad_set_active (pad, TRUE); 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); &state, block_async_full_destroy);
fail_unless (state == 0); fail_unless (state == 0);
@ -850,7 +850,7 @@ GST_START_TEST (test_block_async_full_destroy_dispose)
fail_unless (pad != NULL); fail_unless (pad != NULL);
gst_pad_set_active (pad, TRUE); 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); &state, block_async_full_destroy);
gst_pad_push (pad, gst_buffer_new ()); gst_pad_push (pad, gst_buffer_new ());
@ -895,15 +895,15 @@ unblock_async_not_called (GstPad * pad, gboolean blocked, gpointer user_data)
} }
#endif #endif
static GstProbeReturn static GstPadProbeReturn
block_async_second_no_flush (GstPad * pad, GstProbeType type, block_async_second_no_flush (GstPad * pad, GstPadProbeType type,
gpointer type_data, gpointer user_data) gpointer type_data, gpointer user_data)
{ {
gboolean *bool_user_data = (gboolean *) user_data; gboolean *bool_user_data = (gboolean *) user_data;
GST_DEBUG ("second probe called"); 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[0] == TRUE);
fail_unless (bool_user_data[1] == FALSE); 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_DEBUG ("removing second probe with id %lu", id);
gst_pad_remove_probe (pad, id); gst_pad_remove_probe (pad, id);
return GST_PROBE_OK; return GST_PAD_PROBE_OK;
} }
static GstProbeReturn static GstPadProbeReturn
block_async_first_no_flush (GstPad * pad, GstProbeType type, gpointer type_data, block_async_first_no_flush (GstPad * pad, GstPadProbeType type,
gpointer user_data) gpointer type_data, gpointer user_data)
{ {
static int n_calls = 0; static int n_calls = 0;
gboolean *bool_user_data = (gboolean *) user_data; 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 ("first probe called");
@ -944,11 +944,11 @@ block_async_first_no_flush (GstPad * pad, GstProbeType type, gpointer type_data,
GST_DEBUG ("adding second probe"); GST_DEBUG ("adding second probe");
/* replace block_async_first with block_async_second so next time the pad is /* replace block_async_first with block_async_second so next time the pad is
* blocked the latter should be called */ * 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); block_async_second_no_flush, user_data, NULL);
GST_DEBUG ("added probe with id %lu", id); 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_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_pad_set_active (pad, TRUE);
GST_DEBUG ("adding probe"); 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); block_async_first_no_flush, bool_user_data, NULL);
GST_DEBUG ("added probe with id %lu", id); GST_DEBUG ("added probe with id %lu", id);
fail_if (id == 0); fail_if (id == 0);

View file

@ -238,7 +238,7 @@ static GMutex *probe_lock;
static GCond *probe_cond; static GCond *probe_cond;
static gboolean static gboolean
sink_pad_probe (GstPad * pad, GstProbeType type, GstBuffer * buffer, sink_pad_probe (GstPad * pad, GstPadProbeType type, GstBuffer * buffer,
GstClockTime * first_timestamp) GstClockTime * first_timestamp)
{ {
fail_if (GST_BUFFER_TIMESTAMP (buffer) == GST_CLOCK_TIME_NONE, 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); gst_element_link (fakesrc, fakesink);
sink = gst_element_get_static_pad (fakesink, "sink"); 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); (GstPadProbeCallback) sink_pad_probe, &observed, NULL);
fail_unless (gst_element_set_state (pipeline, GST_STATE_PAUSED) 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_buffer_probes = 0;
static int n_event_probes = 0; static int n_event_probes = 0;
static GstProbeReturn static GstPadProbeReturn
probe_do_nothing (GstPad * pad, GstProbeType type, gpointer type_data, probe_do_nothing (GstPad * pad, GstPadProbeType type, gpointer type_data,
gpointer data) gpointer data)
{ {
GstMiniObject *obj = type_data; GstMiniObject *obj = type_data;
GST_DEBUG_OBJECT (pad, "is buffer:%d", GST_IS_BUFFER (obj)); GST_DEBUG_OBJECT (pad, "is buffer:%d", GST_IS_BUFFER (obj));
return GST_PROBE_OK; return GST_PAD_PROBE_OK;
} }
static GstProbeReturn static GstPadProbeReturn
data_probe (GstPad * pad, GstProbeType type, gpointer type_data, gpointer data) data_probe (GstPad * pad, GstPadProbeType type, gpointer type_data,
gpointer data)
{ {
GstMiniObject *obj = type_data; GstMiniObject *obj = type_data;
n_data_probes++; n_data_probes++;
GST_DEBUG_OBJECT (pad, "data probe %d", 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 (GST_IS_BUFFER (obj) || GST_IS_EVENT (obj));
g_assert (data == SPECIAL_POINTER (0)); g_assert (data == SPECIAL_POINTER (0));
return GST_PROBE_OK; return GST_PAD_PROBE_OK;
} }
static GstProbeReturn static GstPadProbeReturn
buffer_probe (GstPad * pad, GstProbeType type, gpointer type_data, buffer_probe (GstPad * pad, GstPadProbeType type, gpointer type_data,
gpointer data) gpointer data)
{ {
GstBuffer *obj = type_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); GST_DEBUG_OBJECT (pad, "buffer probe %d", n_buffer_probes);
g_assert (GST_IS_BUFFER (obj)); g_assert (GST_IS_BUFFER (obj));
g_assert (data == SPECIAL_POINTER (1)); g_assert (data == SPECIAL_POINTER (1));
return GST_PROBE_OK; return GST_PAD_PROBE_OK;
} }
static GstProbeReturn static GstPadProbeReturn
event_probe (GstPad * pad, GstProbeType type, gpointer type_data, gpointer data) event_probe (GstPad * pad, GstPadProbeType type, gpointer type_data,
gpointer data)
{ {
GstEvent *obj = type_data; GstEvent *obj = type_data;
n_event_probes++; 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)); n_event_probes, GST_EVENT_TYPE_NAME (obj));
g_assert (GST_IS_EVENT (obj)); g_assert (GST_IS_EVENT (obj));
g_assert (data == SPECIAL_POINTER (2)); g_assert (data == SPECIAL_POINTER (2));
return GST_PROBE_OK; return GST_PAD_PROBE_OK;
} }
GST_START_TEST (test_buffer_probe_n_times) 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"); pad = gst_element_get_static_pad (fakesink, "sink");
/* add the probes we need for the test */ /* add the probes we need for the test */
gst_pad_add_probe (pad, GST_PROBE_TYPE_DATA, data_probe, SPECIAL_POINTER (0), gst_pad_add_probe (pad, GST_PAD_PROBE_TYPE_DATA, data_probe,
NULL); SPECIAL_POINTER (0), NULL);
gst_pad_add_probe (pad, GST_PROBE_TYPE_BUFFER, buffer_probe, gst_pad_add_probe (pad, GST_PAD_PROBE_TYPE_BUFFER, buffer_probe,
SPECIAL_POINTER (1), NULL); 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); SPECIAL_POINTER (2), NULL);
/* add some string probes just to test that the data is free'd /* add some string probes just to test that the data is free'd
* properly as it should be */ * 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); 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); 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); g_strdup ("event probe string"), (GDestroyNotify) g_free);
gst_object_unref (pad); 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_buffer_probes_once = 0;
static int n_event_probes_once = 0; static int n_event_probes_once = 0;
static GstProbeReturn static GstPadProbeReturn
data_probe_once (GstPad * pad, GstProbeType type, GstMiniObject * obj, data_probe_once (GstPad * pad, GstPadProbeType type, GstMiniObject * obj,
guint * data) guint * data)
{ {
n_data_probes_once++; n_data_probes_once++;
@ -146,11 +148,11 @@ data_probe_once (GstPad * pad, GstProbeType type, GstMiniObject * obj,
gst_pad_remove_probe (pad, *data); gst_pad_remove_probe (pad, *data);
return GST_PROBE_OK; return GST_PAD_PROBE_OK;
} }
static GstProbeReturn static GstPadProbeReturn
buffer_probe_once (GstPad * pad, GstProbeType type, GstBuffer * obj, buffer_probe_once (GstPad * pad, GstPadProbeType type, GstBuffer * obj,
guint * data) guint * data)
{ {
n_buffer_probes_once++; n_buffer_probes_once++;
@ -158,18 +160,19 @@ buffer_probe_once (GstPad * pad, GstProbeType type, GstBuffer * obj,
gst_pad_remove_probe (pad, *data); gst_pad_remove_probe (pad, *data);
return GST_PROBE_OK; return GST_PAD_PROBE_OK;
} }
static GstProbeReturn static GstPadProbeReturn
event_probe_once (GstPad * pad, GstProbeType type, GstEvent * obj, guint * data) event_probe_once (GstPad * pad, GstPadProbeType type, GstEvent * obj,
guint * data)
{ {
n_event_probes_once++; n_event_probes_once++;
g_assert (GST_IS_EVENT (obj)); g_assert (GST_IS_EVENT (obj));
gst_pad_remove_probe (pad, *data); gst_pad_remove_probe (pad, *data);
return GST_PROBE_OK; return GST_PAD_PROBE_OK;
} }
GST_START_TEST (test_buffer_probe_once) 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"); pad = gst_element_get_static_pad (fakesink, "sink");
id1 = 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); (GstPadProbeCallback) data_probe_once, &id1, NULL);
id2 = 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); (GstPadProbeCallback) buffer_probe_once, &id2, NULL);
id3 = 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); (GstPadProbeCallback) event_probe_once, &id3, NULL);
gst_object_unref (pad); gst_object_unref (pad);

View file

@ -27,8 +27,8 @@
#include <gst/check/gstcheck.h> #include <gst/check/gstcheck.h>
#include <gst/base/gstbasesrc.h> #include <gst/base/gstbasesrc.h>
static GstProbeReturn static GstPadProbeReturn
eos_event_counter (GstObject * pad, GstProbeType type, GstEvent * event, eos_event_counter (GstObject * pad, GstPadProbeType type, GstEvent * event,
guint * p_num_eos) guint * p_num_eos)
{ {
fail_unless (event != NULL); 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) if (GST_EVENT_TYPE (event) == GST_EVENT_EOS)
*p_num_eos += 1; *p_num_eos += 1;
return GST_PROBE_OK; return GST_PAD_PROBE_OK;
} }
/* basesrc_eos_events_push_live_op: /* 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"); srcpad = gst_element_get_static_pad (src, "src");
fail_unless (srcpad != NULL); 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); (GstPadProbeCallback) eos_event_counter, &num_eos, NULL);
bus = gst_element_get_bus (pipe); 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"); srcpad = gst_element_get_static_pad (src, "src");
fail_unless (srcpad != NULL); 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); (GstPadProbeCallback) eos_event_counter, &num_eos, NULL);
bus = gst_element_get_bus (pipe); 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"); srcpad = gst_element_get_static_pad (src, "src");
fail_unless (srcpad != NULL); 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); (GstPadProbeCallback) eos_event_counter, &num_eos, NULL);
gst_element_set_state (pipe, GST_STATE_PLAYING); 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"); srcpad = gst_element_get_static_pad (src, "src");
fail_unless (srcpad != NULL); 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); (GstPadProbeCallback) eos_event_counter, &num_eos, NULL);
bus = gst_element_get_bus (pipe); 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"); srcpad = gst_element_get_static_pad (src, "src");
fail_unless (srcpad != NULL); 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); (GstPadProbeCallback) eos_event_counter, &num_eos, NULL);
bus = gst_element_get_bus (pipe); 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"); srcpad = gst_element_get_static_pad (src, "src");
fail_unless (srcpad != NULL); 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); (GstPadProbeCallback) eos_event_counter, &num_eos, NULL);
bus = gst_element_get_bus (pipe); bus = gst_element_get_bus (pipe);
@ -482,8 +482,8 @@ GST_START_TEST (basesrc_eos_events_pull_live_eos)
GST_END_TEST; GST_END_TEST;
static GstProbeReturn static GstPadProbeReturn
segment_event_catcher (GstObject * pad, GstProbeType type, GstEvent * event, segment_event_catcher (GstObject * pad, GstPadProbeType type, GstEvent * event,
gpointer * user_data) gpointer * user_data)
{ {
GstEvent **last_event = (GstEvent **) 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); *last_event = gst_event_copy (event);
} }
return GST_PROBE_OK; return GST_PAD_PROBE_OK;
} }
/* basesrc_seek_events_rate_update: /* 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"); probe_pad = gst_element_get_static_pad (sink, "sink");
fail_unless (probe_pad != NULL); 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); (GstPadProbeCallback) segment_event_catcher, &seg_event, NULL);
/* prepare the seek */ /* prepare the seek */

View file

@ -23,8 +23,8 @@
#include <gst/gst.h> #include <gst/gst.h>
static GstProbeReturn static GstPadProbeReturn
modify_caps (GstObject * pad, GstProbeType type, GstEvent * event, modify_caps (GstObject * pad, GstPadProbeType type, GstEvent * event,
gpointer data) gpointer data)
{ {
GstElement *filter = GST_ELEMENT (data); GstElement *filter = GST_ELEMENT (data);
@ -34,14 +34,14 @@ modify_caps (GstObject * pad, GstProbeType type, GstEvent * event,
fail_unless (GST_IS_EVENT (event)); fail_unless (GST_IS_EVENT (event));
if (GST_EVENT_TYPE (event) != GST_EVENT_EOS) if (GST_EVENT_TYPE (event) != GST_EVENT_EOS)
return GST_PROBE_OK; return GST_PAD_PROBE_OK;
/* trigger caps negotiation error */ /* trigger caps negotiation error */
caps = gst_caps_new_empty_simple ("video/x-raw-rgb"); caps = gst_caps_new_empty_simple ("video/x-raw-rgb");
g_object_set (filter, "caps", caps, NULL); g_object_set (filter, "caps", caps, NULL);
gst_caps_unref (caps); gst_caps_unref (caps);
return GST_PROBE_OK; return GST_PAD_PROBE_OK;
} }
GST_START_TEST (test_queue) GST_START_TEST (test_queue)
@ -71,7 +71,7 @@ GST_START_TEST (test_queue)
pad = gst_element_get_static_pad (queue, "sink"); pad = gst_element_get_static_pad (queue, "sink");
fail_unless (pad != NULL); fail_unless (pad != NULL);
probe = 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); (GstPadProbeCallback) modify_caps, filter, NULL);
bus = gst_element_get_bus (pipeline); bus = gst_element_get_bus (pipeline);

View file

@ -1172,20 +1172,22 @@ gst_probe_type_get_type (void)
{ {
static gsize id = 0; static gsize id = 0;
static const GFlagsValue values[] = { static const GFlagsValue values[] = {
{C_FLAGS (GST_PROBE_TYPE_INVALID), "GST_PROBE_TYPE_INVALID", "invalid"}, {C_FLAGS (GST_PAD_PROBE_TYPE_INVALID), "GST_PAD_PROBE_TYPE_INVALID",
{C_FLAGS (GST_PROBE_TYPE_IDLE), "GST_PROBE_TYPE_IDLE", "idle"}, "invalid"},
{C_FLAGS (GST_PROBE_TYPE_BLOCK), "GST_PROBE_TYPE_BLOCK", "block"}, {C_FLAGS (GST_PAD_PROBE_TYPE_IDLE), "GST_PAD_PROBE_TYPE_IDLE", "idle"},
{C_FLAGS (GST_PROBE_TYPE_BUFFER), "GST_PROBE_TYPE_BUFFER", "buffer"}, {C_FLAGS (GST_PAD_PROBE_TYPE_BLOCK), "GST_PAD_PROBE_TYPE_BLOCK", "block"},
{C_FLAGS (GST_PROBE_TYPE_BUFFER_LIST), "GST_PROBE_TYPE_BUFFER_LIST", {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"}, "buffer-list"},
{C_FLAGS (GST_PROBE_TYPE_EVENT), "GST_PROBE_TYPE_EVENT", "event"}, {C_FLAGS (GST_PAD_PROBE_TYPE_EVENT), "GST_PAD_PROBE_TYPE_EVENT", "event"},
{C_FLAGS (GST_PROBE_TYPE_PUSH), "GST_PROBE_TYPE_PUSH", "push"}, {C_FLAGS (GST_PAD_PROBE_TYPE_PUSH), "GST_PAD_PROBE_TYPE_PUSH", "push"},
{C_FLAGS (GST_PROBE_TYPE_PULL), "GST_PROBE_TYPE_PULL", "pull"}, {C_FLAGS (GST_PAD_PROBE_TYPE_PULL), "GST_PAD_PROBE_TYPE_PULL", "pull"},
{0, NULL, NULL} {0, NULL, NULL}
}; };
if (g_once_init_enter (&id)) { 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); g_once_init_leave (&id, tmp);
} }
@ -1197,15 +1199,15 @@ gst_probe_return_get_type (void)
{ {
static gsize id = 0; static gsize id = 0;
static const GEnumValue values[] = { static const GEnumValue values[] = {
{C_ENUM (GST_PROBE_DROP), "GST_PROBE_DROP", "drop"}, {C_ENUM (GST_PAD_PROBE_DROP), "GST_PAD_PROBE_DROP", "drop"},
{C_ENUM (GST_PROBE_OK), "GST_PROBE_OK", "ok"}, {C_ENUM (GST_PAD_PROBE_OK), "GST_PAD_PROBE_OK", "ok"},
{C_ENUM (GST_PROBE_REMOVE), "GST_PROBE_REMOVE", "remove"}, {C_ENUM (GST_PAD_PROBE_REMOVE), "GST_PAD_PROBE_REMOVE", "remove"},
{C_ENUM (GST_PROBE_PASS), "GST_PROBE_PASS", "pass"}, {C_ENUM (GST_PAD_PROBE_PASS), "GST_PAD_PROBE_PASS", "pass"},
{0, NULL, NULL} {0, NULL, NULL}
}; };
if (g_once_init_enter (&id)) { 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); g_once_init_leave (&id, tmp);
} }

View file

@ -692,6 +692,8 @@ EXPORTS
gst_pad_peer_get_caps gst_pad_peer_get_caps
gst_pad_peer_query gst_pad_peer_query
gst_pad_presence_get_type gst_pad_presence_get_type
gst_pad_probe_return_get_type
gst_pad_probe_type_get_type
gst_pad_proxy_getcaps gst_pad_proxy_getcaps
gst_pad_pull_range gst_pad_pull_range
gst_pad_push gst_pad_push
@ -829,8 +831,6 @@ EXPORTS
gst_preset_set_meta gst_preset_set_meta
gst_print_element_args gst_print_element_args
gst_print_pad_caps gst_print_pad_caps
gst_probe_return_get_type
gst_probe_type_get_type
gst_progress_type_get_type gst_progress_type_get_type
gst_proxy_pad_acceptcaps_default gst_proxy_pad_acceptcaps_default
gst_proxy_pad_chain_default gst_proxy_pad_chain_default