gst-editing-services: ges: add a timeline_object copy function

Thibault Saunier tsaunier at kemper.freedesktop.org
Wed Jan 11 07:04:31 PST 2012


Module: gst-editing-services
Branch: master
Commit: 5f30a86214bd08dea20f118bf76220f338cf9108
URL:    http://cgit.freedesktop.org/gstreamer/gst-editing-services/commit/?id=5f30a86214bd08dea20f118bf76220f338cf9108

Author: Thibault Saunier <thibault.saunier at collabora.com>
Date:   Wed Jun  8 20:36:58 2011 -0400

ges: add a timeline_object copy function

---

 ges/ges-timeline-object.c |   37 +++++++++++++++++++++++++++++++++++++
 1 files changed, 37 insertions(+), 0 deletions(-)

diff --git a/ges/ges-timeline-object.c b/ges/ges-timeline-object.c
index a2a4fe2..e26fe88 100644
--- a/ges/ges-timeline-object.c
+++ b/ges/ges-timeline-object.c
@@ -72,6 +72,9 @@ static gboolean ges_timeline_object_set_duration_internal (GESTimelineObject *
 static gboolean ges_timeline_object_set_priority_internal (GESTimelineObject *
     object, guint32 priority);
 
+static GESTimelineObject *ges_timeline_object_copy (GESTimelineObject * object,
+    gboolean * deep);
+
 G_DEFINE_ABSTRACT_TYPE (GESTimelineObject, ges_timeline_object,
     G_TYPE_INITIALLY_UNOWNED);
 
@@ -1191,6 +1194,40 @@ ges_timeline_object_set_top_effect_priority (GESTimelineObject * object,
   return TRUE;
 }
 
+/* TODO implement the deep parameter, and make it public */
+static GESTimelineObject *
+ges_timeline_object_copy (GESTimelineObject * object, gboolean * deep)
+{
+  GESTimelineObject *ret = NULL;
+  GParameter *params;
+  GParamSpec **specs;
+  guint n, n_specs, n_params;
+
+  g_return_val_if_fail (GES_IS_TIMELINE_OBJECT (object), NULL);
+
+  specs =
+      g_object_class_list_properties (G_OBJECT_GET_CLASS (object), &n_specs);
+  params = g_new0 (GParameter, n_specs);
+  n_params = 0;
+
+  for (n = 0; n < n_specs; ++n) {
+    if (strcmp (specs[n]->name, "parent") &&
+        (specs[n]->flags & G_PARAM_READWRITE) == G_PARAM_READWRITE) {
+      params[n_params].name = g_intern_string (specs[n]->name);
+      g_value_init (&params[n_params].value, specs[n]->value_type);
+      g_object_get_property (G_OBJECT (object), specs[n]->name,
+          &params[n_params].value);
+      ++n_params;
+    }
+  }
+
+  ret = g_object_newv (G_TYPE_FROM_INSTANCE (object), n_params, params);
+  g_free (specs);
+  g_free (params);
+
+  return ret;
+}
+
 static void
 update_height (GESTimelineObject * object)
 {



More information about the gstreamer-commits mailing list