diff options
author | Wim Taymans <wim.taymans@collabora.co.uk> | 2011-05-26 12:11:57 +0200 |
---|---|---|
committer | Wim Taymans <wim.taymans@collabora.co.uk> | 2011-05-26 12:11:57 +0200 |
commit | 520b3ec749bc572069ab62a9e4e76cbd37d8fa59 (patch) | |
tree | e88ce2f91f1f3ade981ff657dfdf17127125e4ea | |
parent | 38c67665b92f762ff13d25d10e982b83872b59a3 (diff) |
pad: remove pad probespad-state
-rw-r--r-- | gst/gst_private.h | 2 | ||||
-rw-r--r-- | gst/gstpad.c | 260 | ||||
-rw-r--r-- | gst/gstpad.h | 6 | ||||
-rw-r--r-- | gst/gstutils.c | 285 | ||||
-rw-r--r-- | gst/gstutils.h | 34 | ||||
-rw-r--r-- | libs/gst/check/gstbufferstraw.c | 6 | ||||
-rw-r--r-- | libs/gst/check/gstconsistencychecker.c | 6 | ||||
-rw-r--r-- | tests/check/elements/selector.c | 19 | ||||
-rw-r--r-- | tests/check/gst/gstevent.c | 6 | ||||
-rw-r--r-- | tests/check/gst/gstpad.c | 12 | ||||
-rw-r--r-- | tests/check/gst/gstpipeline.c | 4 | ||||
-rw-r--r-- | tests/check/gst/gstutils.c | 4 | ||||
-rw-r--r-- | tests/check/libs/basesrc.c | 65 | ||||
-rw-r--r-- | tests/check/pipelines/queue-error.c | 8 |
14 files changed, 185 insertions, 532 deletions
diff --git a/gst/gst_private.h b/gst/gst_private.h index acc437d35..e9296a5f6 100644 --- a/gst/gst_private.h +++ b/gst/gst_private.h @@ -116,7 +116,9 @@ gboolean _priv_gst_registry_remove_cache_plugins (GstRegistry *registry); void _priv_gst_registry_cleanup (void); gboolean _gst_plugin_loader_client_run (void); +#if 0 void _priv_gst_pad_invalidate_cache (GstPad *pad); +#endif /* Used in GstBin for manual state handling */ void _priv_gst_element_state_changed (GstElement *element, GstState oldstate, diff --git a/gst/gstpad.c b/gst/gstpad.c index 196f9f24b..73b43fba3 100644 --- a/gst/gstpad.c +++ b/gst/gstpad.c @@ -81,7 +81,6 @@ enum PAD_LINKED, PAD_UNLINKED, PAD_REQUEST_LINK, - PAD_HAVE_DATA, /* FILL ME */ LAST_SIGNAL }; @@ -102,9 +101,11 @@ struct _GstPadPushCache GstPad *peer; /* reffed peer pad */ }; +#if 0 static GstPadPushCache _pad_cache_invalid = { NULL, }; #define PAD_CACHE_INVALID (&_pad_cache_invalid) +#endif #define GST_PAD_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GST_TYPE_PAD, GstPadPrivate)) @@ -160,9 +161,29 @@ typedef enum #define PAD_GET_STATE(p) g_atomic_int_get(&PAD_STATE(p)) #define PAD_UPDATE_STATE(p,o,n) g_atomic_int_compare_and_exchange (&PAD_STATE(p),(o),(n)) +#define PAD_STATE_SET(p,f) \ + G_STMT_START { \ + gint state, updated; \ + do { \ + state = PAD_GET_STATE (p); \ + updated = STATE_SET (state, f); \ + } while (!PAD_UPDATE_STATE (p, state, updated));\ + } G_STMT_END + +#define PAD_STATE_UNSET(p,f) \ + G_STMT_START { \ + gint state, updated; \ + do { \ + state = PAD_GET_STATE (p); \ + updated = STATE_UNSET (state, f); \ + } while (!PAD_UPDATE_STATE (p, state, updated));\ + } G_STMT_END + struct _GstPadPrivate { +#if 0 GstPadPushCache *cache_ptr; +#endif PadEvent events[GST_EVENT_MAX_STICKY]; @@ -273,6 +294,7 @@ gst_flow_to_quark (GstFlowReturn ret) G_DEFINE_TYPE_WITH_CODE (GstPad, gst_pad, GST_TYPE_OBJECT, _do_init); +#if 0 static gboolean _gst_do_pass_data_accumulator (GSignalInvocationHint * ihint, GValue * return_accu, const GValue * handler_return, gpointer dummy) @@ -290,6 +312,7 @@ default_have_data (GstPad * pad, GstMiniObject * o) { return TRUE; } +#endif static void gst_pad_class_init (GstPadClass * klass) @@ -343,24 +366,6 @@ gst_pad_class_init (GstPadClass * klass) G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstPadClass, request_link), NULL, NULL, gst_marshal_VOID__OBJECT, G_TYPE_NONE, 0); - /** - * GstPad::have-data: - * @pad: the pad that emitted the signal - * @mini_obj: new data - * - * Signals that new data is available on the pad. This signal is used - * internally for implementing pad probes. - * See gst_pad_add_*_probe functions. - * - * Returns: %TRUE to keep the data, %FALSE to drop it - */ - gst_pad_signals[PAD_HAVE_DATA] = - g_signal_new ("have-data", G_TYPE_FROM_CLASS (klass), - G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, - G_STRUCT_OFFSET (GstPadClass, have_data), - _gst_do_pass_data_accumulator, - NULL, gst_marshal_BOOLEAN__POINTER, G_TYPE_BOOLEAN, 1, G_TYPE_POINTER); - pspec_caps = g_param_spec_boxed ("caps", "Caps", "The capabilities of the pad", GST_TYPE_CAPS, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); @@ -385,8 +390,6 @@ gst_pad_class_init (GstPadClass * klass) GST_DEBUG_REGISTER_FUNCPTR (gst_pad_query_default); GST_DEBUG_REGISTER_FUNCPTR (gst_pad_iterate_internal_links_default); GST_DEBUG_REGISTER_FUNCPTR (gst_pad_acceptcaps_default); - - klass->have_data = default_have_data; } static void @@ -706,16 +709,16 @@ pre_activate (GstPad * pad, GstActivateMode new_mode) GST_DEBUG_OBJECT (pad, "setting ACTIVATE_MODE %d, unset flushing", new_mode); GST_PAD_UNSET_FLUSHING (pad); - PAD_STATE (pad) &= ~STATE_FLUSHING; + PAD_STATE_UNSET (pad, STATE_FLUSHING); GST_PAD_ACTIVATE_MODE (pad) = new_mode; GST_OBJECT_UNLOCK (pad); break; case GST_ACTIVATE_NONE: GST_OBJECT_LOCK (pad); GST_DEBUG_OBJECT (pad, "setting ACTIVATE_MODE NONE, set flushing"); - _priv_gst_pad_invalidate_cache (pad); + //_priv_gst_pad_invalidate_cache (pad); GST_PAD_SET_FLUSHING (pad); - PAD_STATE (pad) |= STATE_FLUSHING; + PAD_STATE_SET (pad, STATE_FLUSHING); GST_PAD_ACTIVATE_MODE (pad) = new_mode; /* unlock blocked pads so element can resume and stop */ GST_PAD_BLOCK_BROADCAST (pad); @@ -970,9 +973,9 @@ failure: GST_OBJECT_LOCK (pad); GST_CAT_INFO_OBJECT (GST_CAT_PADS, pad, "failed to %s in pull mode", active ? "activate" : "deactivate"); - _priv_gst_pad_invalidate_cache (pad); + //_priv_gst_pad_invalidate_cache (pad); GST_PAD_SET_FLUSHING (pad); - PAD_STATE (pad) |= STATE_FLUSHING; + PAD_STATE_SET (pad, STATE_FLUSHING); GST_PAD_ACTIVATE_MODE (pad) = old; GST_OBJECT_UNLOCK (pad); return FALSE; @@ -1077,9 +1080,9 @@ failure: GST_OBJECT_LOCK (pad); GST_CAT_INFO_OBJECT (GST_CAT_PADS, pad, "failed to %s in push mode", active ? "activate" : "deactivate"); - _priv_gst_pad_invalidate_cache (pad); + //_priv_gst_pad_invalidate_cache (pad); GST_PAD_SET_FLUSHING (pad); - PAD_STATE (pad) |= STATE_FLUSHING; + PAD_STATE_SET (pad, STATE_FLUSHING); GST_PAD_ACTIVATE_MODE (pad) = old; GST_OBJECT_UNLOCK (pad); return FALSE; @@ -1161,7 +1164,7 @@ gst_pad_set_blocked_async_full (GstPad * pad, gboolean blocked, if (blocked) { GST_CAT_LOG_OBJECT (GST_CAT_SCHEDULING, pad, "blocking pad"); - _priv_gst_pad_invalidate_cache (pad); + //_priv_gst_pad_invalidate_cache (pad); GST_OBJECT_FLAG_SET (pad, GST_PAD_BLOCKED); if (pad->block_destroy_data && pad->block_data) @@ -1785,15 +1788,14 @@ gst_pad_unlink (GstPad * srcpad, GstPad * sinkpad) if (GST_PAD_UNLINKFUNC (sinkpad)) { GST_PAD_UNLINKFUNC (sinkpad) (sinkpad); } - - _priv_gst_pad_invalidate_cache (srcpad); + //_priv_gst_pad_invalidate_cache (srcpad); /* first clear peers */ GST_PAD_PEER (srcpad) = NULL; GST_PAD_PEER (sinkpad) = NULL; - PAD_STATE (srcpad) |= STATE_UNLINKED; - PAD_STATE (sinkpad) |= STATE_UNLINKED; + PAD_STATE_SET (srcpad, STATE_UNLINKED); + PAD_STATE_SET (sinkpad, STATE_UNLINKED); /* clear pending caps if any */ for (i = 0; i < GST_EVENT_MAX_STICKY; i++) @@ -2147,8 +2149,8 @@ gst_pad_link_full (GstPad * srcpad, GstPad * sinkpad, GstPadLinkCheck flags) GST_PAD_PEER (srcpad) = sinkpad; GST_PAD_PEER (sinkpad) = srcpad; - PAD_STATE (srcpad) &= ~STATE_UNLINKED; - PAD_STATE (sinkpad) &= ~STATE_UNLINKED; + PAD_STATE_UNSET (srcpad, STATE_UNLINKED); + PAD_STATE_UNSET (sinkpad, STATE_UNLINKED); /* make sure we push the events from the source to this new peer, for this we * copy the events on the sinkpad and mark EVENTS_PENDING */ @@ -3767,6 +3769,7 @@ done: } +#if 0 /********************************************************************** * Data passing functions */ @@ -3803,6 +3806,7 @@ gst_pad_emit_have_data_signal (GstPad * pad, GstMiniObject * obj) return res; } +#endif static void gst_pad_data_unref (gboolean is_buffer, void *data) @@ -3823,7 +3827,6 @@ gst_pad_chain_data_unchecked (GstPad * pad, gboolean is_buffer, void *data, { gboolean needs_events; GstFlowReturn ret; - gboolean emit_signal; GST_PAD_STREAM_LOCK (pad); @@ -3840,22 +3843,8 @@ gst_pad_chain_data_unchecked (GstPad * pad, gboolean is_buffer, void *data, if (G_UNLIKELY (ret != GST_FLOW_OK)) goto events_error; } - emit_signal = GST_PAD_DO_BUFFER_SIGNALS (pad) > 0; GST_OBJECT_UNLOCK (pad); - /* see if the signal should be emited */ - if (G_UNLIKELY (emit_signal)) { - cache = NULL; - if (G_LIKELY (is_buffer)) { - if (!gst_pad_emit_have_data_signal (pad, GST_MINI_OBJECT_CAST (data))) - goto dropping; - } else { - /* chain all groups in the buffer list one by one to avoid problems with - * buffer probes that push buffers or events */ - goto chain_groups; - } - } - /* NOTE: we read the chainfunc unlocked. * we cannot hold the lock for the pad so we might send * the data to the wrong function. This is not really a @@ -3938,13 +3927,6 @@ flushing: GST_PAD_STREAM_UNLOCK (pad); return GST_FLOW_WRONG_STATE; } -dropping: - { - gst_pad_data_unref (is_buffer, data); - GST_DEBUG_OBJECT (pad, "Dropping buffer due to FALSE probe return"); - GST_PAD_STREAM_UNLOCK (pad); - return GST_FLOW_OK; - } events_error: { gst_pad_data_unref (is_buffer, data); @@ -4042,6 +4024,7 @@ gst_pad_chain_list (GstPad * pad, GstBufferList * list) return gst_pad_chain_data_unchecked (pad, FALSE, list, NULL); } +#if 0 static GstFlowReturn gst_pad_push_data (GstPad * pad, gboolean is_buffer, void *data, GstPadPushCache * cache) @@ -4057,25 +4040,6 @@ gst_pad_push_data (GstPad * pad, gboolean is_buffer, void *data, if ((ret = handle_pad_block (pad)) != GST_FLOW_OK) goto flushed; - /* we emit signals on the pad arg, the peer will have a chance to - * emit in the _chain() function */ - if (G_UNLIKELY (GST_PAD_DO_BUFFER_SIGNALS (pad) > 0)) { - cache = NULL; - /* unlock before emitting */ - GST_OBJECT_UNLOCK (pad); - - if (G_LIKELY (is_buffer)) { - /* if the signal handler returned FALSE, it means we should just drop the - * buffer */ - if (!gst_pad_emit_have_data_signal (pad, GST_MINI_OBJECT_CAST (data))) - goto dropped; - } else { - /* push all buffers in the list */ - goto push_groups; - } - GST_OBJECT_LOCK (pad); - } - if (G_UNLIKELY ((peer = GST_PAD_PEER (pad)) == NULL)) goto not_linked; @@ -4134,7 +4098,9 @@ not_linked: return GST_FLOW_NOT_LINKED; } } +#endif +#if 0 static inline GstPadPushCache * pad_take_cache (GstPad * pad, gpointer * cache_ptr) { @@ -4202,6 +4168,7 @@ _priv_gst_pad_invalidate_cache (GstPad * pad) if (G_LIKELY (cache && cache != PAD_CACHE_INVALID)) pad_free_cache (cache); } +#endif /* do initial checks on @pad before dereffing the peer. * We have 2 possibilities: @@ -4215,7 +4182,7 @@ _priv_gst_pad_invalidate_cache (GstPad * pad) * when the pad was not in use. */ static GstFlowReturn -start_streaming (GstPad * pad) +start_streaming (GstPad * pad, GstPad ** peer) { GstFlowReturn ret; PadState state, updated; @@ -4255,6 +4222,11 @@ again: if (!PAD_UPDATE_STATE (pad, state, updated)) goto again; + /* FIXME, racy, the pad can go away. What we need to do is copy and ref the + * pad to some space */ + if (G_UNLIKELY ((*peer = GST_PAD_PEER (pad)) == NULL)) + goto not_linked; + return GST_FLOW_OK; /* ERRORS */ @@ -4280,7 +4252,7 @@ not_linked: * the FLUSHING, UNLINKED or BLOCK_PENDING flags */ static GstFlowReturn -stop_streaming (GstPad * pad) +stop_streaming (GstPad * pad, GstPad * peer) { GstFlowReturn ret; PadState state, updated; @@ -4385,12 +4357,9 @@ 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); - if ((ret = start_streaming (pad)) != GST_FLOW_OK) + if ((ret = start_streaming (pad, &peer)) != GST_FLOW_OK) goto error; - if (G_UNLIKELY ((peer = GST_PAD_PEER (pad)) == NULL)) - goto not_linked; - GST_PAD_STREAM_LOCK (peer); GST_CAT_LOG_OBJECT (GST_CAT_SCHEDULING, pad, @@ -4406,7 +4375,7 @@ gst_pad_push (GstPad * pad, GstBuffer * buffer) GST_PAD_STREAM_UNLOCK (peer); - stop_streaming (pad); + stop_streaming (pad, peer); return ret; @@ -4416,11 +4385,6 @@ error: GST_DEBUG_OBJECT (pad, "got an error %s", gst_flow_get_name (ret)); return ret; } -not_linked: - { - GST_DEBUG_OBJECT (pad, "no peer"); - return GST_FLOW_NOT_LINKED; - } } /** @@ -4462,64 +4426,32 @@ not_linked: GstFlowReturn gst_pad_push_list (GstPad * pad, GstBufferList * list) { - GstPadPushCache *cache; GstFlowReturn ret; - gpointer *cache_ptr; GstPad *peer; g_return_val_if_fail (GST_IS_PAD (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); - cache_ptr = (gpointer *) & pad->priv->cache_ptr; - - cache = pad_take_cache (pad, cache_ptr); - - if (G_UNLIKELY (cache == NULL)) - goto slow_path; - - peer = cache->peer; + if ((ret = start_streaming (pad, &peer)) != GST_FLOW_OK) + goto error; GST_PAD_STREAM_LOCK (peer); - if (G_UNLIKELY (g_atomic_pointer_get (cache_ptr) == PAD_CACHE_INVALID)) - goto invalid; ret = GST_PAD_CHAINLISTFUNC (peer) (peer, list); GST_PAD_STREAM_UNLOCK (peer); - pad_put_cache (pad, cache, cache_ptr); + stop_streaming (pad, peer); return ret; /* slow path */ -slow_path: +error: { - GstPadPushCache scache = { NULL, }; - - GST_LOG_OBJECT (pad, "Taking slow path"); - - ret = gst_pad_push_data (pad, FALSE, list, &scache); - - if (scache.peer) { - GstPadPushCache *ncache; - - GST_LOG_OBJECT (pad, "Caching push data"); - - /* make cache structure */ - ncache = g_slice_new (GstPadPushCache); - *ncache = scache; - - pad_put_cache (pad, ncache, cache_ptr); - } + GST_DEBUG_OBJECT (pad, "got an error %s", gst_flow_get_name (ret)); return ret; } -invalid: - { - GST_PAD_STREAM_UNLOCK (peer); - pad_free_cache (cache); - goto slow_path; - } } static GstFlowReturn @@ -4528,15 +4460,12 @@ gst_pad_get_range_unchecked (GstPad * pad, guint64 offset, guint size, { GstFlowReturn ret; GstPadGetRangeFunction getrangefunc; - gboolean emit_signal; GST_PAD_STREAM_LOCK (pad); GST_OBJECT_LOCK (pad); if (G_UNLIKELY (GST_PAD_IS_FLUSHING (pad))) goto flushing; - - emit_signal = GST_PAD_DO_BUFFER_SIGNALS (pad) > 0; GST_OBJECT_UNLOCK (pad); if (G_UNLIKELY ((getrangefunc = GST_PAD_GETRANGEFUNC (pad)) == NULL)) @@ -4549,11 +4478,6 @@ gst_pad_get_range_unchecked (GstPad * pad, guint64 offset, guint size, ret = getrangefunc (pad, offset, size, buffer); - /* can only fire the signal if we have a valid buffer */ - if (G_UNLIKELY (emit_signal) && (ret == GST_FLOW_OK)) { - if (!gst_pad_emit_have_data_signal (pad, GST_MINI_OBJECT_CAST (*buffer))) - goto dropping; - } GST_PAD_STREAM_UNLOCK (pad); if (G_UNLIKELY (ret != GST_FLOW_OK)) @@ -4578,15 +4502,6 @@ no_function: GST_PAD_STREAM_UNLOCK (pad); return GST_FLOW_NOT_SUPPORTED; } -dropping: - { - GST_CAT_LOG_OBJECT (GST_CAT_SCHEDULING, pad, - "Dropping data after FALSE probe return"); - GST_PAD_STREAM_UNLOCK (pad); - gst_buffer_unref (*buffer); - *buffer = NULL; - return GST_FLOW_UNEXPECTED; - } get_range_failed: { *buffer = NULL; @@ -4666,7 +4581,6 @@ gst_pad_pull_range (GstPad * pad, guint64 offset, guint size, { GstPad *peer; GstFlowReturn ret; - gboolean emit_signal; gboolean needs_events; g_return_val_if_fail (GST_IS_PAD (pad), GST_FLOW_ERROR); @@ -4681,10 +4595,6 @@ gst_pad_pull_range (GstPad * pad, guint64 offset, guint size, if (G_UNLIKELY ((peer = GST_PAD_PEER (pad)) == NULL)) goto not_connected; - /* signal emision for the pad, peer has chance to emit when - * we call _get_range() */ - emit_signal = GST_PAD_DO_BUFFER_SIGNALS (pad) > 0; - gst_object_ref (peer); GST_OBJECT_UNLOCK (pad); @@ -4695,12 +4605,6 @@ gst_pad_pull_range (GstPad * pad, guint64 offset, guint size, if (G_UNLIKELY (ret != GST_FLOW_OK)) goto pull_range_failed; - /* can only fire the signal if we have a valid buffer */ - if (G_UNLIKELY (emit_signal)) { - if (!gst_pad_emit_have_data_signal (pad, GST_MINI_OBJECT_CAST (*buffer))) - goto dropping; - } - GST_OBJECT_LOCK (pad); needs_events = GST_PAD_NEEDS_EVENTS (pad); @@ -4732,14 +4636,6 @@ pull_range_failed: pad, "pullrange failed, flow: %s", gst_flow_get_name (ret)); return ret; } -dropping: - { - GST_CAT_LOG_OBJECT (GST_CAT_SCHEDULING, pad, - "Dropping data after FALSE probe return"); - gst_buffer_unref (*buffer); - *buffer = NULL; - return GST_FLOW_UNEXPECTED; - } events_error: { GST_OBJECT_UNLOCK (pad); @@ -4787,9 +4683,9 @@ gst_pad_push_event (GstPad * pad, GstEvent * event) * . handle pad blocking */ switch (GST_EVENT_TYPE (event)) { case GST_EVENT_FLUSH_START: - _priv_gst_pad_invalidate_cache (pad); + //_priv_gst_pad_invalidate_cache (pad); GST_PAD_SET_FLUSHING (pad); - PAD_STATE (pad) |= STATE_FLUSHING; + PAD_STATE_SET (pad, STATE_FLUSHING); if (G_UNLIKELY (GST_PAD_IS_BLOCKED (pad))) { @@ -4804,7 +4700,7 @@ gst_pad_push_event (GstPad * pad, GstEvent * event) break; case GST_EVENT_FLUSH_STOP: GST_PAD_UNSET_FLUSHING (pad); - PAD_STATE (pad) &= ~STATE_FLUSHING; + PAD_STATE_UNSET (pad, STATE_FLUSHING); /* if we are blocked, flush away the FLUSH_STOP event */ if (G_UNLIKELY (GST_PAD_IS_BLOCKED (pad))) { @@ -4824,15 +4720,6 @@ gst_pad_push_event (GstPad * pad, GstEvent * event) break; } - if (G_UNLIKELY (GST_PAD_DO_EVENT_SIGNALS (pad) > 0)) { - GST_OBJECT_UNLOCK (pad); - - if (!gst_pad_emit_have_data_signal (pad, GST_MINI_OBJECT_CAST (event))) - goto dropping; - - GST_OBJECT_LOCK (pad); - } - /* store the event on the pad, but only on srcpads */ if (GST_PAD_IS_SRC (pad) && GST_EVENT_IS_STICKY (event)) { guint idx; @@ -4901,12 +4788,6 @@ gst_pad_push_event (GstPad * pad, GstEvent * event) return result; /* ERROR handling */ -dropping: - { - GST_DEBUG_OBJECT (pad, "Dropping event after FALSE probe return"); - gst_event_unref (event); - return FALSE; - } not_linked: { GST_DEBUG_OBJECT (pad, "Dropping event because pad is not linked"); @@ -4974,15 +4855,6 @@ gst_pad_send_event (GstPad * pad, GstEvent * event) } else goto unknown_direction; - /* pad signals */ - if (G_UNLIKELY (GST_PAD_DO_EVENT_SIGNALS (pad) > 0)) { - GST_OBJECT_UNLOCK (pad); - - if (!gst_pad_emit_have_data_signal (pad, GST_MINI_OBJECT_CAST (event))) - goto dropping; - - GST_OBJECT_LOCK (pad); - } /* get the flag first, we clear it when we have a FLUSH or a non-serialized * event. */ needs_events = GST_PAD_NEEDS_EVENTS (pad); @@ -4996,16 +4868,16 @@ gst_pad_send_event (GstPad * pad, GstEvent * event) if (GST_PAD_IS_FLUSHING (pad)) goto flushing; - _priv_gst_pad_invalidate_cache (pad); + //_priv_gst_pad_invalidate_cache (pad); GST_PAD_SET_FLUSHING (pad); - PAD_STATE (pad) |= STATE_FLUSHING; + PAD_STATE_SET (pad, STATE_FLUSHING); GST_CAT_DEBUG_OBJECT (GST_CAT_EVENT, pad, "set flush flag"); needs_events = FALSE; break; case GST_EVENT_FLUSH_STOP: if (G_LIKELY (GST_PAD_ACTIVATE_MODE (pad) != GST_ACTIVATE_NONE)) { GST_PAD_UNSET_FLUSHING (pad); - PAD_STATE (pad) &= ~STATE_FLUSHING; + PAD_STATE_UNSET (pad, STATE_FLUSHING); GST_CAT_DEBUG_OBJECT (GST_CAT_EVENT, pad, "cleared flush flag"); } GST_OBJECT_UNLOCK (pad); @@ -5146,12 +5018,6 @@ flushing: gst_event_unref (event); return FALSE; } -dropping: - { - GST_DEBUG_OBJECT (pad, "Dropping event after FALSE probe return"); - gst_event_unref (event); - return FALSE; - } update_failed: { GST_OBJECT_UNLOCK (pad); diff --git a/gst/gstpad.h b/gst/gstpad.h index aaecf8caf..2d317e880 100644 --- a/gst/gstpad.h +++ b/gst/gstpad.h @@ -637,11 +637,6 @@ struct _GstPad { /* internal links */ GstPadIterIntLinkFunction iterintlinkfunc; - /* whether to emit signals for have-data. counts number - * of handlers attached. */ - gint do_buffer_signals; - gint do_event_signals; - /*< private >*/ GstPadPrivate *priv; @@ -655,7 +650,6 @@ struct _GstPadClass { void (*linked) (GstPad *pad, GstPad *peer); void (*unlinked) (GstPad *pad, GstPad *peer); void (*request_link) (GstPad *pad); - gboolean (*have_data) (GstPad *pad, GstMiniObject *data); /*< private >*/ gpointer _gst_reserved[GST_PADDING]; diff --git a/gst/gstutils.c b/gst/gstutils.c index 7c35475a2..29df1d583 100644 --- a/gst/gstutils.c +++ b/gst/gstutils.c @@ -3128,291 +3128,6 @@ gst_pad_query_peer_convert (GstPad * pad, GstFormat src_format, gint64 src_val, } /** - * gst_pad_add_data_probe: - * @pad: pad to add the data probe handler to - * @handler: function to call when data is passed over pad - * @data: (closure): data to pass along with the handler - * - * Adds a "data probe" to a pad. This function will be called whenever data - * passes through a pad. In this case data means both events and buffers. The - * probe will be called with the data as an argument, meaning @handler should - * have the same callback signature as the #GstPad::have-data signal. - * Note that the data will have a reference count greater than 1, so it will - * be immutable -- you must not change it. - * - * For source pads, the probe will be called after the blocking function, if any - * (see gst_pad_set_blocked_async()), but before looking up the peer to chain - * to. For sink pads, the probe function will be called before configuring the - * sink with new caps, if any, and before calling the pad's chain function. - * - * Your data probe should return TRUE to let the data continue to flow, or FALSE - * to drop it. Dropping data is rarely useful, but occasionally comes in handy - * with events. - * - * Although probes are implemented internally by connecting @handler to the - * have-data signal on the pad, if you want to remove a probe it is insufficient - * to only call g_signal_handler_disconnect on the returned handler id. To - * remove a probe, use the appropriate function, such as - * gst_pad_remove_data_probe(). - * - * Returns: The handler id. - */ -gulong -gst_pad_add_data_probe (GstPad * pad, GCallback handler, gpointer data) -{ - return gst_pad_add_data_probe_full (pad, handler, data, NULL); -} - -/** - * gst_pad_add_data_probe_full: - * @pad: pad to add the data probe handler to - * @handler: function to call when data is passed over pad - * @data: (closure): data to pass along with the handler - * @notify: (allow-none): function to call when the probe is disconnected, - * or NULL - * - * Adds a "data probe" to a pad. This function will be called whenever data - * passes through a pad. In this case data means both events and buffers. The - * probe will be called with the data as an argument, meaning @handler should - * have the same callback signature as the #GstPad::have-data signal. - * Note that the data will have a reference count greater than 1, so it will - * be immutable -- you must not change it. - * - * For source pads, the probe will be called after the blocking function, if any - * (see gst_pad_set_blocked_async()), but before looking up the peer to chain - * to. For sink pads, the probe function will be called before configuring the - * sink with new caps, if any, and before calling the pad's chain function. - * - * Your data probe should return TRUE to let the data continue to flow, or FALSE - * to drop it. Dropping data is rarely useful, but occasionally comes in handy - * with events. - * - * Although probes are implemented internally by connecting @handler to the - * have-data signal on the pad, if you want to remove a probe it is insufficient - * to only call g_signal_handler_disconnect on the returned handler id. To - * remove a probe, use the appropriate function, such as - * gst_pad_remove_data_probe(). - * - * The @notify function is called when the probe is disconnected and usually - * used to free @data. - * - * Returns: The handler id. - * - * Since: 0.10.20 - */ -gulong -gst_pad_add_data_probe_full (GstPad * pad, GCallback handler, - gpointer data, GDestroyNotify notify) -{ - gulong sigid; - - g_return_val_if_fail (GST_IS_PAD (pad), 0); - g_return_val_if_fail (handler != NULL, 0); - - GST_OBJECT_LOCK (pad); - - /* we only expose a GDestroyNotify in our API because that's less confusing */ - sigid = g_signal_connect_data (pad, "have-data", handler, data, - (GClosureNotify) notify, 0); - - GST_PAD_DO_EVENT_SIGNALS (pad)++; - GST_PAD_DO_BUFFER_SIGNALS (pad)++; - GST_CAT_DEBUG_OBJECT (GST_CAT_PADS, pad, - "adding data probe, now %d data, %d event probes", - GST_PAD_DO_BUFFER_SIGNALS (pad), GST_PAD_DO_EVENT_SIGNALS (pad)); - _priv_gst_pad_invalidate_cache (pad); - GST_OBJECT_UNLOCK (pad); - - return sigid; -} - -/** - * gst_pad_add_event_probe: - * @pad: pad to add the event probe handler to - * @handler: function to call when events are passed over pad - * @data: (closure): data to pass along with the handler - * - * Adds a probe that will be called for all events passing through a pad. See - * gst_pad_add_data_probe() for more information. - * - * Returns: The handler id - */ -gulong -gst_pad_add_event_probe (GstPad * pad, GCallback handler, gpointer data) -{ - return gst_pad_add_event_probe_full (pad, handler, data, NULL); -} - -/** - * gst_pad_add_event_probe_full: - * @pad: pad to add the event probe handler to - * @handler: function to call when events are passed over pad - * @data: (closure): data to pass along with the handler, or NULL - * @notify: (allow-none): function to call when probe is disconnected, or NULL - * - * Adds a probe that will be called for all events passing through a pad. See - * gst_pad_add_data_probe() for more information. - * - * The @notify function is called when the probe is disconnected and usually - * used to free @data. - * - * Returns: The handler id - * - * Since: 0.10.20 - */ -gulong -gst_pad_add_event_probe_full (GstPad * pad, GCallback handler, - gpointer data, GDestroyNotify notify) -{ - gulong sigid; - - g_return_val_if_fail (GST_IS_PAD (pad), 0); - g_return_val_if_fail (handler != NULL, 0); - - GST_OBJECT_LOCK (pad); - - /* we only expose a GDestroyNotify in our API because that's less confusing */ - sigid = g_signal_connect_data (pad, "have-data::event", handler, data, - (GClosureNotify) notify, 0); - - GST_PAD_DO_EVENT_SIGNALS (pad)++; - GST_CAT_DEBUG_OBJECT (GST_CAT_PADS, pad, "adding event probe, now %d probes", - GST_PAD_DO_EVENT_SIGNALS (pad)); - _priv_gst_pad_invalidate_cache (pad); - GST_OBJECT_UNLOCK (pad); - - return sigid; -} - -/** - * gst_pad_add_buffer_probe: - * @pad: pad to add the buffer probe handler to - * @handler: function to call when buffers are passed over pad - * @data: (closure): data to pass along with the handler - * - * Adds a probe that will be called for all buffers passing through a pad. See - * gst_pad_add_data_probe() for more information. - * - * Returns: The handler id - */ -gulong -gst_pad_add_buffer_probe (GstPad * pad, GCallback handler, gpointer data) -{ - return gst_pad_add_buffer_probe_full (pad, handler, data, NULL); -} - -/** - * gst_pad_add_buffer_probe_full: - * @pad: pad to add the buffer probe handler to - * @handler: function to call when buffer are passed over pad - * @data: (closure): data to pass along with the handler - * @notify: (allow-none): function to call when the probe is disconnected, - * or NULL - * - * Adds a probe that will be called for all buffers passing through a pad. See - * gst_pad_add_data_probe() for more information. - * - * The @notify function is called when the probe is disconnected and usually - * used to free @data. - * - * Returns: The handler id - * - * Since: 0.10.20 - */ -gulong -gst_pad_add_buffer_probe_full (GstPad * pad, GCallback handler, - gpointer data, GDestroyNotify notify) -{ - gulong sigid; - - g_return_val_if_fail (GST_IS_PAD (pad), 0); - g_return_val_if_fail (handler != NULL, 0); - - GST_OBJECT_LOCK (pad); - - /* we only expose a GDestroyNotify in our API because that's less confusing */ - sigid = g_signal_connect_data (pad, "have-data::buffer", handler, data, - (GClosureNotify) notify, 0); - - GST_PAD_DO_BUFFER_SIGNALS (pad)++; - GST_CAT_DEBUG_OBJECT (GST_CAT_PADS, pad, "adding buffer probe, now %d probes", - GST_PAD_DO_BUFFER_SIGNALS (pad)); - _priv_gst_pad_invalidate_cache (pad); - GST_OBJECT_UNLOCK (pad); - - return sigid; -} - -/** - * gst_pad_remove_data_probe: - * @pad: pad to remove the data probe handler from - * @handler_id: handler id returned from gst_pad_add_data_probe - * - * Removes a data probe from @pad. - */ -void -gst_pad_remove_data_probe (GstPad * pad, guint handler_id) -{ - g_return_if_fail (GST_IS_PAD (pad)); - g_return_if_fail (handler_id > 0); - - GST_OBJECT_LOCK (pad); - g_signal_handler_disconnect (pad, handler_id); - GST_PAD_DO_BUFFER_SIGNALS (pad)--; - GST_PAD_DO_EVENT_SIGNALS (pad)--; - GST_CAT_DEBUG_OBJECT (GST_CAT_PADS, pad, - "removed data probe, now %d event, %d buffer probes", - GST_PAD_DO_EVENT_SIGNALS (pad), GST_PAD_DO_BUFFER_SIGNALS (pad)); - GST_OBJECT_UNLOCK (pad); - -} - -/** - * gst_pad_remove_event_probe: - * @pad: pad to remove the event probe handler from - * @handler_id: handler id returned from gst_pad_add_event_probe - * - * Removes an event probe from @pad. - */ -void -gst_pad_remove_event_probe (GstPad * pad, guint handler_id) -{ - g_return_if_fail (GST_IS_PAD (pad)); - g_return_if_fail (handler_id > 0); - - GST_OBJECT_LOCK (pad); - g_signal_handler_disconnect (pad, handler_id); - GST_PAD_DO_EVENT_SIGNALS (pad)--; - GST_CAT_DEBUG_OBJECT (GST_CAT_PADS, pad, - "removed event probe, now %d event probes", - GST_PAD_DO_EVENT_SIGNALS (pad)); - GST_OBJECT_UNLOCK (pad); -} - -/** - * gst_pad_remove_buffer_probe: - * @pad: pad to remove the buffer probe handler from - * @handler_id: handler id returned from gst_pad_add_buffer_probe - * - * Removes a buffer probe from @pad. - */ -void -gst_pad_remove_buffer_probe (GstPad * pad, guint handler_id) -{ - g_return_if_fail (GST_IS_PAD (pad)); - g_return_if_fail (handler_id > 0); - - GST_OBJECT_LOCK (pad); - g_signal_handler_disconnect (pad, handler_id); - GST_PAD_DO_BUFFER_SIGNALS (pad)--; - GST_CAT_DEBUG_OBJECT (GST_CAT_PADS, pad, - "removed buffer probe, now %d buffer probes", - GST_PAD_DO_BUFFER_SIGNALS (pad)); - GST_OBJECT_UNLOCK (pad); - -} - -/** * gst_element_found_tags_for_pad: * @element: element for which to post taglist to bus. * @pad: (transfer none): pad on which to push tag-event diff --git a/gst/gstutils.h b/gst/gstutils.h index ce0f8bcb0..a5931cafb 100644 --- a/gst/gstutils.h +++ b/gst/gstutils.h @@ -936,40 +936,6 @@ GstPad * gst_bin_find_unlinked_pad (GstBin *bin, GstPadDire GstBuffer * gst_buffer_merge (GstBuffer * buf1, GstBuffer * buf2); GstBuffer * gst_buffer_join (GstBuffer * buf1, GstBuffer * buf2); -/* probes */ -gulong gst_pad_add_data_probe (GstPad * pad, - GCallback handler, - gpointer data); - -gulong gst_pad_add_data_probe_full (GstPad * pad, - GCallback handler, - gpointer data, - GDestroyNotify notify); - -void gst_pad_remove_data_probe (GstPad * pad, guint handler_id); - -gulong gst_pad_add_event_probe (GstPad * pad, - GCallback handler, - gpointer data); - -gulong gst_pad_add_event_probe_full (GstPad * pad, - GCallback handler, - gpointer data, - GDestroyNotify notify); - -void gst_pad_remove_event_probe (GstPad * pad, guint handler_id); - -gulong gst_pad_add_buffer_probe (GstPad * pad, - GCallback handler, - gpointer data); - -gulong gst_pad_add_buffer_probe_full (GstPad * pad, - GCallback handler, - gpointer data, - GDestroyNotify notify); - -void gst_pad_remove_buffer_probe (GstPad * pad, guint handler_id); - /* tag emission utility functions */ void gst_element_found_tags_for_pad (GstElement * element, GstPad * pad, diff --git a/libs/gst/check/gstbufferstraw.c b/libs/gst/check/gstbufferstraw.c index 1089ed901..4eb016498 100644 --- a/libs/gst/check/gstbufferstraw.c +++ b/libs/gst/check/gstbufferstraw.c @@ -35,6 +35,7 @@ static GMutex *lock = NULL; static GstBuffer *buf = NULL; static gulong id; +#if 0 /* called for every buffer. Waits until the global "buf" variable is unset, * then sets it to the buffer received, and signals. */ static gboolean @@ -54,6 +55,7 @@ buffer_probe (GstPad * pad, GstBuffer * buffer, gpointer unused) return TRUE; } +#endif /** * gst_buffer_straw_start_pipeline: @@ -81,7 +83,7 @@ gst_buffer_straw_start_pipeline (GstElement * bin, GstPad * pad) { GstStateChangeReturn ret; - id = gst_pad_add_buffer_probe (pad, G_CALLBACK (buffer_probe), NULL); + //id = gst_pad_add_buffer_probe (pad, G_CALLBACK (buffer_probe), NULL); cond = g_cond_new (); lock = g_mutex_new (); @@ -149,7 +151,7 @@ gst_buffer_straw_stop_pipeline (GstElement * bin, GstPad * pad) if (buf) gst_buffer_unref (buf); buf = NULL; - gst_pad_remove_buffer_probe (pad, (guint) id); + //gst_pad_remove_buffer_probe (pad, (guint) id); id = 0; g_cond_signal (cond); g_mutex_unlock (lock); diff --git a/libs/gst/check/gstconsistencychecker.c b/libs/gst/check/gstconsistencychecker.c index cd0598fd6..7b5be29a3 100644 --- a/libs/gst/check/gstconsistencychecker.c +++ b/libs/gst/check/gstconsistencychecker.c @@ -41,6 +41,7 @@ struct _GstStreamConsistency GstPad *pad; }; +#if 0 static gboolean source_pad_data_cb (GstPad * pad, GstMiniObject * data, GstStreamConsistency * consist) @@ -93,6 +94,7 @@ source_pad_data_cb (GstPad * pad, GstMiniObject * data, return TRUE; } +#endif /** * gst_consistency_checker_new: @@ -117,8 +119,10 @@ gst_consistency_checker_new (GstPad * pad) consist = g_new0 (GstStreamConsistency, 1); consist->pad = g_object_ref (pad); +#if 0 consist->probeid = gst_pad_add_data_probe (pad, (GCallback) source_pad_data_cb, consist); +#endif return consist; } @@ -153,7 +157,9 @@ void gst_consistency_checker_free (GstStreamConsistency * consist) { /* Remove the data probe */ +#if 0 gst_pad_remove_data_probe (consist->pad, consist->probeid); +#endif g_object_unref (consist->pad); g_free (consist); } diff --git a/tests/check/elements/selector.c b/tests/check/elements/selector.c index 4f36b1f6a..690c4f3de 100644 --- a/tests/check/elements/selector.c +++ b/tests/check/elements/selector.c @@ -33,6 +33,7 @@ static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src", GST_PAD_ALWAYS, GST_STATIC_CAPS_ANY); +#if 0 /* Data probe cb to drop everything but count buffers and events */ static gboolean probe_cb (GstPad * pad, GstMiniObject * obj, gpointer user_data) @@ -58,13 +59,16 @@ probe_cb (GstPad * pad, GstMiniObject * obj, gpointer user_data) /* drop everything */ return FALSE; } +#endif /* Create and link output pad: selector:src%d ! output_pad */ static GstPad * setup_output_pad (GstElement * element, GstStaticPadTemplate * tmpl) { GstPad *srcpad = NULL, *output_pad = NULL; +#if 0 gulong probe_id = 0; +#endif if (tmpl == NULL) tmpl = &sinktemplate; @@ -73,10 +77,12 @@ setup_output_pad (GstElement * element, GstStaticPadTemplate * tmpl) output_pad = gst_pad_new_from_static_template (tmpl, "sink"); fail_if (output_pad == NULL, "Could not create a output_pad"); +#if 0 /* add probe */ probe_id = gst_pad_add_data_probe (output_pad, G_CALLBACK (probe_cb), NULL); g_object_set_data (G_OBJECT (output_pad), "probe_id", GINT_TO_POINTER (probe_id)); +#endif /* request src pad */ srcpad = gst_element_get_request_pad (element, "src%d"); @@ -103,14 +109,18 @@ static void cleanup_pad (GstPad * pad, GstElement * element) { GstPad *selpad = NULL; +#if 0 guint probe_id = 0; +#endif fail_if (pad == NULL, "pad doesn't exist"); +#if 0 /* remove probe if necessary */ probe_id = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (pad), "probe_id")); if (probe_id) gst_pad_remove_data_probe (pad, probe_id); +#endif /* unlink */ selpad = gst_pad_get_peer (pad); @@ -302,7 +312,10 @@ run_input_selector_buffer_count (gint num_input_pads, gint num_buffers_per_input) { /* set up input_pads ! selector ! output_pad */ - gint i = 0, probe_id = 0; + gint i = 0; +#if 0 + gint probe_id = 0; +#endif GList *input_pads = NULL, *output_pads = NULL; GstElement *sel = gst_check_setup_element ("input-selector"); GstPad *output_pad = gst_check_setup_sink_pad (sel, &sinktemplate, NULL); @@ -312,10 +325,12 @@ run_input_selector_buffer_count (gint num_input_pads, for (i = 0; i < num_input_pads; i++) { input_pads = g_list_append (input_pads, setup_input_pad (sel)); } +#if 0 /* add probe */ probe_id = gst_pad_add_data_probe (output_pad, G_CALLBACK (probe_cb), NULL); g_object_set_data (G_OBJECT (output_pad), "probe_id", GINT_TO_POINTER (probe_id)); +#endif /* run the test */ fail_unless (gst_element_set_state (sel, @@ -327,7 +342,9 @@ run_input_selector_buffer_count (gint num_input_pads, GST_STATE_NULL) == GST_STATE_CHANGE_SUCCESS, "could not set to null"); /* clean up */ +#if 0 gst_pad_remove_data_probe (output_pad, probe_id); +#endif gst_pad_set_active (output_pad, FALSE); gst_check_teardown_sink_pad (sel); GST_DEBUG ("setting selector pad to NULL"); diff --git a/tests/check/gst/gstevent.c b/tests/check/gst/gstevent.c index 4579317a6..217617b15 100644 --- a/tests/check/gst/gstevent.c +++ b/tests/check/gst/gstevent.c @@ -264,6 +264,7 @@ static GTimeVal sent_event_time; static GstEvent *got_event_before_q, *got_event_after_q; static GTimeVal got_event_time; +#if 0 static gboolean event_probe (GstPad * pad, GstMiniObject ** data, gpointer user_data) { @@ -306,6 +307,7 @@ event_probe (GstPad * pad, GstMiniObject ** data, gpointer user_data) return TRUE; } +#endif static void test_event (GstBin * pipeline, GstEventType type, GstPad * pad, @@ -408,12 +410,16 @@ 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); +#if 0 gst_pad_add_event_probe (srcpad, (GCallback) event_probe, GINT_TO_POINTER (TRUE)); +#endif fail_if ((sinkpad = gst_element_get_static_pad (fakesink, "sink")) == NULL); +#if 0 gst_pad_add_event_probe (sinkpad, (GCallback) event_probe, GINT_TO_POINTER (FALSE)); +#endif /* Upstream events */ test_event (pipeline, GST_EVENT_CUSTOM_UPSTREAM, sinkpad, TRUE, srcpad); diff --git a/tests/check/gst/gstpad.c b/tests/check/gst/gstpad.c index a65130f6b..e3443f1d4 100644 --- a/tests/check/gst/gstpad.c +++ b/tests/check/gst/gstpad.c @@ -249,6 +249,7 @@ GST_START_TEST (test_name_is_valid) GST_END_TEST; +#if 0 static gboolean _probe_handler (GstPad * pad, GstBuffer * buffer, gpointer userdata) { @@ -258,13 +259,16 @@ _probe_handler (GstPad * pad, GstBuffer * buffer, gpointer userdata) return TRUE; return FALSE; } +#endif GST_START_TEST (test_push_unlinked) { GstPad *src; GstCaps *caps; GstBuffer *buffer; +#if 0 gulong id; +#endif src = gst_pad_new ("src", GST_PAD_SRC); fail_if (src == NULL); @@ -283,6 +287,7 @@ GST_START_TEST (test_push_unlinked) ASSERT_MINI_OBJECT_REFCOUNT (buffer, "buffer", 1); gst_buffer_unref (buffer); +#if 0 /* adding a probe that returns FALSE will drop the buffer without trying * to chain */ id = gst_pad_add_buffer_probe (src, (GCallback) _probe_handler, @@ -293,7 +298,9 @@ GST_START_TEST (test_push_unlinked) ASSERT_MINI_OBJECT_REFCOUNT (buffer, "buffer", 1); gst_buffer_unref (buffer); gst_pad_remove_buffer_probe (src, id); +#endif +#if 0 /* adding a probe that returns TRUE will still chain the buffer, * and hence drop because pad is unlinked */ id = gst_pad_add_buffer_probe (src, (GCallback) _probe_handler, @@ -304,6 +311,7 @@ GST_START_TEST (test_push_unlinked) ASSERT_MINI_OBJECT_REFCOUNT (buffer, "buffer", 1); gst_buffer_unref (buffer); gst_pad_remove_buffer_probe (src, id); +#endif /* cleanup */ @@ -324,7 +332,9 @@ GST_START_TEST (test_push_linked) GstPadLinkReturn plr; GstCaps *caps; GstBuffer *buffer; +#if 0 gulong id; +#endif /* setup */ sink = gst_pad_new ("sink", GST_PAD_SINK); @@ -374,6 +384,7 @@ GST_START_TEST (test_push_linked) g_list_free (buffers); buffers = NULL; +#if 0 /* adding a probe that returns FALSE will drop the buffer without trying * to chain */ id = gst_pad_add_buffer_probe (src, (GCallback) _probe_handler, @@ -393,6 +404,7 @@ GST_START_TEST (test_push_linked) gst_buffer_ref (buffer); fail_unless (gst_pad_push (src, buffer) == GST_FLOW_OK); gst_pad_remove_buffer_probe (src, id); +#endif ASSERT_MINI_OBJECT_REFCOUNT (buffer, "buffer", 2); gst_buffer_unref (buffer); diff --git a/tests/check/gst/gstpipeline.c b/tests/check/gst/gstpipeline.c index 02b6dc2b2..3a740166a 100644 --- a/tests/check/gst/gstpipeline.c +++ b/tests/check/gst/gstpipeline.c @@ -237,6 +237,7 @@ GST_END_TEST; static GMutex *probe_lock; static GCond *probe_cond; +#if 0 static gboolean sink_pad_probe (GstPad * pad, GstBuffer * buffer, GstClockTime * first_timestamp) @@ -254,6 +255,7 @@ sink_pad_probe (GstPad * pad, GstBuffer * buffer, return TRUE; } +#endif GST_START_TEST (test_base_time) { @@ -274,7 +276,9 @@ GST_START_TEST (test_base_time) gst_element_link (fakesrc, fakesink); sink = gst_element_get_static_pad (fakesink, "sink"); +#if 0 gst_pad_add_buffer_probe (sink, G_CALLBACK (sink_pad_probe), &observed); +#endif fail_unless (gst_element_set_state (pipeline, GST_STATE_PAUSED) == GST_STATE_CHANGE_NO_PREROLL, "expected no-preroll from live pipeline"); diff --git a/tests/check/gst/gstutils.c b/tests/check/gst/gstutils.c index 22d4fb3be..6d0e74a46 100644 --- a/tests/check/gst/gstutils.c +++ b/tests/check/gst/gstutils.c @@ -28,6 +28,7 @@ #define SPECIAL_POINTER(x) ((void*)(19283847+(x))) +#if 0 static int n_data_probes = 0; static int n_buffer_probes = 0; static int n_event_probes = 0; @@ -199,6 +200,7 @@ GST_START_TEST (test_buffer_probe_once) g_assert (n_event_probes_once == 1); /* i said, can we hit it and quit? */ g_assert (n_data_probes_once == 1); /* let's hit it and quit!!! */ } GST_END_TEST; +#endif GST_START_TEST (test_math_scale) { @@ -1068,8 +1070,10 @@ gst_utils_suite (void) TCase *tc_chain = tcase_create ("general"); suite_add_tcase (s, tc_chain); +#if 0 tcase_add_test (tc_chain, test_buffer_probe_n_times); tcase_add_test (tc_chain, test_buffer_probe_once); +#endif tcase_add_test (tc_chain, test_math_scale); tcase_add_test (tc_chain, test_math_scale_round); tcase_add_test (tc_chain, test_math_scale_ceil); diff --git a/tests/check/libs/basesrc.c b/tests/check/libs/basesrc.c index 750d9babb..9f4966ab7 100644 --- a/tests/check/libs/basesrc.c +++ b/tests/check/libs/basesrc.c @@ -27,6 +27,7 @@ #include <gst/check/gstcheck.h> #include <gst/base/gstbasesrc.h> +#if 0 static gboolean eos_event_counter (GstObject * pad, GstEvent * event, guint * p_num_eos) { @@ -38,6 +39,7 @@ eos_event_counter (GstObject * pad, GstEvent * event, guint * p_num_eos) return TRUE; } +#endif /* basesrc_eos_events_push_live_op: * - make sure source does send an EOS event when operating in push @@ -51,7 +53,10 @@ GST_START_TEST (basesrc_eos_events_push_live_op) GstMessage *msg; GstBus *bus; GstPad *srcpad; - guint probe, num_eos = 0; +#if 0 + guint probe; +#endif + guint num_eos = 0; pipe = gst_pipeline_new ("pipeline"); sink = gst_element_factory_make ("fakesink", "sink"); @@ -76,8 +81,10 @@ GST_START_TEST (basesrc_eos_events_push_live_op) srcpad = gst_element_get_static_pad (src, "src"); fail_unless (srcpad != NULL); +#if 0 probe = gst_pad_add_event_probe (srcpad, G_CALLBACK (eos_event_counter), &num_eos); +#endif bus = gst_element_get_bus (pipe); @@ -110,7 +117,9 @@ GST_START_TEST (basesrc_eos_events_push_live_op) /* make sure source hasn't sent a second one when going PAUSED => READY */ fail_unless (num_eos == 1); +#if 0 gst_pad_remove_event_probe (srcpad, probe); +#endif gst_object_unref (srcpad); gst_message_unref (msg); gst_object_unref (bus); @@ -130,7 +139,10 @@ GST_START_TEST (basesrc_eos_events_push) GstMessage *msg; GstBus *bus; GstPad *srcpad; - guint probe, num_eos = 0; +#if 0 + guint probe; +#endif + guint num_eos = 0; pipe = gst_pipeline_new ("pipeline"); sink = gst_element_factory_make ("fakesink", "sink"); @@ -156,8 +168,10 @@ GST_START_TEST (basesrc_eos_events_push) srcpad = gst_element_get_static_pad (src, "src"); fail_unless (srcpad != NULL); +#if 0 probe = gst_pad_add_event_probe (srcpad, G_CALLBACK (eos_event_counter), &num_eos); +#endif bus = gst_element_get_bus (pipe); @@ -179,7 +193,9 @@ GST_START_TEST (basesrc_eos_events_push) /* make sure source hasn't sent a second one when going PAUSED => READY */ fail_unless (num_eos == 1); +#if 0 gst_pad_remove_event_probe (srcpad, probe); +#endif gst_object_unref (srcpad); gst_message_unref (msg); gst_object_unref (bus); @@ -198,7 +214,10 @@ GST_START_TEST (basesrc_eos_events_pull_live_op) GstStateChangeReturn state_ret; GstElement *src, *sink, *pipe; GstPad *srcpad; - guint probe, num_eos = 0; +#if 0 + guint probe; +#endif + guint num_eos = 0; pipe = gst_pipeline_new ("pipeline"); sink = gst_element_factory_make ("fakesink", "sink"); @@ -223,8 +242,10 @@ GST_START_TEST (basesrc_eos_events_pull_live_op) srcpad = gst_element_get_static_pad (src, "src"); fail_unless (srcpad != NULL); +#if 0 probe = gst_pad_add_event_probe (srcpad, G_CALLBACK (eos_event_counter), &num_eos); +#endif gst_element_set_state (pipe, GST_STATE_PLAYING); state_ret = gst_element_get_state (pipe, NULL, NULL, -1); @@ -249,7 +270,9 @@ GST_START_TEST (basesrc_eos_events_pull_live_op) /* make sure source hasn't sent an EOS when going PAUSED => READY either */ fail_unless (num_eos == 0); +#if 0 gst_pad_remove_event_probe (srcpad, probe); +#endif gst_object_unref (srcpad); gst_object_unref (pipe); } @@ -269,7 +292,10 @@ GST_START_TEST (basesrc_eos_events_pull) GstMessage *msg; GstBus *bus; GstPad *srcpad; - guint probe, num_eos = 0; +#if 0 + guint probe; +#endif + guint num_eos = 0; pipe = gst_pipeline_new ("pipeline"); sink = gst_element_factory_make ("fakesink", "sink"); @@ -295,8 +321,10 @@ GST_START_TEST (basesrc_eos_events_pull) srcpad = gst_element_get_static_pad (src, "src"); fail_unless (srcpad != NULL); +#if 0 probe = gst_pad_add_event_probe (srcpad, G_CALLBACK (eos_event_counter), &num_eos); +#endif bus = gst_element_get_bus (pipe); @@ -318,7 +346,9 @@ GST_START_TEST (basesrc_eos_events_pull) /* make sure source hasn't sent an EOS when going PAUSED => READY either */ fail_unless (num_eos == 0); +#if 0 gst_pad_remove_event_probe (srcpad, probe); +#endif gst_object_unref (srcpad); gst_message_unref (msg); gst_object_unref (bus); @@ -339,7 +369,10 @@ GST_START_TEST (basesrc_eos_events_push_live_eos) GstMessage *msg; GstBus *bus; GstPad *srcpad; - guint probe, num_eos = 0; +#if 0 + guint probe; +#endif + guint num_eos = 0; gboolean res; pipe = gst_pipeline_new ("pipeline"); @@ -365,8 +398,10 @@ GST_START_TEST (basesrc_eos_events_push_live_eos) srcpad = gst_element_get_static_pad (src, "src"); fail_unless (srcpad != NULL); +#if 0 probe = gst_pad_add_event_probe (srcpad, G_CALLBACK (eos_event_counter), &num_eos); +#endif bus = gst_element_get_bus (pipe); @@ -396,7 +431,9 @@ GST_START_TEST (basesrc_eos_events_push_live_eos) /* make sure source hasn't sent a second one when going PAUSED => READY */ fail_unless (num_eos == 1); +#if 0 gst_pad_remove_event_probe (srcpad, probe); +#endif gst_object_unref (srcpad); gst_message_unref (msg); gst_object_unref (bus); @@ -416,7 +453,10 @@ GST_START_TEST (basesrc_eos_events_pull_live_eos) GstMessage *msg; GstBus *bus; GstPad *srcpad; - guint probe, num_eos = 0; +#if 0 + guint probe; +#endif + guint num_eos = 0; gboolean res; pipe = gst_pipeline_new ("pipeline"); @@ -442,8 +482,10 @@ GST_START_TEST (basesrc_eos_events_pull_live_eos) srcpad = gst_element_get_static_pad (src, "src"); fail_unless (srcpad != NULL); +#if 0 probe = gst_pad_add_event_probe (srcpad, G_CALLBACK (eos_event_counter), &num_eos); +#endif bus = gst_element_get_bus (pipe); @@ -473,7 +515,9 @@ GST_START_TEST (basesrc_eos_events_pull_live_eos) /* make sure source hasn't sent a second one when going PAUSED => READY */ fail_unless (num_eos == 0); +#if 0 gst_pad_remove_event_probe (srcpad, probe); +#endif gst_object_unref (srcpad); gst_message_unref (msg); gst_object_unref (bus); @@ -482,7 +526,7 @@ GST_START_TEST (basesrc_eos_events_pull_live_eos) GST_END_TEST; - +#if 0 static gboolean segment_event_catcher (GstObject * pad, GstEvent * event, gpointer * user_data) { @@ -499,6 +543,7 @@ segment_event_catcher (GstObject * pad, GstEvent * event, gpointer * user_data) return TRUE; } +#endif /* basesrc_seek_events_rate_update: * - make sure we get expected segment after sending a seek event @@ -510,7 +555,9 @@ GST_START_TEST (basesrc_seek_events_rate_update) GstMessage *msg; GstBus *bus; GstPad *probe_pad; +#if 0 guint probe; +#endif GstEvent *seg_event = NULL; GstEvent *rate_seek; gboolean event_ret; @@ -535,8 +582,10 @@ GST_START_TEST (basesrc_seek_events_rate_update) probe_pad = gst_element_get_static_pad (sink, "sink"); fail_unless (probe_pad != NULL); +#if 0 probe = gst_pad_add_event_probe (probe_pad, G_CALLBACK (segment_event_catcher), &seg_event); +#endif /* prepare the seek */ rate_seek = gst_event_new_seek (0.5, GST_FORMAT_TIME, GST_SEEK_FLAG_NONE, @@ -583,7 +632,9 @@ GST_START_TEST (basesrc_seek_events_rate_update) gst_event_parse_segment (seg_event, &segment); fail_unless (segment->rate == 0.5); +#if 0 gst_pad_remove_event_probe (probe_pad, probe); +#endif gst_object_unref (probe_pad); gst_message_unref (msg); gst_event_unref (seg_event); diff --git a/tests/check/pipelines/queue-error.c b/tests/check/pipelines/queue-error.c index b43e085ca..343879712 100644 --- a/tests/check/pipelines/queue-error.c +++ b/tests/check/pipelines/queue-error.c @@ -23,6 +23,7 @@ #include <gst/gst.h> +#if 0 static gboolean modify_caps (GstObject * pad, GstEvent * event, gpointer data) { @@ -42,6 +43,7 @@ modify_caps (GstObject * pad, GstEvent * event, gpointer data) return TRUE; } +#endif GST_START_TEST (test_queue) { @@ -50,7 +52,9 @@ GST_START_TEST (test_queue) GstElement *pipeline, *filter, *queue; GstBus *bus; GstPad *pad; +#if 0 guint probe; +#endif gchar *pipe_desc = g_strdup_printf ("fakesrc num-buffers=1 ! video/x-raw-yuv ! " "queue min-threshold-buffers=2 name=queue ! " @@ -69,7 +73,9 @@ GST_START_TEST (test_queue) fail_unless (queue != NULL); pad = gst_element_get_static_pad (queue, "sink"); fail_unless (pad != NULL); +#if 0 probe = gst_pad_add_event_probe (pad, G_CALLBACK (modify_caps), filter); +#endif bus = gst_element_get_bus (pipeline); @@ -85,7 +91,9 @@ GST_START_TEST (test_queue) fail_unless_equals_int (gst_element_set_state (pipeline, GST_STATE_NULL), GST_STATE_CHANGE_SUCCESS); +#if 0 gst_pad_remove_event_probe (pad, probe); +#endif gst_object_unref (queue); gst_object_unref (pad); gst_object_unref (filter); |