From 45a34253acb4ec8d7842695fbce8a65128aa753f Mon Sep 17 00:00:00 2001 From: Thomas Vander Stichele Date: Sat, 7 Dec 2002 22:18:17 +0000 Subject: [PATCH] move these to macros Original commit message from CVS: move these to macros --- gst/gstelement.c | 72 -------------------------------------------------------- gst/gstelement.h | 11 ++++----- 2 files changed, 5 insertions(+), 78 deletions(-) diff --git a/gst/gstelement.c b/gst/gstelement.c index 0130a11..8e83b0f 100644 --- a/gst/gstelement.c +++ b/gst/gstelement.c @@ -669,78 +669,6 @@ gst_element_release_request_pad (GstElement *element, GstPad *pad) (oclass->release_pad) (element, pad); } - -/** - * gst_element_set_name: - * @element: a #GstElement to set the name of. - * @name: the new name of the element. - * - * Sets the name of the element, getting rid of the old name if there was - * one. - */ -void -gst_element_set_name (GstElement *element, const gchar *name) -{ - g_return_if_fail (element != NULL); - g_return_if_fail (GST_IS_ELEMENT (element)); - - gst_object_set_name (GST_OBJECT (element), name); -} - -/** - * gst_element_get_name: - * @element: a #GstElement to get the name of. - * - * Gets the name of the element. - * - * Returns: the name of the element. - */ -const gchar* -gst_element_get_name (GstElement *element) -{ - g_return_val_if_fail (element != NULL, NULL); - g_return_val_if_fail (GST_IS_ELEMENT (element), NULL); - - return GST_OBJECT_NAME (element); -} - -/** - * gst_element_set_parent: - * @element: a #GstElement to set parent of. - * @parent: the new #GstObject parent of the object. - * - * Sets the parent of the element. - */ -void -gst_element_set_parent (GstElement *element, GstObject *parent) -{ - g_return_if_fail (element != NULL); - g_return_if_fail (GST_IS_ELEMENT (element)); - g_return_if_fail (GST_OBJECT_PARENT (element) == NULL); - g_return_if_fail (parent != NULL); - g_return_if_fail (GST_IS_OBJECT (parent)); - g_return_if_fail ((gpointer)element != (gpointer)parent); - - gst_object_set_parent (GST_OBJECT (element), parent); -} - -/** - * gst_element_get_parent: - * @element: a #GstElement to get the parent of. - * - * Gets the parent of the element. - * - * Returns: the #GstObject parent of the element. - */ -GstObject* -gst_element_get_parent (GstElement *element) -{ - g_return_val_if_fail (element != NULL, NULL); - g_return_val_if_fail (GST_IS_ELEMENT (element), NULL); - - return GST_OBJECT_PARENT (element); -} - /** * gst_element_requires_clock: * @element: a #GstElement to query diff --git a/gst/gstelement.h b/gst/gstelement.h index c0f17f0..6e9e8d2 100644 --- a/gst/gstelement.h +++ b/gst/gstelement.h @@ -195,6 +195,11 @@ GType gst_element_get_type (void); void gst_element_set_loop_function (GstElement *element, GstElementLoopFunction loop); +#define gst_element_get_name(elem) gst_object_get_name(GST_OBJECT(elem)) +#define gst_element_set_name(element,name) gst_object_set_name(GST_OBJECT(elem),name) +#define gst_element_get_parent(elem) gst_object_get_parent(GST_OBJECT(elem)) +#define gst_element_set_parent(element,parent) gst_object_set_parent(GST_OBJECT(elem),parent) + /* threadsafe versions of their g_object_* counterparts */ void gst_element_set (GstElement *element, const gchar *first_property_name, ...); void gst_element_get (GstElement *element, const gchar *first_property_name, ...); @@ -211,12 +216,6 @@ void gst_element_enable_threadsafe_properties (GstElement *element); void gst_element_disable_threadsafe_properties (GstElement *element); void gst_element_set_pending_properties (GstElement *element); -void gst_element_set_name (GstElement *element, const gchar *name); -const gchar* gst_element_get_name (GstElement *element); - -void gst_element_set_parent (GstElement *element, GstObject *parent); -GstObject* gst_element_get_parent (GstElement *element); - /* clocking */ gboolean gst_element_requires_clock (GstElement *element); gboolean gst_element_provides_clock (GstElement *element); -- 2.7.4