if (G_UNLIKELY (bclass->add_element == NULL))
goto no_function;
+#ifndef GST_TIZEN_TV
GST_CAT_DEBUG (GST_CAT_PARENTAGE, "adding element %s to bin %s",
GST_STR_NULL (GST_ELEMENT_NAME (element)),
GST_STR_NULL (GST_ELEMENT_NAME (bin)));
+#else
+ gst_set_family_id_to_child (element, (GST_OBJECT_CAST (bin)->family_id));
+
+ GST_CAT_DEBUG (GST_CAT_PARENTAGE,
+ "adding element %s (id %d) to bin %s (id %d)",
+ GST_STR_NULL (GST_ELEMENT_NAME (element)),
+ GST_OBJECT_CAST (element)->family_id,
+ GST_STR_NULL (GST_ELEMENT_NAME (bin)), GST_OBJECT_CAST (bin)->family_id);
+#endif
result = bclass->add_element (bin, element);
g_return_val_if_fail (GST_IS_ELEMENT (element), FALSE);
g_return_val_if_fail (GST_IS_PAD (pad), FALSE);
+#ifdef GST_TIZEN_TV
+ g_object_set (G_OBJECT (pad), "family-id",
+ (int) (GST_OBJECT_CAST (element)->family_id), NULL);
+#endif
+
/* locking pad to look at the name */
GST_OBJECT_LOCK (pad);
pad_name = g_strdup (GST_PAD_NAME (pad));
PROP_0,
PROP_NAME,
PROP_PARENT,
+#ifdef GST_TIZEN_TV
+ PROP_FAMILY_ID,
+#endif
PROP_LAST
};
properties[PROP_PARENT] =
g_param_spec_object ("parent", "Parent", "The parent of the object",
GST_TYPE_OBJECT, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
-
+#ifdef GST_TIZEN_TV
+ properties[PROP_FAMILY_ID] =
+ g_param_spec_int ("family-id", "Family Id",
+ "The family id of this object group, usually inherit from parent.",
+ -G_MAXINT, G_MAXINT, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
+#endif
g_object_class_install_properties (gobject_class, PROP_LAST, properties);
/**
#endif
object->flags = 0;
-
+#ifdef GST_TIZEN_TV
+ object->family_id = 0;
+#endif
object->control_rate = 100 * GST_MSECOND;
object->last_sync = GST_CLOCK_TIME_NONE;
}
case PROP_PARENT:
gst_object_set_parent (gstobject, g_value_get_object (value));
break;
+#ifdef GST_TIZEN_TV
+ case PROP_FAMILY_ID:
+ g_atomic_int_set (&gstobject->family_id, g_value_get_int (value));
+ break;
+#endif
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
case PROP_PARENT:
g_value_take_object (value, gst_object_get_parent (gstobject));
break;
+#ifdef GST_TIZEN_TV
+ case PROP_FAMILY_ID:
+ g_value_set_int (value, g_atomic_int_get (&gstobject->family_id));
+ break;
+#endif
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
gchar *name; /* object name */
GstObject *parent; /* this object's parent, weak ref */
guint32 flags;
+#ifdef GST_TIZEN_TV
+ gint family_id; /* inherit the parent's id */
+#endif
/*< private >*/
GList *control_bindings; /* List of GstControlBinding */
gst_query_unref (query);
return TRUE;
}
+
+static void
+set_family_id (const GValue * item, gpointer user_data)
+{
+ gpointer object = g_value_get_object (item);
+ if (GST_IS_PAD (object)) {
+ GstPad *pad = GST_PAD_CAST (object);
+ g_object_set (G_OBJECT (pad), "family-id", (int) user_data, NULL);
+ } else if (GST_IS_ELEMENT (object)) {
+ gst_set_family_id_to_child (GST_ELEMENT_CAST (object), (int) user_data);
+ }
+ return;
+}
+
+void
+gst_set_family_id_to_child (GstElement * child, int id)
+{
+ GstIterator *it;
+ if (!GST_IS_ELEMENT (child))
+ return;
+ g_object_set (G_OBJECT (child), "family-id", id, NULL);
+ it = gst_element_iterate_pads (child);
+ gst_iterator_foreach (it, (GstIteratorForeachFunction) set_family_id,
+ (gpointer) id);
+ gst_iterator_free (it);
+ it = NULL;
+
+ if (!GST_IS_BIN (child))
+ return;
+ it = gst_bin_iterate_recurse (GST_BIN (child));
+ gst_iterator_foreach (it, (GstIteratorForeachFunction) set_family_id,
+ (gpointer) id);
+ gst_iterator_free (it);
+ it = NULL;
+ return;
+}
+
#endif
gint *res_n, gint *res_d);
gint gst_util_fraction_compare (gint a_n, gint a_d, gint b_n, gint b_d);
-
+#ifdef GST_TIZEN_TV
+void gst_set_family_id_to_child (GstElement* child, int id);
+#endif
G_END_DECLS
#endif /* __GST_UTILS_H__ */