diff options
29 files changed, 284 insertions, 342 deletions
diff --git a/docs/gst/tmpl/gstbin.sgml b/docs/gst/tmpl/gstbin.sgml index 68c62da4bc..8a0038e0b9 100644 --- a/docs/gst/tmpl/gstbin.sgml +++ b/docs/gst/tmpl/gstbin.sgml @@ -72,6 +72,34 @@ The GstBin object </para> +<!-- ##### SIGNAL GstBin::element-added ##### --> +<para> + +</para> + +@gstbin: the object which received the signal. +@arg1: the element that was added to the bin + +<!-- ##### SIGNAL GstBin::element-removed ##### --> +<para> + +</para> + +@gstbin: the object which received the signal. +@arg1: the element that was removed from the bin + +<!-- ##### SIGNAL GstBin::iterate ##### --> +<para> +This signal is emitted when a bin iterates, either automatically or +due to a #gst_bin_iterate() call. The return value is used to +determine if the object method handler processed any data. +In most normal cases, a user-provided signal handler should return +FALSE. +</para> + +@gstbin: the object which received the signal. +@Returns: TRUE if the state of the bin was advanced. + <!-- ##### USER_FUNCTION GstBinPrePostIterateFunction ##### --> <para> The signature of the callback for the post and pre iterate function as set with @@ -224,31 +252,3 @@ gst_bin_set_pre_iterate_function() and gst_bin_set_post_iterate_function(). @clock: -<!-- ##### SIGNAL GstBin::element-added ##### --> -<para> - -</para> - -@gstbin: the object which received the signal. -@arg1: the element that was added to the bin - -<!-- ##### SIGNAL GstBin::element-removed ##### --> -<para> - -</para> - -@gstbin: the object which received the signal. -@arg1: the element that was removed from the bin - -<!-- ##### SIGNAL GstBin::iterate ##### --> -<para> -This signal is emitted when a bin iterates, either automatically or -due to a #gst_bin_iterate() call. The return value is used to -determine if the object method handler processed any data. -In most normal cases, a user-provided signal handler should return -FALSE. -</para> - -@gstbin: the object which received the signal. -@Returns: TRUE if the state of the bin was advanced. - diff --git a/docs/gst/tmpl/gstbuffer.sgml b/docs/gst/tmpl/gstbuffer.sgml index c9474ec5a5..38ced90965 100644 --- a/docs/gst/tmpl/gstbuffer.sgml +++ b/docs/gst/tmpl/gstbuffer.sgml @@ -265,6 +265,7 @@ The basic structure of a buffer. @offset_end: @pool: @pool_private: +@_gst_reserved: <!-- ##### FUNCTION gst_buffer_new ##### --> <para> diff --git a/docs/gst/tmpl/gstbufferpool.sgml b/docs/gst/tmpl/gstbufferpool.sgml index 53a0ce99f5..197cf5e90e 100644 --- a/docs/gst/tmpl/gstbufferpool.sgml +++ b/docs/gst/tmpl/gstbufferpool.sgml @@ -92,6 +92,7 @@ The bufferpool structure @buffer_copy: @buffer_free: @user_data: +@_gst_reserved: <!-- ##### USER_FUNCTION GstBufferPoolBufferNewFunction ##### --> <para> diff --git a/docs/gst/tmpl/gstclock.sgml b/docs/gst/tmpl/gstclock.sgml index da3b748162..ae2cf0de72 100644 --- a/docs/gst/tmpl/gstclock.sgml +++ b/docs/gst/tmpl/gstclock.sgml @@ -235,6 +235,16 @@ The GstClock object </para> +<!-- ##### ARG GstClock:max-diff ##### --> +<para> +Maximum allowed diff for clock sync requests against the real time. +</para> + +<!-- ##### ARG GstClock:stats ##### --> +<para> +Boolean property to activate stat generation on the clock. +</para> + <!-- ##### FUNCTION gst_clock_set_speed ##### --> <para> @@ -402,13 +412,3 @@ The GstClock object @id: -<!-- ##### ARG GstClock:max-diff ##### --> -<para> -Maximum allowed diff for clock sync requests against the real time. -</para> - -<!-- ##### ARG GstClock:stats ##### --> -<para> -Boolean property to activate stat generation on the clock. -</para> - diff --git a/docs/gst/tmpl/gstdata.sgml b/docs/gst/tmpl/gstdata.sgml index 16aced475e..3705ec4c28 100644 --- a/docs/gst/tmpl/gstdata.sgml +++ b/docs/gst/tmpl/gstdata.sgml @@ -85,6 +85,7 @@ The base structure @flags: The flags of this GstData @free: A pointer to a custom free function @copy: A pointer to a custom copy function +@_gst_reserved: <!-- ##### USER_FUNCTION GstDataFreeFunction ##### --> <para> diff --git a/docs/gst/tmpl/gstelement.sgml b/docs/gst/tmpl/gstelement.sgml index e978c80481..4ce8a7bea1 100644 --- a/docs/gst/tmpl/gstelement.sgml +++ b/docs/gst/tmpl/gstelement.sgml @@ -71,6 +71,58 @@ The element object </para> +<!-- ##### SIGNAL GstElement::eos ##### --> +<para> +Signal emited when the element goes to PAUSED due to an end-of-stream +condition. +</para> + +@gstelement: the object which received the signal. + +<!-- ##### SIGNAL GstElement::error ##### --> +<para> +Is triggered whenever an error occured. + +</para> + +@gstelement: the object which received the signal. +@arg1: the error message +@arg2: + +<!-- ##### SIGNAL GstElement::found-tag ##### --> +<para> + +</para> + +@gstelement: the object which received the signal. +@arg1: +@arg2: + +<!-- ##### SIGNAL GstElement::new-pad ##### --> +<para> +Is triggered whenever a new pad is added to an element. +</para> + +@gstelement: the object which received the signal. +@arg1: the new pad that was added + +<!-- ##### SIGNAL GstElement::pad-removed ##### --> +<para> +Is triggered whenever a pad has been removed from the element. +</para> + +@gstelement: the object which received the signal. +@arg1: The pad that was removed. + +<!-- ##### SIGNAL GstElement::state-change ##### --> +<para> +Is triggered whenever the state of an element changes. +</para> + +@gstelement: the object which received the signal. +@arg1: the new state of the object +@arg2: + <!-- ##### MACRO gst_element_get_name ##### --> <para> Gets the name of the element. @@ -963,55 +1015,3 @@ Helper macro to create query type functions @...: list of query types. -<!-- ##### SIGNAL GstElement::eos ##### --> -<para> -Signal emited when the element goes to PAUSED due to an end-of-stream -condition. -</para> - -@gstelement: the object which received the signal. - -<!-- ##### SIGNAL GstElement::error ##### --> -<para> -Is triggered whenever an error occured. - -</para> - -@gstelement: the object which received the signal. -@arg1: the error message -@arg2: - -<!-- ##### SIGNAL GstElement::found-tag ##### --> -<para> - -</para> - -@gstelement: the object which received the signal. -@arg1: -@arg2: - -<!-- ##### SIGNAL GstElement::new-pad ##### --> -<para> -Is triggered whenever a new pad is added to an element. -</para> - -@gstelement: the object which received the signal. -@arg1: the new pad that was added - -<!-- ##### SIGNAL GstElement::pad-removed ##### --> -<para> -Is triggered whenever a pad has been removed from the element. -</para> - -@gstelement: the object which received the signal. -@arg1: The pad that was removed. - -<!-- ##### SIGNAL GstElement::state-change ##### --> -<para> -Is triggered whenever the state of an element changes. -</para> - -@gstelement: the object which received the signal. -@arg1: the new state of the object -@arg2: - diff --git a/docs/gst/tmpl/gstelementfactory.sgml b/docs/gst/tmpl/gstelementfactory.sgml index 6e6cfe15c2..b9b83ff3f5 100644 --- a/docs/gst/tmpl/gstelementfactory.sgml +++ b/docs/gst/tmpl/gstelementfactory.sgml @@ -64,6 +64,7 @@ describes the element, mostly for the benefit of editors. @klass: @description: @author: +@_gst_reserved: <!-- ##### FUNCTION gst_element_factory_find ##### --> <para> diff --git a/docs/gst/tmpl/gstindex.sgml b/docs/gst/tmpl/gstindex.sgml index d828fa3114..cdc3cfa10e 100644 --- a/docs/gst/tmpl/gstindex.sgml +++ b/docs/gst/tmpl/gstindex.sgml @@ -209,6 +209,19 @@ The GstIndex object </para> +<!-- ##### SIGNAL GstIndex::entry-added ##### --> +<para> +Is emited when a new entry is added to the index. +</para> + +@gstindex: the object which received the signal. +@arg1: The entry added to the index. + +<!-- ##### ARG GstIndex:resolver ##### --> +<para> + +</para> + <!-- ##### FUNCTION gst_index_new ##### --> <para> @@ -401,16 +414,3 @@ The GstIndex object @id: -<!-- ##### SIGNAL GstIndex::entry-added ##### --> -<para> -Is emited when a new entry is added to the index. -</para> - -@gstindex: the object which received the signal. -@arg1: The entry added to the index. - -<!-- ##### ARG GstIndex:resolver ##### --> -<para> - -</para> - diff --git a/docs/gst/tmpl/gstobject.sgml b/docs/gst/tmpl/gstobject.sgml index 52616a2215..cf69ab93ee 100644 --- a/docs/gst/tmpl/gstobject.sgml +++ b/docs/gst/tmpl/gstobject.sgml @@ -40,6 +40,47 @@ The GstObject </para> +<!-- ##### SIGNAL GstObject::deep-notify ##### --> +<para> +The deep notify signal is used to be notified of property changes. +it is typically attached to the toplevel bin to receive notifications +from all the elements contained in that bin. +</para> + +@gstobject: the object which received the signal. +@arg1: the object that originated the signal +@arg2: the property that changed + +<!-- ##### SIGNAL GstObject::object-saved ##### --> +<para> +Is trigered whenever a new object is saved to XML. You can connect to +this signal to insert custom XML tags into the core XML. +</para> + +@gstobject: the object which received the signal. +@arg1: the xmlNodePtr of the parent node + +<!-- ##### SIGNAL GstObject::parent-set ##### --> +<para> +Is emitted when the parent of an object is set. +</para> + +@gstobject: the object which received the signal. +@arg1: the new parent + +<!-- ##### SIGNAL GstObject::parent-unset ##### --> +<para> +Is emitted when the parent of an object is unset. +</para> + +@gstobject: the object which received the signal. +@arg1: the old parent + +<!-- ##### ARG GstObject:name ##### --> +<para> +The name of the object +</para> + <!-- ##### MACRO GST_FLAGS ##### --> <para> This macro returns the entire set of flags for the object. @@ -290,44 +331,3 @@ Check if the object has been destroyed. @Returns: -<!-- ##### SIGNAL GstObject::deep-notify ##### --> -<para> -The deep notify signal is used to be notified of property changes. -it is typically attached to the toplevel bin to receive notifications -from all the elements contained in that bin. -</para> - -@gstobject: the object which received the signal. -@arg1: the object that originated the signal -@arg2: the property that changed - -<!-- ##### SIGNAL GstObject::object-saved ##### --> -<para> -Is trigered whenever a new object is saved to XML. You can connect to -this signal to insert custom XML tags into the core XML. -</para> - -@gstobject: the object which received the signal. -@arg1: the xmlNodePtr of the parent node - -<!-- ##### SIGNAL GstObject::parent-set ##### --> -<para> -Is emitted when the parent of an object is set. -</para> - -@gstobject: the object which received the signal. -@arg1: the new parent - -<!-- ##### SIGNAL GstObject::parent-unset ##### --> -<para> -Is emitted when the parent of an object is unset. -</para> - -@gstobject: the object which received the signal. -@arg1: the old parent - -<!-- ##### ARG GstObject:name ##### --> -<para> -The name of the object -</para> - diff --git a/docs/gst/tmpl/gstpad.sgml b/docs/gst/tmpl/gstpad.sgml index a5555911d7..82c34f49c7 100644 --- a/docs/gst/tmpl/gstpad.sgml +++ b/docs/gst/tmpl/gstpad.sgml @@ -1095,6 +1095,7 @@ The realpad object @intlinkfunc: @bufferpoolfunc: @probedisp: +@_gst_reserved: <!-- ##### MACRO GST_RPAD_DIRECTION ##### --> <para> diff --git a/docs/gst/tmpl/gstpadtemplate.sgml b/docs/gst/tmpl/gstpadtemplate.sgml index f26e9c5f12..0396557ef7 100644 --- a/docs/gst/tmpl/gstpadtemplate.sgml +++ b/docs/gst/tmpl/gstpadtemplate.sgml @@ -87,6 +87,15 @@ The padtemplate object. </para> +<!-- ##### SIGNAL GstPadTemplate::pad-created ##### --> +<para> +This signal is fired when an element creates a pad from this +template. +</para> + +@gstpadtemplate: the object which received the signal. +@arg1: The pad that was created. + <!-- ##### ENUM GstPadTemplateFlags ##### --> <para> Flags for the padtemplate @@ -199,12 +208,3 @@ Check if the properties of the padtemplate are fixed @Returns: -<!-- ##### SIGNAL GstPadTemplate::pad-created ##### --> -<para> -This signal is fired when an element creates a pad from this -template. -</para> - -@gstpadtemplate: the object which received the signal. -@arg1: The pad that was created. - diff --git a/docs/gst/tmpl/gstplugin.sgml b/docs/gst/tmpl/gstplugin.sgml index 88cf73054f..c418c8a990 100644 --- a/docs/gst/tmpl/gstplugin.sgml +++ b/docs/gst/tmpl/gstplugin.sgml @@ -69,6 +69,7 @@ The plugin object @numfeatures: @manager: @module: +@_gst_reserved: <!-- ##### USER_FUNCTION GstPluginInitFunc ##### --> <para> @@ -98,6 +99,7 @@ loaded will use this variable to initialize the plugin. @license: @package: @origin: +@_gst_reserved: <!-- ##### FUNCTION gst_plugin_set_name ##### --> <para> diff --git a/docs/gst/tmpl/gstreamer-unused.sgml b/docs/gst/tmpl/gstreamer-unused.sgml index c40f9e3a8e..998cc8c7ee 100644 --- a/docs/gst/tmpl/gstreamer-unused.sgml +++ b/docs/gst/tmpl/gstreamer-unused.sgml @@ -5978,6 +5978,15 @@ Query the element for the current mime type </para> +<!-- ##### SIGNAL GstXML::object-loaded ##### --> +<para> + +</para> + +@gstxml: the object which received the signal. +@arg1: +@arg2: + <!-- ##### USER_FUNCTION GstXMLRegistryAddPathList ##### --> <para> diff --git a/docs/gst/tmpl/gstregistry.sgml b/docs/gst/tmpl/gstregistry.sgml index 4a600589eb..af8c1a1b6b 100644 --- a/docs/gst/tmpl/gstregistry.sgml +++ b/docs/gst/tmpl/gstregistry.sgml @@ -49,6 +49,7 @@ The registry object @loaded: @plugins: @paths: +@_gst_reserved: <!-- ##### FUNCTION gst_registry_load ##### --> <para> diff --git a/docs/gst/tmpl/gstthread.sgml b/docs/gst/tmpl/gstthread.sgml index 6d7021906d..38a7691b0a 100644 --- a/docs/gst/tmpl/gstthread.sgml +++ b/docs/gst/tmpl/gstthread.sgml @@ -34,15 +34,6 @@ The GstThread object </para> -<!-- ##### FUNCTION gst_thread_new ##### --> -<para> - -</para> - -@name: -@Returns: - - <!-- ##### SIGNAL GstThread::shutdown ##### --> <para> @@ -55,3 +46,12 @@ The GstThread object The thread priority </para> +<!-- ##### FUNCTION gst_thread_new ##### --> +<para> + +</para> + +@name: +@Returns: + + diff --git a/docs/gst/tmpl/gstxml.sgml b/docs/gst/tmpl/gstxml.sgml index 08450b21b9..ea4e4bd24a 100644 --- a/docs/gst/tmpl/gstxml.sgml +++ b/docs/gst/tmpl/gstxml.sgml @@ -105,25 +105,3 @@ All GstElements can be serialized to an XML presentation and subsequently loaded @Returns: -<!-- ##### SIGNAL GstXML::object-loaded ##### --> -<para> - -</para> - -@: -@: -@: - -@gstxml: the object which received the signal. -@arg1: -@arg2: - -<!-- ##### SIGNAL GstXML::object-loaded ##### --> -<para> - -</para> - -@gstxml: the object which received the signal. -@arg1: -@arg2: - diff --git a/gst/elements/gsttee.c b/gst/elements/gsttee.c index 363684edae..8b43435483 100644 --- a/gst/elements/gsttee.c +++ b/gst/elements/gsttee.c @@ -200,7 +200,7 @@ gst_tee_getcaps (GstPad *pad, GstCaps *filter) pads = gst_element_get_pad_list (GST_ELEMENT (tee)); while (pads) { - GstPad *srcpad = GST_PAD_CAST (pads->data); + GstPad *srcpad = GST_PAD (pads->data); GstPad *peer; GstCaps *peercaps; GstCaps *newcaps; diff --git a/gst/gstbin.h b/gst/gstbin.h index bff735f20d..3baa2e3a09 100644 --- a/gst/gstbin.h +++ b/gst/gstbin.h @@ -34,17 +34,8 @@ extern GType _gst_bin_type; #define GST_IS_BIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_BIN)) #define GST_IS_BIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_BIN)) #define GST_BIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_BIN, GstBinClass)) - -#define GST_BIN_CAST(obj) ((GstBin*)(obj)) -#define GST_BIN_CLASS_CAST(klass) ((GstBinClass*)(klass)) - -#ifdef GST_TYPE_PARANOID -# define GST_BIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_BIN, GstBin)) -# define GST_BIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_BIN, GstBinClass)) -#else -# define GST_BIN GST_BIN_CAST -# define GST_BIN_CLASS GST_BIN_CLASS_CAST -#endif +#define GST_BIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_BIN, GstBin)) +#define GST_BIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_BIN, GstBinClass)) typedef void (*GstBinPrePostIterateFunction) (GstBin *bin, gpointer user_data); diff --git a/gst/gstelement.c b/gst/gstelement.c index 5af2331f09..9b3ee2b0de 100644 --- a/gst/gstelement.c +++ b/gst/gstelement.c @@ -1866,7 +1866,7 @@ gst_element_unlink (GstElement *src, GstElement *dest) srcpads = gst_element_get_pad_list (src); while (srcpads) { - pad = GST_PAD_CAST (srcpads->data); + pad = GST_PAD (srcpads->data); /* we only care about real src pads */ if (GST_IS_REAL_PAD (pad) && GST_PAD_IS_SRC (pad)) { @@ -1908,7 +1908,7 @@ gst_element_get_random_pad (GstElement *element, GstPadDirection dir) GList *pads = element->pads; GST_CAT_DEBUG (GST_CAT_ELEMENT_PADS, "getting a random pad"); while (pads) { - GstPad *pad = GST_PAD_CAST (pads->data); + GstPad *pad = GST_PAD (pads->data); GST_CAT_DEBUG (GST_CAT_ELEMENT_PADS, "checking pad %s:%s", GST_DEBUG_PAD_NAME (pad)); @@ -2521,7 +2521,7 @@ gst_element_pads_activate (GstElement *element, gboolean active) GList *pads = element->pads; while (pads) { - GstPad *pad = GST_PAD_CAST (pads->data); + GstPad *pad = GST_PAD (pads->data); pads = g_list_next (pads); if (!GST_IS_REAL_PAD (pad)) @@ -3227,10 +3227,10 @@ gst_element_get_managing_bin (GstElement *element) g_return_val_if_fail (element != NULL, NULL); - bin = GST_BIN (gst_object_get_parent (GST_OBJECT_CAST (element))); + bin = GST_BIN (gst_object_get_parent (GST_OBJECT (element))); - while (bin && !GST_FLAG_IS_SET (GST_OBJECT_CAST (bin), GST_BIN_FLAG_MANAGER)) - bin = GST_BIN (gst_object_get_parent (GST_OBJECT_CAST (bin))); + while (bin && !GST_FLAG_IS_SET (GST_OBJECT (bin), GST_BIN_FLAG_MANAGER)) + bin = GST_BIN (gst_object_get_parent (GST_OBJECT (bin))); return bin; } diff --git a/gst/gstelement.h b/gst/gstelement.h index f4fff8b735..e9c1428310 100644 --- a/gst/gstelement.h +++ b/gst/gstelement.h @@ -73,20 +73,11 @@ struct _GstElementDetails { extern GType _gst_element_type; #define GST_TYPE_ELEMENT (_gst_element_type) - -#define GST_ELEMENT_CAST(obj) ((GstElement*)(obj)) -#define GST_ELEMENT_CLASS_CAST(klass) ((GstElementClass*)(klass)) #define GST_IS_ELEMENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_ELEMENT)) #define GST_IS_ELEMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_ELEMENT)) #define GST_ELEMENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_ELEMENT, GstElementClass)) - -#ifdef GST_TYPE_PARANOID -# define GST_ELEMENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_ELEMENT, GstElement)) -# define GST_ELEMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_ELEMENT, GstElementClass)) -#else -# define GST_ELEMENT GST_ELEMENT_CAST -# define GST_ELEMENT_CLASS GST_ELEMENT_CLASS_CAST -#endif +#define GST_ELEMENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_ELEMENT, GstElement)) +#define GST_ELEMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_ELEMENT, GstElementClass)) /* convenience functions */ #ifdef G_HAVE_ISO_VARARGS diff --git a/gst/gstobject.h b/gst/gstobject.h index 0cc5ddc5f6..5f62d8bb47 100644 --- a/gst/gstobject.h +++ b/gst/gstobject.h @@ -35,21 +35,12 @@ G_BEGIN_DECLS extern GType _gst_object_type; -#define GST_TYPE_OBJECT (_gst_object_type) -#define GST_IS_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_OBJECT)) -#define GST_IS_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_OBJECT)) -#define GST_OBJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_OBJECT, GstObjectClass)) - -#define GST_OBJECT_CAST(obj) ((GstObject*)(obj)) -#define GST_OBJECT_CLASS_CAST(klass) ((GstObjectClass*)(klass)) - -#ifdef GST_TYPE_PARANOID -# define GST_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_OBJECT, GstObject)) -# define GST_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_OBJECT, GstObjectClass)) -#else -# define GST_OBJECT GST_OBJECT_CAST -# define GST_OBJECT_CLASS GST_OBJECT_CLASS_CAST -#endif +#define GST_TYPE_OBJECT (_gst_object_type) +#define GST_IS_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_OBJECT)) +#define GST_IS_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_OBJECT)) +#define GST_OBJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_OBJECT, GstObjectClass)) +#define GST_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_OBJECT, GstObject)) +#define GST_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_OBJECT, GstObjectClass)) /* make sure we don't change the object size but stil make it compile * without libxml */ @@ -102,7 +93,7 @@ struct _GstObjectClass { gpointer _gst_reserved[GST_PADDING]; }; -#define GST_FLAGS(obj) (GST_OBJECT_CAST (obj)->flags) +#define GST_FLAGS(obj) (GST_OBJECT (obj)->flags) #define GST_FLAG_IS_SET(obj,flag) (GST_FLAGS (obj) & (1<<(flag))) #define GST_FLAG_SET(obj,flag) G_STMT_START{ (GST_FLAGS (obj) |= (1<<(flag))); }G_STMT_END #define GST_FLAG_UNSET(obj,flag) G_STMT_START{ (GST_FLAGS (obj) &= ~(1<<(flag))); }G_STMT_END @@ -114,10 +105,10 @@ struct _GstObjectClass { #define GST_OBJECT_FLOATING(obj) (GST_FLAG_IS_SET (obj, GST_FLOATING)) /* CR1: object locking - GObject 2.0 doesn't have threadsafe locking */ -#define GST_LOCK(obj) (g_mutex_lock(GST_OBJECT_CAST(obj)->lock)) -#define GST_TRYLOCK(obj) (g_mutex_trylock(GST_OBJECT_CAST(obj)->lock)) -#define GST_UNLOCK(obj) (g_mutex_unlock(GST_OBJECT_CAST(obj)->lock)) -#define GST_GET_LOCK(obj) (GST_OBJECT_CAST(obj)->lock) +#define GST_LOCK(obj) (g_mutex_lock(GST_OBJECT(obj)->lock)) +#define GST_TRYLOCK(obj) (g_mutex_trylock(GST_OBJECT(obj)->lock)) +#define GST_UNLOCK(obj) (g_mutex_unlock(GST_OBJECT(obj)->lock)) +#define GST_GET_LOCK(obj) (GST_OBJECT(obj)->lock) /* normal GObject stuff */ diff --git a/gst/gstpad.c b/gst/gstpad.c index b41899d139..1f13c210cb 100644 --- a/gst/gstpad.c +++ b/gst/gstpad.c @@ -558,7 +558,7 @@ gst_pad_get_event_masks (GstPad *pad) g_return_val_if_fail (rpad, FALSE); if (GST_RPAD_EVENTMASKFUNC (rpad)) - return GST_RPAD_EVENTMASKFUNC (rpad) (GST_PAD_CAST (pad)); + return GST_RPAD_EVENTMASKFUNC (rpad) (GST_PAD (pad)); return NULL; } @@ -671,7 +671,7 @@ gst_pad_get_query_types (GstPad *pad) g_return_val_if_fail (rpad, FALSE); if (GST_RPAD_QUERYTYPEFUNC (rpad)) - return GST_RPAD_QUERYTYPEFUNC (rpad) (GST_PAD_CAST (pad)); + return GST_RPAD_QUERYTYPEFUNC (rpad) (GST_PAD (pad)); return NULL; } @@ -863,15 +863,15 @@ gst_pad_unlink (GstPad *srcpad, (GST_RPAD_DIRECTION (realsink) == GST_PAD_SINK)); if (GST_RPAD_UNLINKFUNC (realsrc)) { - GST_RPAD_UNLINKFUNC (realsrc) (GST_PAD_CAST (realsrc)); + GST_RPAD_UNLINKFUNC (realsrc) (GST_PAD (realsrc)); } if (GST_RPAD_UNLINKFUNC (realsink)) { - GST_RPAD_UNLINKFUNC (realsink) (GST_PAD_CAST (realsink)); + GST_RPAD_UNLINKFUNC (realsink) (GST_PAD (realsink)); } /* get the schedulers before we unlink */ - src_sched = gst_pad_get_scheduler (GST_PAD_CAST (realsrc)); - sink_sched = gst_pad_get_scheduler (GST_PAD_CAST (realsink)); + src_sched = gst_pad_get_scheduler (GST_PAD (realsrc)); + sink_sched = gst_pad_get_scheduler (GST_PAD (realsink)); /* first clear peers */ GST_RPAD_PEER (realsrc) = NULL; @@ -886,8 +886,8 @@ gst_pad_unlink (GstPad *srcpad, /* now tell the scheduler */ if (src_sched && src_sched == sink_sched) { gst_scheduler_pad_unlink (src_sched, - GST_PAD_CAST (realsrc), - GST_PAD_CAST (realsink)); + GST_PAD (realsrc), + GST_PAD (realsink)); } /* hold a reference, as they can go away in the signal handlers */ @@ -914,8 +914,8 @@ gst_pad_check_schedulers (GstRealPad *realsrc, GstRealPad *realsink) GstScheduler *src_sched, *sink_sched; gint num_decoupled = 0; - src_sched = gst_pad_get_scheduler (GST_PAD_CAST (realsrc)); - sink_sched = gst_pad_get_scheduler (GST_PAD_CAST (realsink)); + src_sched = gst_pad_get_scheduler (GST_PAD (realsrc)); + sink_sched = gst_pad_get_scheduler (GST_PAD (realsink)); if (src_sched && sink_sched) { if (GST_FLAG_IS_SET (GST_PAD_PARENT (realsrc), GST_ELEMENT_DECOUPLED)) @@ -1095,13 +1095,13 @@ gst_pad_link_filtered (GstPad *srcpad, GstPad *sinkpad, GstCaps *filtercaps) g_signal_emit (G_OBJECT (realsink), gst_real_pad_signals[REAL_LINKED], 0, realsrc); - src_sched = gst_pad_get_scheduler (GST_PAD_CAST (realsrc)); - sink_sched = gst_pad_get_scheduler (GST_PAD_CAST (realsink)); + src_sched = gst_pad_get_scheduler (GST_PAD (realsrc)); + sink_sched = gst_pad_get_scheduler (GST_PAD (realsink)); /* now tell the scheduler */ if (src_sched && src_sched == sink_sched) { gst_scheduler_pad_link (src_sched, - GST_PAD_CAST (realsrc), GST_PAD_CAST (realsink)); + GST_PAD (realsrc), GST_PAD (realsink)); } else { GST_CAT_INFO (GST_CAT_PADS, "not telling link to scheduler %s:%s and %s:%s, %p %p", @@ -1219,7 +1219,7 @@ gst_pad_get_scheduler (GstPad *pad) GstRealPad *peer = GST_RPAD_PEER (pad); if (peer) { - scheduler = gst_element_get_scheduler (gst_pad_get_parent (GST_PAD_CAST (peer))); + scheduler = gst_element_get_scheduler (gst_pad_get_parent (GST_PAD (peer))); } } else { @@ -1344,7 +1344,7 @@ gst_pad_try_set_caps_func (GstRealPad *pad, GstCaps *caps, gboolean notify) * going to unref it later on */ if (!(allowed = gst_caps_ref (GST_RPAD_FILTER (pad)))) { /* no filter, make sure we check against the padtemplate then */ - if ((template = gst_pad_get_pad_template (GST_PAD_CAST (pad)))) { + if ((template = gst_pad_get_pad_template (GST_PAD (pad)))) { allowed = gst_pad_template_get_caps (template); } } @@ -1864,7 +1864,7 @@ gst_pad_get_caps (GstPad *pad) GstCaps *caps; GST_CAT_DEBUG (GST_CAT_CAPS, "using pad get function"); - caps = GST_RPAD_GETCAPSFUNC (realpad) (GST_PAD_CAST (realpad), NULL); + caps = GST_RPAD_GETCAPSFUNC (realpad) (GST_PAD (realpad), NULL); if(caps)g_return_val_if_fail(caps->refcount > 0, NULL); return caps; @@ -2344,7 +2344,7 @@ gst_pad_push (GstPad *pad, GstData *data) if (!gst_probe_dispatcher_dispatch (&peer->probedisp, &data)) return; - (peer->chainhandler) (GST_PAD_CAST (peer), data); + (peer->chainhandler) (GST_PAD (peer), data); return; } else { @@ -2398,7 +2398,7 @@ restart: GST_DEBUG_FUNCPTR_NAME (peer->gethandler), GST_DEBUG_PAD_NAME (peer)); - data = (peer->gethandler) (GST_PAD_CAST (peer)); + data = (peer->gethandler) (GST_PAD (peer)); if (data) { if (!gst_probe_dispatcher_dispatch (&peer->probedisp, &data)) @@ -2893,7 +2893,7 @@ gst_pad_get_internal_links (GstPad *pad) rpad = GST_PAD_REALIZE (pad); if (GST_RPAD_INTLINKFUNC (rpad)) - res = GST_RPAD_INTLINKFUNC (rpad) (GST_PAD_CAST (rpad)); + res = GST_RPAD_INTLINKFUNC (rpad) (GST_PAD (rpad)); return res; } @@ -2919,7 +2919,7 @@ gst_pad_event_default_dispatch (GstPad *pad, GstElement *element, gst_pad_push (eventpad, GST_DATA (event)); } else { - GstPad *peerpad = GST_PAD_CAST (GST_RPAD_PEER (eventpad)); + GstPad *peerpad = GST_PAD (GST_RPAD_PEER (eventpad)); /* we only send the event on one pad, multi-sinkpad elements * should implement a handler */ @@ -3004,7 +3004,7 @@ gst_pad_dispatcher (GstPad *pad, GstPadDispatcherFunction dispatch, GstRealPad *int_peer = GST_RPAD_PEER (int_rpad); if (int_peer) { - res = dispatch (GST_PAD_CAST (int_peer), data); + res = dispatch (GST_PAD (int_peer), data); if (res) break; } @@ -3043,7 +3043,7 @@ gst_pad_send_event (GstPad *pad, GstEvent *event) GST_EVENT_TYPE (event), GST_DEBUG_PAD_NAME (rpad)); if (GST_RPAD_EVENTHANDLER (rpad)) - success = GST_RPAD_EVENTHANDLER (rpad) (GST_PAD_CAST (rpad), event); + success = GST_RPAD_EVENTHANDLER (rpad) (GST_PAD (rpad), event); else { g_warning ("pad %s:%s has no event handler", GST_DEBUG_PAD_NAME (rpad)); gst_event_unref (event); @@ -3133,7 +3133,7 @@ gst_pad_convert (GstPad *pad, rpad = GST_PAD_REALIZE (pad); if (GST_RPAD_CONVERTFUNC (rpad)) { - return GST_RPAD_CONVERTFUNC (rpad) (GST_PAD_CAST (rpad), src_format, + return GST_RPAD_CONVERTFUNC (rpad) (GST_PAD (rpad), src_format, src_value, dest_format, dest_value); } @@ -3212,7 +3212,7 @@ gst_pad_query (GstPad *pad, GstQueryType type, g_return_val_if_fail (rpad, FALSE); if (GST_RPAD_QUERYFUNC (rpad)) - return GST_RPAD_QUERYFUNC (rpad) (GST_PAD_CAST (pad), type, format, value); + return GST_RPAD_QUERYFUNC (rpad) (GST_PAD (pad), type, format, value); return FALSE; } @@ -3262,7 +3262,7 @@ gst_pad_get_formats (GstPad *pad) rpad = GST_PAD_REALIZE (pad); if (GST_RPAD_FORMATSFUNC (rpad)) - return GST_RPAD_FORMATSFUNC (rpad) (GST_PAD_CAST (pad)); + return GST_RPAD_FORMATSFUNC (rpad) (GST_PAD (pad)); return NULL; } diff --git a/gst/gstpad.h b/gst/gstpad.h index e651d4b7e1..947ad5104e 100644 --- a/gst/gstpad.h +++ b/gst/gstpad.h @@ -40,65 +40,36 @@ extern GType _gst_pad_type; extern GType _gst_real_pad_type; extern GType _gst_ghost_pad_type; -#define GST_TYPE_PARANOID - /* * Pad base class */ #define GST_TYPE_PAD (_gst_pad_type) - -#define GST_PAD_CAST(obj) ((GstPad*)(obj)) -#define GST_PAD_CLASS_CAST(klass) ((GstPadClass*)(klass)) #define GST_IS_PAD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_PAD)) #define GST_IS_PAD_FAST(obj) (G_OBJECT_TYPE(obj) == GST_TYPE_REAL_PAD || \ G_OBJECT_TYPE(obj) == GST_TYPE_GHOST_PAD) #define GST_IS_PAD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_PAD)) - -#ifdef GST_TYPE_PARANOID -# define GST_PAD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_PAD, GstPad)) -# define GST_PAD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_PAD, GstPadClass)) -#else -# define GST_PAD GST_PAD_CAST -# define GST_PAD_CLASS GST_PAD_CLASS_CAST -#endif +#define GST_PAD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_PAD, GstPad)) +#define GST_PAD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_PAD, GstPadClass)) /* * Real Pads */ #define GST_TYPE_REAL_PAD (_gst_real_pad_type) - -#define GST_REAL_PAD_CAST(obj) ((GstRealPad*)(obj)) -#define GST_REAL_PAD_CLASS_CAST(klass) ((GstRealPadClass*)(klass)) #define GST_IS_REAL_PAD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_REAL_PAD)) #define GST_IS_REAL_PAD_FAST(obj) (G_OBJECT_TYPE(obj) == GST_TYPE_REAL_PAD) #define GST_IS_REAL_PAD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_REAL_PAD)) - -#ifdef GST_TYPE_PARANOID -# define GST_REAL_PAD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_REAL_PAD, GstRealPad)) -# define GST_REAL_PAD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_REAL_PAD, GstRealPadClass)) -#else -# define GST_REAL_PAD GST_REAL_PAD_CAST -# define GST_REAL_PAD_CLASS GST_REAL_PAD_CLASS_CAST -#endif +#define GST_REAL_PAD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_REAL_PAD, GstRealPad)) +#define GST_REAL_PAD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_REAL_PAD, GstRealPadClass)) /* * Ghost Pads */ #define GST_TYPE_GHOST_PAD (_gst_ghost_pad_type) - -#define GST_GHOST_PAD_CAST(obj) ((GstGhostPad*)(obj)) -#define GST_GHOST_PAD_CLASS_CAST(klass) ((GstGhostPadClass*)(klass)) #define GST_IS_GHOST_PAD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_GHOST_PAD)) #define GST_IS_GHOST_PAD_FAST(obj) (G_OBJECT_TYPE(obj) == GST_TYPE_GHOST_PAD) #define GST_IS_GHOST_PAD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_GHOST_PAD)) - -#ifdef GST_TYPE_PARANOID -# define GST_GHOST_PAD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_GHOST_PAD, GstGhostPad)) -# define GST_GHOST_PAD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_GHOST_PAD, GstGhostPadClass)) -#else -# define GST_GHOST_PAD GST_GHOST_PAD_CAST -# define GST_GHOST_PAD_CLASS GST_GHOST_PAD_CLASS_CAST -#endif +#define GST_GHOST_PAD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_GHOST_PAD, GstGhostPad)) +#define GST_GHOST_PAD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_GHOST_PAD, GstGhostPadClass)) /*typedef struct _GstPad GstPad; */ @@ -289,7 +260,7 @@ struct _GstGhostPadClass { #define GST_PAD_REALIZE(pad) (GST_IS_REAL_PAD(pad) ? ((GstRealPad *)(pad)) : GST_GPAD_REALPAD(pad)) #define GST_PAD_DIRECTION(pad) GST_RPAD_DIRECTION(GST_PAD_REALIZE(pad)) #define GST_PAD_CAPS(pad) GST_RPAD_CAPS(GST_PAD_REALIZE(pad)) -#define GST_PAD_PEER(pad) GST_PAD_CAST(GST_RPAD_PEER(GST_PAD_REALIZE(pad))) +#define GST_PAD_PEER(pad) GST_PAD(GST_RPAD_PEER(GST_PAD_REALIZE(pad))) /* Some check functions (unused?) */ #define GST_PAD_IS_LINKED(pad) (GST_PAD_PEER(pad) != NULL) diff --git a/gst/gstqueue.c b/gst/gstqueue.c index 61d5beb1d7..fc646bf371 100644 --- a/gst/gstqueue.c +++ b/gst/gstqueue.c @@ -671,8 +671,8 @@ gst_queue_change_state (GstElement *element) else { GstScheduler *src_sched, *sink_sched; - src_sched = gst_pad_get_scheduler (GST_PAD_CAST (queue->srcpad)); - sink_sched = gst_pad_get_scheduler (GST_PAD_CAST (queue->sinkpad)); + src_sched = gst_pad_get_scheduler (GST_PAD (queue->srcpad)); + sink_sched = gst_pad_get_scheduler (GST_PAD (queue->sinkpad)); if (src_sched == sink_sched) { GST_CAT_DEBUG_OBJECT (GST_CAT_STATES, queue, "queue %s does not connect different schedulers", diff --git a/gst/gstscheduler.c b/gst/gstscheduler.c index c829fab915..d194b67cb8 100644 --- a/gst/gstscheduler.c +++ b/gst/gstscheduler.c @@ -799,8 +799,14 @@ gst_scheduler_factory_class_init (GstSchedulerFactoryClass *klass) factory_parent_class = g_type_class_ref (GST_TYPE_PLUGIN_FEATURE); - if (!_default_name) - _default_name = g_strdup (GST_SCHEDULER_DEFAULT_NAME); + if (!_default_name) { + if (g_getenv ("GST_SCHEDULER")) { + _default_name = g_strdup (g_getenv ("GST_SCHEDULER")); + } else { + _default_name = g_strdup (GST_SCHEDULER_DEFAULT_NAME); + } + } + g_assert (_default_name); } static void diff --git a/gst/schedulers/gstbasicscheduler.c b/gst/schedulers/gstbasicscheduler.c index 70f844841c..574c5ac02e 100644 --- a/gst/schedulers/gstbasicscheduler.c +++ b/gst/schedulers/gstbasicscheduler.c @@ -34,8 +34,8 @@ GST_DEBUG_CATEGORY_STATIC(debug_scheduler); typedef struct _GstSchedulerChain GstSchedulerChain; -#define GST_ELEMENT_THREADSTATE(elem) (cothread*) (GST_ELEMENT_CAST (elem)->sched_private) -#define GST_RPAD_BUFPEN(pad) (GstData*) (GST_REAL_PAD_CAST(pad)->sched_private) +#define GST_ELEMENT_THREADSTATE(elem) (cothread*) (GST_ELEMENT (elem)->sched_private) +#define GST_RPAD_BUFPEN(pad) (GstData*) (GST_REAL_PAD(pad)->sched_private) #define GST_ELEMENT_COTHREAD_STOPPING GST_ELEMENT_SCHEDULER_PRIVATE1 #define GST_ELEMENT_IS_COTHREAD_STOPPING(element) GST_FLAG_IS_SET((element), GST_ELEMENT_COTHREAD_STOPPING) @@ -74,8 +74,7 @@ struct _GstSchedulerChain { #define GST_IS_BASIC_SCHEDULER_CLASS(obj) \ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_BASIC_SCHEDULER)) -#define GST_BASIC_SCHEDULER_CAST(sched) ((GstBasicScheduler *)(sched)) -#define SCHED(element) GST_BASIC_SCHEDULER_CAST (GST_ELEMENT_SCHED (element)) +#define SCHED(element) GST_BASIC_SCHEDULER (GST_ELEMENT_SCHED (element)) typedef enum { GST_BASIC_SCHEDULER_STATE_NONE, @@ -280,7 +279,7 @@ GST_PLUGIN_DEFINE ( static int gst_basic_scheduler_loopfunc_wrapper (int argc, char **argv) { - GstElement *element = GST_ELEMENT_CAST (argv); + GstElement *element = GST_ELEMENT (argv); G_GNUC_UNUSED const gchar *name = GST_ELEMENT_NAME (element); GST_DEBUG("entering loopfunc wrapper of %s", name); @@ -314,7 +313,7 @@ static int gst_basic_scheduler_chain_wrapper (int argc, char **argv) { GSList *already_iterated = NULL; - GstElement *element = GST_ELEMENT_CAST (argv); + GstElement *element = GST_ELEMENT (argv); G_GNUC_UNUSED const gchar *name = GST_ELEMENT_NAME (element); GST_DEBUG ("entered chain wrapper of element %s", name); @@ -386,7 +385,7 @@ gst_basic_scheduler_chain_wrapper (int argc, char **argv) static int gst_basic_scheduler_src_wrapper (int argc, char **argv) { - GstElement *element = GST_ELEMENT_CAST (argv); + GstElement *element = GST_ELEMENT (argv); GList *pads; GstRealPad *realpad; GstData *data = NULL; @@ -401,17 +400,17 @@ gst_basic_scheduler_src_wrapper (int argc, char **argv) if (!GST_IS_REAL_PAD (pads->data)) continue; - realpad = GST_REAL_PAD_CAST (pads->data); + realpad = GST_REAL_PAD (pads->data); pads = g_list_next (pads); if (GST_RPAD_DIRECTION (realpad) == GST_PAD_SRC && GST_PAD_IS_USABLE (realpad)) { GST_CAT_DEBUG (debug_dataflow, "calling _getfunc for %s:%s", GST_DEBUG_PAD_NAME (realpad)); g_return_val_if_fail (GST_RPAD_GETFUNC (realpad) != NULL, 0); - data = GST_RPAD_GETFUNC (realpad) (GST_PAD_CAST (realpad)); + data = GST_RPAD_GETFUNC (realpad) (GST_PAD (realpad)); if (data) { GST_CAT_DEBUG (debug_dataflow, "calling gst_pad_push on pad %s:%s %p", GST_DEBUG_PAD_NAME (realpad), data); - gst_pad_push (GST_PAD_CAST (realpad), data); + gst_pad_push (GST_PAD (realpad), data); } } } @@ -603,7 +602,7 @@ gst_basic_scheduler_cothreaded_chain (GstBin * bin, GstSchedulerChain * chain) while (elements) { gboolean decoupled; - element = GST_ELEMENT_CAST (elements->data); + element = GST_ELEMENT (elements->data); elements = g_list_next (elements); decoupled = GST_FLAG_IS_SET (element, GST_ELEMENT_DECOUPLED); @@ -649,7 +648,7 @@ gst_basic_scheduler_cothreaded_chain (GstBin * bin, GstSchedulerChain * chain) peerpad = GST_PAD_PEER (pad); if (peerpad) { - GstElement *peerelement = GST_ELEMENT_CAST (GST_PAD_PARENT (peerpad)); + GstElement *peerelement = GST_ELEMENT (GST_PAD_PARENT (peerpad)); gboolean different_sched = (peerelement->sched != GST_SCHEDULER (chain->sched)); gboolean peer_decoupled = GST_FLAG_IS_SET (peerelement, GST_ELEMENT_DECOUPLED); @@ -1042,9 +1041,9 @@ static void gst_basic_scheduler_setup (GstScheduler *sched) { /* first create thread context */ - if (GST_BASIC_SCHEDULER_CAST (sched)->context == NULL) { + if (GST_BASIC_SCHEDULER (sched)->context == NULL) { GST_DEBUG ("initializing cothread context"); - GST_BASIC_SCHEDULER_CAST (sched)->context = do_cothread_context_init (); + GST_BASIC_SCHEDULER (sched)->context = do_cothread_context_init (); } } @@ -1052,7 +1051,7 @@ static void gst_basic_scheduler_reset (GstScheduler *sched) { cothread_context *ctx; - GList *elements = GST_BASIC_SCHEDULER_CAST (sched)->elements; + GList *elements = GST_BASIC_SCHEDULER (sched)->elements; while (elements) { GstElement *element = GST_ELEMENT (elements->data); @@ -1063,11 +1062,11 @@ gst_basic_scheduler_reset (GstScheduler *sched) elements = g_list_next (elements); } - ctx = GST_BASIC_SCHEDULER_CAST (sched)->context; + ctx = GST_BASIC_SCHEDULER (sched)->context; do_cothread_context_destroy (ctx); - GST_BASIC_SCHEDULER_CAST (sched)->context = NULL; + GST_BASIC_SCHEDULER (sched)->context = NULL; } static void @@ -1261,8 +1260,8 @@ gst_basic_scheduler_pad_unlink (GstScheduler * sched, GstPad * srcpad, GstPad * GST_DEBUG_PAD_NAME (srcpad), GST_DEBUG_PAD_NAME (sinkpad)); /* we need to have the parent elements of each pad */ - element1 = GST_ELEMENT_CAST (GST_PAD_PARENT (srcpad)); - element2 = GST_ELEMENT_CAST (GST_PAD_PARENT (sinkpad)); + element1 = GST_ELEMENT (GST_PAD_PARENT (srcpad)); + element2 = GST_ELEMENT (GST_PAD_PARENT (sinkpad)); /* first task is to remove the old chain they belonged to. * this can be accomplished by taking either of the elements, @@ -1390,7 +1389,7 @@ gst_basic_scheduler_iterate (GstScheduler * sched) GST_DEBUG ("there are %d elements in this chain", chain->num_elements); elements = chain->elements; while (elements) { - entry = GST_ELEMENT_CAST (elements->data); + entry = GST_ELEMENT (elements->data); elements = g_list_next (elements); if (GST_FLAG_IS_SET (entry, GST_ELEMENT_DECOUPLED)) { GST_DEBUG ("entry \"%s\" is DECOUPLED, skipping", diff --git a/gst/schedulers/gstoptimalscheduler.c b/gst/schedulers/gstoptimalscheduler.c index dead50442e..ab6d4e98d8 100644 --- a/gst/schedulers/gstoptimalscheduler.c +++ b/gst/schedulers/gstoptimalscheduler.c @@ -36,9 +36,9 @@ GST_DEBUG_CATEGORY_STATIC(debug_scheduler); # define COTHREADS_NAME "" #endif -#define GST_ELEMENT_SCHED_CONTEXT(elem) ((GstOptSchedulerCtx*) (GST_ELEMENT_CAST (elem)->sched_private)) +#define GST_ELEMENT_SCHED_CONTEXT(elem) ((GstOptSchedulerCtx*) (GST_ELEMENT (elem)->sched_private)) #define GST_ELEMENT_SCHED_GROUP(elem) (GST_ELEMENT_SCHED_CONTEXT (elem)->group) -#define GST_PAD_BUFLIST(pad) ((GList*) (GST_REAL_PAD_CAST(pad)->sched_private)) +#define GST_PAD_BUFLIST(pad) ((GList*) (GST_REAL_PAD(pad)->sched_private)) #define GST_ELEMENT_COTHREAD_STOPPING GST_ELEMENT_SCHEDULER_PRIVATE1 #define GST_ELEMENT_IS_COTHREAD_STOPPING(element) GST_FLAG_IS_SET((element), GST_ELEMENT_COTHREAD_STOPPING) @@ -59,8 +59,6 @@ typedef struct _GstOptSchedulerClass GstOptSchedulerClass; #define GST_IS_OPT_SCHEDULER_CLASS(obj) \ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_OPT_SCHEDULER)) -#define GST_OPT_SCHEDULER_CAST(sched) ((GstOptScheduler *)(sched)) - typedef enum { GST_OPT_SCHEDULER_STATE_NONE, GST_OPT_SCHEDULER_STATE_STOPPED, @@ -953,7 +951,7 @@ get_group_schedule_function (int argc, char *argv[]) while (pads) { GstData *data; - GstPad *pad = GST_PAD_CAST (pads->data); + GstPad *pad = GST_PAD (pads->data); pads = g_list_next (pads); /* skip sinks and ghostpads */ @@ -1246,7 +1244,7 @@ setup_group_scheduler (GstOptScheduler *osched, GstOptSchedulerGroup *group) static GstElementStateReturn gst_opt_scheduler_state_transition (GstScheduler *sched, GstElement *element, gint transition) { - GstOptScheduler *osched = GST_OPT_SCHEDULER_CAST (sched); + GstOptScheduler *osched = GST_OPT_SCHEDULER (sched); GstOptSchedulerGroup *group; GstElementStateReturn res = GST_STATE_SUCCESS; @@ -1476,7 +1474,7 @@ static void gst_opt_scheduler_setup (GstScheduler *sched) { #ifdef USE_COTHREADS - GstOptScheduler *osched = GST_OPT_SCHEDULER_CAST (sched); + GstOptScheduler *osched = GST_OPT_SCHEDULER (sched); /* first create thread context */ if (osched->context == NULL) { @@ -1490,7 +1488,7 @@ static void gst_opt_scheduler_reset (GstScheduler *sched) { #ifdef USE_COTHREADS - GstOptScheduler *osched = GST_OPT_SCHEDULER_CAST (sched); + GstOptScheduler *osched = GST_OPT_SCHEDULER (sched); GSList *chains = osched->chains; while (chains) { @@ -1515,7 +1513,7 @@ gst_opt_scheduler_reset (GstScheduler *sched) static void gst_opt_scheduler_add_element (GstScheduler *sched, GstElement *element) { - GstOptScheduler *osched = GST_OPT_SCHEDULER_CAST (sched); + GstOptScheduler *osched = GST_OPT_SCHEDULER (sched); GstOptSchedulerCtx *ctx; const GList *pads; @@ -1583,14 +1581,14 @@ gst_opt_scheduler_remove_element (GstScheduler *sched, GstElement *element) static void gst_opt_scheduler_lock_element (GstScheduler *sched, GstElement *element) { - //GstOptScheduler *osched = GST_OPT_SCHEDULER_CAST (sched); + //GstOptScheduler *osched = GST_OPT_SCHEDULER (sched); g_warning ("lock element, implement me"); } static void gst_opt_scheduler_unlock_element (GstScheduler *sched, GstElement *element) { - //GstOptScheduler *osched = GST_OPT_SCHEDULER_CAST (sched); + //GstOptScheduler *osched = GST_OPT_SCHEDULER (sched); g_warning ("unlock element, implement me"); } @@ -1624,7 +1622,7 @@ gst_opt_scheduler_interrupt (GstScheduler *sched, GstElement *element) return FALSE; #else { - GstOptScheduler *osched = GST_OPT_SCHEDULER_CAST (sched); + GstOptScheduler *osched = GST_OPT_SCHEDULER (sched); GST_INFO ( "scheduler set interrupted state"); osched->state = GST_OPT_SCHEDULER_STATE_INTERRUPTED; @@ -1636,7 +1634,7 @@ gst_opt_scheduler_interrupt (GstScheduler *sched, GstElement *element) static void gst_opt_scheduler_error (GstScheduler *sched, GstElement *element) { - GstOptScheduler *osched = GST_OPT_SCHEDULER_CAST (sched); + GstOptScheduler *osched = GST_OPT_SCHEDULER (sched); GstOptSchedulerGroup *group; get_group (element, &group); if (group) @@ -1649,7 +1647,7 @@ gst_opt_scheduler_error (GstScheduler *sched, GstElement *element) static void gst_opt_scheduler_pad_link (GstScheduler *sched, GstPad *srcpad, GstPad *sinkpad) { - GstOptScheduler *osched = GST_OPT_SCHEDULER_CAST (sched); + GstOptScheduler *osched = GST_OPT_SCHEDULER (sched); LinkType type = GST_OPT_INVALID; GstElement *element1, *element2; @@ -1827,7 +1825,7 @@ element_has_link_with_group (GstElement *element, GstOptSchedulerGroup *group, G /* see if the element has no more links to the peer group */ pads = gst_element_get_pad_list (element); while (pads && !linked) { - GstPad *pad = GST_PAD_CAST (pads->data); + GstPad *pad = GST_PAD (pads->data); pads = g_list_next (pads); /* we only operate on real pads and on the pad that is not broken */ @@ -1915,7 +1913,7 @@ group_can_reach_group (GstOptSchedulerGroup *group, GstOptSchedulerGroup *target static void gst_opt_scheduler_pad_unlink (GstScheduler *sched, GstPad *srcpad, GstPad *sinkpad) { - GstOptScheduler *osched = GST_OPT_SCHEDULER_CAST (sched); + GstOptScheduler *osched = GST_OPT_SCHEDULER (sched); GstElement *element1, *element2; GstOptSchedulerGroup *group1, *group2; @@ -2039,7 +2037,7 @@ gst_opt_scheduler_pad_unlink (GstScheduler *sched, GstPad *srcpad, GstPad *sinkp static void gst_opt_scheduler_pad_select (GstScheduler *sched, GList *padlist) { - //GstOptScheduler *osched = GST_OPT_SCHEDULER_CAST (sched); + //GstOptScheduler *osched = GST_OPT_SCHEDULER (sched); g_warning ("pad select, implement me"); } @@ -2056,7 +2054,7 @@ static GstSchedulerState gst_opt_scheduler_iterate (GstScheduler *sched) { GstSchedulerState state = GST_SCHEDULER_STATE_STOPPED; - GstOptScheduler *osched = GST_OPT_SCHEDULER_CAST (sched); + GstOptScheduler *osched = GST_OPT_SCHEDULER (sched); gint iterations = osched->iterations; osched->state = GST_OPT_SCHEDULER_STATE_RUNNING; @@ -2120,7 +2118,7 @@ gst_opt_scheduler_iterate (GstScheduler *sched) static void gst_opt_scheduler_show (GstScheduler *sched) { - GstOptScheduler *osched = GST_OPT_SCHEDULER_CAST (sched); + GstOptScheduler *osched = GST_OPT_SCHEDULER (sched); GSList *chains; g_print ("iterations: %d\n", osched->iterations); @@ -2163,7 +2161,7 @@ gst_opt_scheduler_get_property (GObject *object, guint prop_id, g_return_if_fail (GST_IS_OPT_SCHEDULER (object)); - osched = GST_OPT_SCHEDULER_CAST (object); + osched = GST_OPT_SCHEDULER (object); switch (prop_id) { case ARG_ITERATIONS: @@ -2186,7 +2184,7 @@ gst_opt_scheduler_set_property (GObject *object, guint prop_id, g_return_if_fail (GST_IS_OPT_SCHEDULER (object)); - osched = GST_OPT_SCHEDULER_CAST (object); + osched = GST_OPT_SCHEDULER (object); switch (prop_id) { case ARG_ITERATIONS: diff --git a/plugins/elements/gstqueue.c b/plugins/elements/gstqueue.c index 61d5beb1d7..fc646bf371 100644 --- a/plugins/elements/gstqueue.c +++ b/plugins/elements/gstqueue.c @@ -671,8 +671,8 @@ gst_queue_change_state (GstElement *element) else { GstScheduler *src_sched, *sink_sched; - src_sched = gst_pad_get_scheduler (GST_PAD_CAST (queue->srcpad)); - sink_sched = gst_pad_get_scheduler (GST_PAD_CAST (queue->sinkpad)); + src_sched = gst_pad_get_scheduler (GST_PAD (queue->srcpad)); + sink_sched = gst_pad_get_scheduler (GST_PAD (queue->sinkpad)); if (src_sched == sink_sched) { GST_CAT_DEBUG_OBJECT (GST_CAT_STATES, queue, "queue %s does not connect different schedulers", diff --git a/plugins/elements/gsttee.c b/plugins/elements/gsttee.c index 363684edae..8b43435483 100644 --- a/plugins/elements/gsttee.c +++ b/plugins/elements/gsttee.c @@ -200,7 +200,7 @@ gst_tee_getcaps (GstPad *pad, GstCaps *filter) pads = gst_element_get_pad_list (GST_ELEMENT (tee)); while (pads) { - GstPad *srcpad = GST_PAD_CAST (pads->data); + GstPad *srcpad = GST_PAD (pads->data); GstPad *peer; GstCaps *peercaps; GstCaps *newcaps; |