gst-editing-services: python: bind and override the ges_track_get_objects method

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


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

Author: Mathieu Duponchelle <seeed at laposte.net>
Date:   Wed Jul 13 18:30:06 2011 +0200

python: bind and override the ges_track_get_objects method

---

 bindings/python/ges.defs     |    6 ++++++
 bindings/python/ges.override |   25 +++++++++++++++++++++++++
 2 files changed, 31 insertions(+), 0 deletions(-)

diff --git a/bindings/python/ges.defs b/bindings/python/ges.defs
index b9243d3..574efe7 100644
--- a/bindings/python/ges.defs
+++ b/bindings/python/ges.defs
@@ -1572,6 +1572,12 @@
   )
 )
 
+(define-method get_objects
+  (of-object "GESTrack")
+  (c-name "ges_track_get_objects")
+  (return-type "GList*")
+)
+
 (define-method set_timeline
   (of-object "GESTrack")
   (c-name "ges_track_set_timeline")
diff --git a/bindings/python/ges.override b/bindings/python/ges.override
index ba665db..fc97dd0 100644
--- a/bindings/python/ges.override
+++ b/bindings/python/ges.override
@@ -285,6 +285,31 @@ _wrap_ges_timeline_object_get_track_objects(PyGObject *self)
 }
 
 %%
+override ges_track_get_objects noargs
+static PyObject *
+_wrap_ges_track_get_objects(PyGObject *self)
+{
+    const GList *l, *list;
+    PyObject *py_list;
+
+    g_return_val_if_fail (GES_IS_TRACK (self->obj), PyList_New(0));
+
+    pyg_begin_allow_threads;
+    list = ges_track_get_objects(GES_TRACK(self->obj));
+    pyg_end_allow_threads;
+
+    py_list = PyList_New(0);
+    for (l = list; l; l = l->next) {
+    GESTrackObject *object = (GESTrackObject*)l->data;
+    PyObject *py_object = pygobject_new(G_OBJECT(object));
+    PyList_Append(py_list, py_object);
+    Py_DECREF(py_object);
+    }
+
+    return py_list;
+}
+
+%%
 override ges_track_object_get_child_property kwargs
 static PyObject *
 _wrap_ges_track_object_get_child_property (PyGObject *self, PyObject *args, PyObject *kwargs)



More information about the gstreamer-commits mailing list