X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=gst%2Fgstobject.h;h=fe5d95d7353f4a911558ee273ad48cbaff37f374;hb=ce4698487e2650ee9b365d6cf41a254483349bc0;hp=5c15065798e6111b80ce8801a35512c0546d5f33;hpb=9c0d8ca71863814e6233740d3b1cb2eccfd1f3d1;p=platform%2Fupstream%2Fgstreamer.git diff --git a/gst/gstobject.h b/gst/gstobject.h index 5c15065..fe5d95d 100644 --- a/gst/gstobject.h +++ b/gst/gstobject.h @@ -17,8 +17,8 @@ * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef __GST_OBJECT_H__ @@ -41,12 +41,16 @@ G_BEGIN_DECLS /** * GstObjectFlags: + * @GST_OBJECT_FLAG_MAY_BE_LEAKED: the object is expected to stay alive even + * after gst_deinit() has been called and so should be ignored by leak + * detection tools. (Since 1.10) * @GST_OBJECT_FLAG_LAST: subclasses can add additional flags starting from this flag * * The standard flags that an gstobject may have. */ typedef enum { + GST_OBJECT_FLAG_MAY_BE_LEAKED = (1 << 0), /* padding */ GST_OBJECT_FLAG_LAST = (1<<4) } GstObjectFlags; @@ -75,7 +79,7 @@ typedef enum * * Acquire a reference to the mutex of this object. */ -#define GST_OBJECT_GET_LOCK(obj) (GST_OBJECT_CAST(obj)->lock) +#define GST_OBJECT_GET_LOCK(obj) (&GST_OBJECT_CAST(obj)->lock) /** * GST_OBJECT_LOCK: * @obj: a #GstObject to lock @@ -89,7 +93,7 @@ typedef enum * @obj: a #GstObject. * * This macro will try to obtain a lock on the object, but will return with - * FALSE if it can't get it immediately. + * %FALSE if it can't get it immediately. */ #define GST_OBJECT_TRYLOCK(obj) g_mutex_trylock(GST_OBJECT_GET_LOCK(obj)) /** @@ -105,14 +109,18 @@ typedef enum * GST_OBJECT_NAME: * @obj: a #GstObject * - * Get the name of this object + * Get the name of this object. This is not thread-safe by default + * (i.e. you will have to make sure the object lock is taken yourself). + * If in doubt use gst_object_get_name() instead. */ #define GST_OBJECT_NAME(obj) (GST_OBJECT_CAST(obj)->name) /** * GST_OBJECT_PARENT: * @obj: a #GstObject * - * Get the parent of this object + * Get the parent of this object. This is not thread-safe by default + * (i.e. you will have to make sure the object lock is taken yourself). + * If in doubt use gst_object_get_parent() instead. */ #define GST_OBJECT_PARENT(obj) (GST_OBJECT_CAST(obj)->parent) @@ -145,7 +153,7 @@ typedef enum * @obj: a #GstObject * @flag: Flag to set * - * This macro usets the given bits. + * This macro unsets the given bits. */ #define GST_OBJECT_FLAG_UNSET(obj,flag) (GST_OBJECT_FLAGS (obj) &= ~(flag)) @@ -165,13 +173,16 @@ struct _GstObject { GInitiallyUnowned object; /*< public >*/ /* with LOCK */ - GMutex *lock; /* object LOCK */ + GMutex lock; /* object LOCK */ gchar *name; /* object name */ GstObject *parent; /* this object's parent, weak ref */ guint32 flags; /*< private >*/ - gpointer ctrl; /* time controlled properties */ + GList *control_bindings; /* List of GstControlBinding */ + guint64 control_rate; + guint64 last_sync; + gpointer _gst_reserved; }; @@ -199,58 +210,119 @@ struct _GstObjectClass { }; /* normal GObject stuff */ + +GST_API GType gst_object_get_type (void); /* name routines */ + +GST_API gboolean gst_object_set_name (GstObject *object, const gchar *name); + +GST_API gchar* gst_object_get_name (GstObject *object); /* parentage routines */ + +GST_API gboolean gst_object_set_parent (GstObject *object, GstObject *parent); + +GST_API GstObject* gst_object_get_parent (GstObject *object); + +GST_API void gst_object_unparent (GstObject *object); + +GST_API +gboolean gst_object_has_as_parent (GstObject *object, GstObject *parent); + +GST_API +gboolean gst_object_has_as_ancestor (GstObject *object, GstObject *ancestor); + +GST_DEPRECATED_FOR(gst_object_has_as_ancestor) gboolean gst_object_has_ancestor (GstObject *object, GstObject *ancestor); +GST_API void gst_object_default_deep_notify (GObject *object, GstObject *orig, GParamSpec *pspec, gchar **excluded_props); /* refcounting + life cycle */ + +GST_API gpointer gst_object_ref (gpointer object); + +GST_API void gst_object_unref (gpointer object); + +GST_API gpointer gst_object_ref_sink (gpointer object); /* replace object pointer */ + +GST_API gboolean gst_object_replace (GstObject **oldobj, GstObject *newobj); /* printing out the 'path' of the object */ + +GST_API gchar * gst_object_get_path_string (GstObject *object); /* misc utils */ + +GST_API gboolean gst_object_check_uniqueness (GList *list, const gchar *name); /* controller functions */ -#include +#include #include -gboolean gst_object_control_properties (GstObject * object, ...) G_GNUC_NULL_TERMINATED; -gboolean gst_object_uncontrol_properties (GstObject * object, ...) G_GNUC_NULL_TERMINATED; - -GstClockTime gst_object_suggest_next_sync (GstObject * object); -gboolean gst_object_sync_values (GstObject * object, GstClockTime timestamp); - -gboolean gst_object_has_active_automation (GstObject *object); -void gst_object_set_automation_disabled (GstObject *object, gboolean disabled); -void gst_object_set_property_automation_disabled (GstObject *object, const gchar * property_name, gboolean disabled); - -gboolean gst_object_set_control_source (GstObject *object, const gchar * property_name, GstControlSource *csource); -GstControlSource * gst_object_get_control_source (GstObject *object, const gchar * property_name); - -GValue *gst_object_get_value (GstObject * object, const gchar * property_name, GstClockTime timestamp); -gboolean gst_object_get_value_arrays (GstObject * object, GstClockTime timestamp, GSList * value_arrays); -gboolean gst_object_get_value_array (GstObject * object, GstClockTime timestamp, GstValueArray * value_array); - -GstClockTime gst_object_get_control_rate (GstObject * object); -void gst_object_set_control_rate (GstObject * object, GstClockTime control_rate); +GST_API +GstClockTime gst_object_suggest_next_sync (GstObject * object); + +GST_API +gboolean gst_object_sync_values (GstObject * object, GstClockTime timestamp); + +GST_API +gboolean gst_object_has_active_control_bindings (GstObject *object); + +GST_API +void gst_object_set_control_bindings_disabled (GstObject *object, gboolean disabled); + +GST_API +void gst_object_set_control_binding_disabled (GstObject *object, + const gchar * property_name, + gboolean disabled); + +GST_API +gboolean gst_object_add_control_binding (GstObject * object, GstControlBinding * binding); + +GST_API +GstControlBinding * + gst_object_get_control_binding (GstObject *object, const gchar * property_name); + +GST_API +gboolean gst_object_remove_control_binding (GstObject * object, GstControlBinding * binding); + +GST_API +GValue * gst_object_get_value (GstObject * object, const gchar * property_name, + GstClockTime timestamp); +GST_API +gboolean gst_object_get_value_array (GstObject * object, const gchar * property_name, + GstClockTime timestamp, GstClockTime interval, + guint n_values, gpointer values); +GST_API +gboolean gst_object_get_g_value_array (GstObject * object, const gchar * property_name, + GstClockTime timestamp, GstClockTime interval, + guint n_values, GValue *values); +GST_API +GstClockTime gst_object_get_control_rate (GstObject * object); + +GST_API +void gst_object_set_control_rate (GstObject * object, GstClockTime control_rate); + +#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC +G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstObject, gst_object_unref) +#endif G_END_DECLS