gst-python: gst: Move PyGstMiniObject to public API.

Tim Müller tpm at kemper.freedesktop.org
Wed Apr 11 02:30:13 PDT 2012


Module: gst-python
Branch: master
Commit: 3b602c14041622c48c5a92809a4a644e9aec6f5c
URL:    http://cgit.freedesktop.org/gstreamer/gst-python/commit/?id=3b602c14041622c48c5a92809a4a644e9aec6f5c

Author: Thibault Saunier <thibault.saunier at collabora.com>
Date:   Wed Aug 10 17:13:17 2011 +0200

gst: Move PyGstMiniObject to public API.

Allows it to be reused from 3rd party modules.

https://bugzilla.gnome.org/show_bug.cgi?id=656289

---

 gst/pygst.h           |   12 ++++++++++++
 gst/pygstminiobject.c |    2 ++
 gst/pygstminiobject.h |    9 ---------
 3 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/gst/pygst.h b/gst/pygst.h
index 01f7179..83b6849 100644
--- a/gst/pygst.h
+++ b/gst/pygst.h
@@ -25,6 +25,8 @@
 
 #include <glib.h>
 #include <glib-object.h>
+#include <gst/gst.h>
+
 #include "common.h"
 
 G_BEGIN_DECLS
@@ -35,6 +37,16 @@ struct _PyGst_Functions {
   PyObject*     (*miniobject_new) (GstMiniObject *obj);
 };
 
+#define pygstminiobject_get(v) (((PyGstMiniObject *)(v))->obj)
+#define pygstminiobject_check(v,base) (PyObject_TypeCheck(v,base))
+
+typedef struct {
+    PyObject_HEAD
+    GstMiniObject *obj;
+    PyObject *inst_dict; /* the instance dictionary -- must be last */
+    PyObject *weakreflist; /* list of weak references */
+} PyGstMiniObject;
+
 #ifndef _INSIDE_PYGST_
 
 #if defined(NO_IMPORT_PYGOBJECT)
diff --git a/gst/pygstminiobject.c b/gst/pygstminiobject.c
index daa029e..94f28fe 100644
--- a/gst/pygstminiobject.c
+++ b/gst/pygstminiobject.c
@@ -21,7 +21,9 @@
  */
 
 #define NO_IMPORT_PYGOBJECT
+#define _INSIDE_PYGST_
 #include "pygstminiobject.h"
+#include "pygst.h"
 #include <gst/gst.h>
 
 static const gchar pygstminiobject_class_id[] = "PyGstMiniObject::class";
diff --git a/gst/pygstminiobject.h b/gst/pygstminiobject.h
index 80e6b7e..3eb3d4a 100644
--- a/gst/pygstminiobject.h
+++ b/gst/pygstminiobject.h
@@ -20,15 +20,6 @@ G_BEGIN_DECLS
 #define PYGIL_API_IS_BUGGY FALSE
 #endif
 
-typedef struct {
-    PyObject_HEAD
-    GstMiniObject *obj;
-    PyObject *inst_dict; /* the instance dictionary -- must be last */
-    PyObject *weakreflist; /* list of weak references */
-} PyGstMiniObject;
-
-#define pygstminiobject_get(v) (((PyGstMiniObject *)(v))->obj)
-#define pygstminiobject_check(v,base) (PyObject_TypeCheck(v,base))
 
 void
 pygstminiobject_register_class(PyObject *dict, const gchar *type_name,



More information about the gstreamer-commits mailing list