diff options
author | Wim Taymans <wim.taymans@collabora.co.uk> | 2010-12-03 10:52:39 +0100 |
---|---|---|
committer | Wim Taymans <wim.taymans@collabora.co.uk> | 2010-12-03 11:21:40 +0100 |
commit | 582aeefd49dc90d68b55b498adb9d9dda61a3483 (patch) | |
tree | e5b8f2b27e0ff5cc8e492352420b7634b316a225 | |
parent | 0e26c89afc71eb8f7f4cfa7d8b0da1e7fd0460cc (diff) |
pad: clear pad cache when installing probes
Move the method to clear the pad cache into _private.h
Clear the pad cache when installing pad probes.
-rw-r--r-- | gst/gst_private.h | 5 | ||||
-rw-r--r-- | gst/gstpad.c | 20 | ||||
-rw-r--r-- | gst/gstutils.c | 3 |
3 files changed, 17 insertions, 11 deletions
diff --git a/gst/gst_private.h b/gst/gst_private.h index 426353f02..2cafbee61 100644 --- a/gst/gst_private.h +++ b/gst/gst_private.h @@ -48,6 +48,9 @@ extern const char g_log_domain_gstreamer[]; /* for the flags in the GstPluginDep structure below */ #include "gstplugin.h" +/* for the pad cache */ +#include "gstpad.h" + G_BEGIN_DECLS /* used by gstparse.c and grammar.y */ @@ -108,6 +111,8 @@ gboolean _priv_gst_registry_remove_cache_plugins (GstRegistry *registry); void _priv_gst_registry_cleanup (void); gboolean _gst_plugin_loader_client_run (void); +void _priv_gst_pad_invalidate_cache (GstPad *pad); + /* used in both gststructure.c and gstcaps.c; numbers are completely made up */ #define STRUCTURE_ESTIMATED_STRING_LEN(s) (16 + (s)->fields->len * 22) diff --git a/gst/gstpad.c b/gst/gstpad.c index cb6dd9a28..d6cf89fe9 100644 --- a/gst/gstpad.c +++ b/gst/gstpad.c @@ -108,8 +108,6 @@ static GstPadPushCache _pad_cache_invalid = { NULL, }; #define PAD_CACHE_INVALID (&_pad_cache_invalid) -static void pad_invalidate_cache (GstPad * pad); - #define GST_PAD_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GST_TYPE_PAD, GstPadPrivate)) @@ -634,7 +632,7 @@ pre_activate (GstPad * pad, GstActivateMode new_mode) case GST_ACTIVATE_NONE: GST_OBJECT_LOCK (pad); GST_DEBUG_OBJECT (pad, "setting ACTIVATE_MODE NONE, set flushing"); - pad_invalidate_cache (pad); + _priv_gst_pad_invalidate_cache (pad); GST_PAD_SET_FLUSHING (pad); GST_PAD_ACTIVATE_MODE (pad) = new_mode; /* unlock blocked pads so element can resume and stop */ @@ -875,7 +873,7 @@ failure: GST_OBJECT_LOCK (pad); GST_CAT_INFO_OBJECT (GST_CAT_PADS, pad, "failed to %s in pull mode", active ? "activate" : "deactivate"); - pad_invalidate_cache (pad); + _priv_gst_pad_invalidate_cache (pad); GST_PAD_SET_FLUSHING (pad); GST_PAD_ACTIVATE_MODE (pad) = old; GST_OBJECT_UNLOCK (pad); @@ -981,7 +979,7 @@ failure: GST_OBJECT_LOCK (pad); GST_CAT_INFO_OBJECT (GST_CAT_PADS, pad, "failed to %s in push mode", active ? "activate" : "deactivate"); - pad_invalidate_cache (pad); + _priv_gst_pad_invalidate_cache (pad); GST_PAD_SET_FLUSHING (pad); GST_PAD_ACTIVATE_MODE (pad) = old; GST_OBJECT_UNLOCK (pad); @@ -1059,7 +1057,7 @@ gst_pad_set_blocked_async_full (GstPad * pad, gboolean blocked, if (blocked) { GST_CAT_LOG_OBJECT (GST_CAT_SCHEDULING, pad, "blocking pad"); - 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) @@ -1738,7 +1736,7 @@ gst_pad_unlink (GstPad * srcpad, GstPad * sinkpad) GST_PAD_UNLINKFUNC (sinkpad) (sinkpad); } - pad_invalidate_cache (srcpad); + _priv_gst_pad_invalidate_cache (srcpad); /* first clear peers */ GST_PAD_PEER (srcpad) = NULL; @@ -4561,8 +4559,8 @@ pad_put_cache (GstPad * pad, GstPadPushCache * cache, gpointer * cache_ptr) } /* must be called with the pad lock */ -static void -pad_invalidate_cache (GstPad * pad) +void +_priv_gst_pad_invalidate_cache (GstPad * pad) { GstPadPushCache *cache; gpointer *cache_ptr; @@ -5082,7 +5080,7 @@ gst_pad_push_event (GstPad * pad, GstEvent * event) * . handle pad blocking */ switch (GST_EVENT_TYPE (event)) { case GST_EVENT_FLUSH_START: - pad_invalidate_cache (pad); + _priv_gst_pad_invalidate_cache (pad); GST_PAD_SET_FLUSHING (pad); if (G_UNLIKELY (GST_PAD_IS_BLOCKED (pad))) { @@ -5243,7 +5241,7 @@ gst_pad_send_event (GstPad * pad, GstEvent * event) if (GST_PAD_IS_FLUSHING (pad)) goto flushing; - pad_invalidate_cache (pad); + _priv_gst_pad_invalidate_cache (pad); GST_PAD_SET_FLUSHING (pad); GST_CAT_DEBUG_OBJECT (GST_CAT_EVENT, pad, "set flush flag"); break; diff --git a/gst/gstutils.c b/gst/gstutils.c index c75cf0923..70011b8f4 100644 --- a/gst/gstutils.c +++ b/gst/gstutils.c @@ -3234,6 +3234,7 @@ gst_pad_add_data_probe_full (GstPad * pad, GCallback handler, 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; @@ -3291,6 +3292,7 @@ gst_pad_add_event_probe_full (GstPad * pad, GCallback handler, 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; @@ -3348,6 +3350,7 @@ gst_pad_add_buffer_probe_full (GstPad * pad, GCallback handler, 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; |