Lines Matching refs:object
119 static void gst_object_set_property (GObject * object, guint prop_id,
121 static void gst_object_get_property (GObject * object, guint prop_id,
124 static void gst_object_dispatch_properties_changed (GObject * object,
127 static void gst_object_dispose (GObject * object);
128 static void gst_object_finalize (GObject * object);
130 static gboolean gst_object_set_name_default (GstObject * object);
139 gst_object_constructed (GObject * object) in gst_object_constructed() argument
141 GST_TRACER_OBJECT_CREATED (GST_OBJECT_CAST (object)); in gst_object_constructed()
143 ((GObjectClass *) gst_object_parent_class)->constructed (object); in gst_object_constructed()
203 gst_object_init (GstObject * object) in gst_object_init() argument
205 g_mutex_init (&object->lock); in gst_object_init()
206 object->parent = NULL; in gst_object_init()
207 object->name = NULL; in gst_object_init()
208 GST_CAT_TRACE_OBJECT (GST_CAT_REFCOUNTING, object, "%p new", object); in gst_object_init()
210 object->flags = 0; in gst_object_init()
212 object->control_rate = 100 * GST_MSECOND; in gst_object_init()
213 object->last_sync = GST_CLOCK_TIME_NONE; in gst_object_init()
231 gst_object_ref (gpointer object) in gst_object_ref() argument
233 g_return_val_if_fail (object != NULL, NULL); in gst_object_ref()
235 GST_TRACER_OBJECT_REFFED (object, ((GObject *) object)->ref_count + 1); in gst_object_ref()
237 GST_CAT_TRACE_OBJECT (GST_CAT_REFCOUNTING, object, "%p ref %d->%d", object, in gst_object_ref()
238 ((GObject *) object)->ref_count, ((GObject *) object)->ref_count + 1); in gst_object_ref()
240 g_object_ref (object); in gst_object_ref()
242 return object; in gst_object_ref()
257 gst_object_unref (gpointer object) in gst_object_unref() argument
259 g_return_if_fail (object != NULL); in gst_object_unref()
260 g_return_if_fail (((GObject *) object)->ref_count > 0); in gst_object_unref()
262 GST_TRACER_OBJECT_UNREFFED (object, ((GObject *) object)->ref_count - 1); in gst_object_unref()
264 GST_CAT_TRACE_OBJECT (GST_CAT_REFCOUNTING, object, "%p unref %d->%d", object, in gst_object_unref()
265 ((GObject *) object)->ref_count, ((GObject *) object)->ref_count - 1); in gst_object_unref()
267 g_object_unref (object); in gst_object_unref()
287 gst_object_ref_sink (gpointer object) in gst_object_ref_sink() argument
289 g_return_val_if_fail (object != NULL, NULL); in gst_object_ref_sink()
292 GST_CAT_TRACE_OBJECT (GST_CAT_REFCOUNTING, object, "%p ref_sink %d->%d", in gst_object_ref_sink()
293 object, ((GObject *) object)->ref_count, in gst_object_ref_sink()
294 ((GObject *) object)->ref_count + 1); in gst_object_ref_sink()
296 return g_object_ref_sink (object); in gst_object_ref_sink()
376 gst_object_dispose (GObject * object) in gst_object_dispose() argument
378 GstObject *self = (GstObject *) object; in gst_object_dispose()
381 GST_CAT_TRACE_OBJECT (GST_CAT_REFCOUNTING, object, "%p dispose", object); in gst_object_dispose()
383 GST_OBJECT_LOCK (object); in gst_object_dispose()
384 if ((parent = GST_OBJECT_PARENT (object))) in gst_object_dispose()
386 GST_OBJECT_PARENT (object) = NULL; in gst_object_dispose()
387 GST_OBJECT_UNLOCK (object); in gst_object_dispose()
399 ((GObjectClass *) gst_object_parent_class)->dispose (object); in gst_object_dispose()
409 GST_OBJECT_NAME (object), GST_OBJECT_NAME (parent)); in gst_object_dispose()
410 GST_OBJECT_UNLOCK (object); in gst_object_dispose()
412 gst_object_ref (object); in gst_object_dispose()
419 gst_object_finalize (GObject * object) in gst_object_finalize() argument
421 GstObject *gstobject = GST_OBJECT_CAST (object); in gst_object_finalize()
423 GST_CAT_TRACE_OBJECT (GST_CAT_REFCOUNTING, object, "%p finalize", object); in gst_object_finalize()
425 g_signal_handlers_destroy (object); in gst_object_finalize()
432 ((GObjectClass *) gst_object_parent_class)->finalize (object); in gst_object_finalize()
444 gst_object_dispatch_properties_changed (GObject * object, in gst_object_dispatch_properties_changed() argument
456 gst_object_parent_class)->dispatch_properties_changed (object, n_pspecs, in gst_object_dispatch_properties_changed()
459 gst_object = GST_OBJECT_CAST (object); in gst_object_dispatch_properties_changed()
506 gst_object_default_deep_notify (GObject * object, GstObject * orig, in gst_object_default_deep_notify() argument
540 gst_object_set_name_default (GstObject * object) in gst_object_set_name_default() argument
556 q = g_type_qname (G_OBJECT_TYPE (object)); in gst_object_set_name_default()
578 GST_OBJECT_LOCK (object); in gst_object_set_name_default()
579 if (G_UNLIKELY (object->parent != NULL)) in gst_object_set_name_default()
582 g_free (object->name); in gst_object_set_name_default()
583 object->name = name; in gst_object_set_name_default()
585 GST_OBJECT_UNLOCK (object); in gst_object_set_name_default()
593 GST_OBJECT_UNLOCK (object); in gst_object_set_name_default()
599 gst_object_set_name_intern (GstObject * object, const gchar * name) in gst_object_set_name_intern() argument
603 GST_OBJECT_LOCK (object); in gst_object_set_name_intern()
606 if (G_UNLIKELY (object->parent != NULL)) in gst_object_set_name_intern()
610 g_free (object->name); in gst_object_set_name_intern()
611 object->name = g_strdup (name); in gst_object_set_name_intern()
612 GST_OBJECT_UNLOCK (object); in gst_object_set_name_intern()
615 GST_OBJECT_UNLOCK (object); in gst_object_set_name_intern()
616 result = gst_object_set_name_default (object); in gst_object_set_name_intern()
625 GST_OBJECT_UNLOCK (object); in gst_object_set_name_intern()
647 gst_object_set_name (GstObject * object, const gchar * name) in gst_object_set_name() argument
651 g_return_val_if_fail (GST_IS_OBJECT (object), FALSE); in gst_object_set_name()
653 if ((result = gst_object_set_name_intern (object, name))) in gst_object_set_name()
654 g_object_notify_by_pspec (G_OBJECT (object), properties[PROP_NAME]); in gst_object_set_name()
675 gst_object_get_name (GstObject * object) in gst_object_get_name() argument
679 g_return_val_if_fail (GST_IS_OBJECT (object), NULL); in gst_object_get_name()
681 GST_OBJECT_LOCK (object); in gst_object_get_name()
682 result = g_strdup (object->name); in gst_object_get_name()
683 GST_OBJECT_UNLOCK (object); in gst_object_get_name()
702 gst_object_set_parent (GstObject * object, GstObject * parent) in gst_object_set_parent() argument
704 g_return_val_if_fail (GST_IS_OBJECT (object), FALSE); in gst_object_set_parent()
706 g_return_val_if_fail (object != parent, FALSE); in gst_object_set_parent()
708 GST_CAT_DEBUG_OBJECT (GST_CAT_REFCOUNTING, object, in gst_object_set_parent()
711 GST_OBJECT_LOCK (object); in gst_object_set_parent()
712 if (G_UNLIKELY (object->parent != NULL)) in gst_object_set_parent()
715 object->parent = parent; in gst_object_set_parent()
716 gst_object_ref_sink (object); in gst_object_set_parent()
717 GST_OBJECT_UNLOCK (object); in gst_object_set_parent()
731 GST_CAT_DEBUG_OBJECT (GST_CAT_REFCOUNTING, object, in gst_object_set_parent()
733 gst_object_ref_sink (object); in gst_object_set_parent()
734 gst_object_unref (object); in gst_object_set_parent()
735 GST_OBJECT_UNLOCK (object); in gst_object_set_parent()
753 gst_object_get_parent (GstObject * object) in gst_object_get_parent() argument
757 g_return_val_if_fail (GST_IS_OBJECT (object), NULL); in gst_object_get_parent()
759 GST_OBJECT_LOCK (object); in gst_object_get_parent()
760 result = object->parent; in gst_object_get_parent()
763 GST_OBJECT_UNLOCK (object); in gst_object_get_parent()
778 gst_object_unparent (GstObject * object) in gst_object_unparent() argument
782 g_return_if_fail (GST_IS_OBJECT (object)); in gst_object_unparent()
784 GST_OBJECT_LOCK (object); in gst_object_unparent()
785 parent = object->parent; in gst_object_unparent()
788 GST_CAT_TRACE_OBJECT (GST_CAT_REFCOUNTING, object, "unparent"); in gst_object_unparent()
789 object->parent = NULL; in gst_object_unparent()
790 GST_OBJECT_UNLOCK (object); in gst_object_unparent()
794 gst_object_unref (object); in gst_object_unparent()
796 GST_OBJECT_UNLOCK (object); in gst_object_unparent()
815 gst_object_has_as_parent (GstObject * object, GstObject * parent) in gst_object_has_as_parent() argument
819 if (G_LIKELY (GST_IS_OBJECT (object) && GST_IS_OBJECT (parent))) { in gst_object_has_as_parent()
820 GST_OBJECT_LOCK (object); in gst_object_has_as_parent()
821 result = GST_OBJECT_PARENT (object) == parent; in gst_object_has_as_parent()
822 GST_OBJECT_UNLOCK (object); in gst_object_has_as_parent()
841 gst_object_has_as_ancestor (GstObject * object, GstObject * ancestor) in gst_object_has_as_ancestor() argument
845 if (!ancestor || !object) in gst_object_has_as_ancestor()
848 parent = gst_object_ref (object); in gst_object_has_as_ancestor()
879 gst_object_has_ancestor (GstObject * object, GstObject * ancestor) in gst_object_has_ancestor() argument
881 return gst_object_has_as_ancestor (object, ancestor); in gst_object_has_ancestor()
929 gst_object_set_property (GObject * object, guint prop_id, in gst_object_set_property() argument
934 gstobject = GST_OBJECT_CAST (object); in gst_object_set_property()
944 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); in gst_object_set_property()
950 gst_object_get_property (GObject * object, guint prop_id, in gst_object_get_property() argument
955 gstobject = GST_OBJECT_CAST (object); in gst_object_get_property()
965 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); in gst_object_get_property()
986 gst_object_get_path_string (GstObject * object) in gst_object_get_path_string() argument
997 gst_object_ref (object); in gst_object_get_path_string()
998 parentage = g_slist_prepend (NULL, object); in gst_object_get_path_string()
1005 if (GST_IS_OBJECT (object)) { in gst_object_get_path_string()
1006 parent = gst_object_get_parent (object); in gst_object_get_path_string()
1014 object = parent; in gst_object_get_path_string()
1015 } while (object != NULL); in gst_object_get_path_string()
1100 gst_object_suggest_next_sync (GstObject * object) in gst_object_suggest_next_sync() argument
1104 g_return_val_if_fail (GST_IS_OBJECT (object), GST_CLOCK_TIME_NONE); in gst_object_suggest_next_sync()
1105 g_return_val_if_fail (object->control_rate != GST_CLOCK_TIME_NONE, in gst_object_suggest_next_sync()
1108 GST_OBJECT_LOCK (object); in gst_object_suggest_next_sync()
1114 ret = object->last_sync + object->control_rate; in gst_object_suggest_next_sync()
1116 GST_OBJECT_UNLOCK (object); in gst_object_suggest_next_sync()
1136 gst_object_sync_values (GstObject * object, GstClockTime timestamp) in gst_object_sync_values() argument
1141 g_return_val_if_fail (GST_IS_OBJECT (object), FALSE); in gst_object_sync_values()
1144 GST_LOG_OBJECT (object, "sync_values"); in gst_object_sync_values()
1145 if (!object->control_bindings) in gst_object_sync_values()
1150 g_object_freeze_notify ((GObject *) object); in gst_object_sync_values()
1151 for (node = object->control_bindings; node; node = g_list_next (node)) { in gst_object_sync_values()
1153 object, timestamp, object->last_sync); in gst_object_sync_values()
1155 object->last_sync = timestamp; in gst_object_sync_values()
1156 g_object_thaw_notify ((GObject *) object); in gst_object_sync_values()
1172 gst_object_has_active_control_bindings (GstObject * object) in gst_object_has_active_control_bindings() argument
1177 g_return_val_if_fail (GST_IS_OBJECT (object), FALSE); in gst_object_has_active_control_bindings()
1179 GST_OBJECT_LOCK (object); in gst_object_has_active_control_bindings()
1180 for (node = object->control_bindings; node; node = g_list_next (node)) { in gst_object_has_active_control_bindings()
1183 GST_OBJECT_UNLOCK (object); in gst_object_has_active_control_bindings()
1197 gst_object_set_control_bindings_disabled (GstObject * object, gboolean disabled) in gst_object_set_control_bindings_disabled() argument
1201 g_return_if_fail (GST_IS_OBJECT (object)); in gst_object_set_control_bindings_disabled()
1203 GST_OBJECT_LOCK (object); in gst_object_set_control_bindings_disabled()
1204 for (node = object->control_bindings; node; node = g_list_next (node)) { in gst_object_set_control_bindings_disabled()
1208 GST_OBJECT_UNLOCK (object); in gst_object_set_control_bindings_disabled()
1223 gst_object_set_control_binding_disabled (GstObject * object, in gst_object_set_control_binding_disabled() argument
1228 g_return_if_fail (GST_IS_OBJECT (object)); in gst_object_set_control_binding_disabled()
1231 GST_OBJECT_LOCK (object); in gst_object_set_control_binding_disabled()
1232 if ((binding = gst_object_find_control_binding (object, property_name))) { in gst_object_set_control_binding_disabled()
1235 GST_OBJECT_UNLOCK (object); in gst_object_set_control_binding_disabled()
1254 gst_object_add_control_binding (GstObject * object, GstControlBinding * binding) in gst_object_add_control_binding() argument
1258 g_return_val_if_fail (GST_IS_OBJECT (object), FALSE); in gst_object_add_control_binding()
1262 GST_OBJECT_LOCK (object); in gst_object_add_control_binding()
1263 if ((old = gst_object_find_control_binding (object, binding->name))) { in gst_object_add_control_binding()
1264 GST_DEBUG_OBJECT (object, "controlled property %s removed", old->name); in gst_object_add_control_binding()
1265 object->control_bindings = g_list_remove (object->control_bindings, old); in gst_object_add_control_binding()
1268 object->control_bindings = g_list_prepend (object->control_bindings, binding); in gst_object_add_control_binding()
1269 gst_object_set_parent (GST_OBJECT_CAST (binding), object); in gst_object_add_control_binding()
1270 GST_DEBUG_OBJECT (object, "controlled property %s added", binding->name); in gst_object_add_control_binding()
1271 GST_OBJECT_UNLOCK (object); in gst_object_add_control_binding()
1288 gst_object_get_control_binding (GstObject * object, const gchar * property_name) in gst_object_get_control_binding() argument
1292 g_return_val_if_fail (GST_IS_OBJECT (object), NULL); in gst_object_get_control_binding()
1295 GST_OBJECT_LOCK (object); in gst_object_get_control_binding()
1296 if ((binding = gst_object_find_control_binding (object, property_name))) { in gst_object_get_control_binding()
1299 GST_OBJECT_UNLOCK (object); in gst_object_get_control_binding()
1315 gst_object_remove_control_binding (GstObject * object, in gst_object_remove_control_binding() argument
1321 g_return_val_if_fail (GST_IS_OBJECT (object), FALSE); in gst_object_remove_control_binding()
1324 GST_OBJECT_LOCK (object); in gst_object_remove_control_binding()
1325 if ((node = g_list_find (object->control_bindings, binding))) { in gst_object_remove_control_binding()
1326 GST_DEBUG_OBJECT (object, "controlled property %s removed", binding->name); in gst_object_remove_control_binding()
1327 object->control_bindings = in gst_object_remove_control_binding()
1328 g_list_delete_link (object->control_bindings, node); in gst_object_remove_control_binding()
1332 GST_OBJECT_UNLOCK (object); in gst_object_remove_control_binding()
1349 gst_object_get_value (GstObject * object, const gchar * property_name, in gst_object_get_value() argument
1355 g_return_val_if_fail (GST_IS_OBJECT (object), NULL); in gst_object_get_value()
1359 GST_OBJECT_LOCK (object); in gst_object_get_value()
1360 if ((binding = gst_object_find_control_binding (object, property_name))) { in gst_object_get_value()
1363 GST_OBJECT_UNLOCK (object); in gst_object_get_value()
1391 gst_object_get_value_array (GstObject * object, const gchar * property_name, in gst_object_get_value_array() argument
1398 g_return_val_if_fail (GST_IS_OBJECT (object), FALSE); in gst_object_get_value_array()
1404 GST_OBJECT_LOCK (object); in gst_object_get_value_array()
1405 if ((binding = gst_object_find_control_binding (object, property_name))) { in gst_object_get_value_array()
1409 GST_OBJECT_UNLOCK (object); in gst_object_get_value_array()
1432 gst_object_get_g_value_array (GstObject * object, const gchar * property_name, in gst_object_get_g_value_array() argument
1439 g_return_val_if_fail (GST_IS_OBJECT (object), FALSE); in gst_object_get_g_value_array()
1445 GST_OBJECT_LOCK (object); in gst_object_get_g_value_array()
1446 if ((binding = gst_object_find_control_binding (object, property_name))) { in gst_object_get_g_value_array()
1450 GST_OBJECT_UNLOCK (object); in gst_object_get_g_value_array()
1473 gst_object_get_control_rate (GstObject * object) in gst_object_get_control_rate() argument
1475 g_return_val_if_fail (GST_IS_OBJECT (object), FALSE); in gst_object_get_control_rate()
1477 return object->control_rate; in gst_object_get_control_rate()
1494 gst_object_set_control_rate (GstObject * object, GstClockTime control_rate) in gst_object_set_control_rate() argument
1496 g_return_if_fail (GST_IS_OBJECT (object)); in gst_object_set_control_rate()
1498 object->control_rate = control_rate; in gst_object_set_control_rate()