Mass change to support compiling for both 0.6 and 0.7. Common support is now in...
authorDavid I. Lehn <dlehn@users.sourceforge.net>
Fri, 10 Oct 2003 04:21:21 +0000 (04:21 +0000)
committerDavid I. Lehn <dlehn@users.sourceforge.net>
Fri, 10 Oct 2003 04:21:21 +0000 (04:21 +0000)
Original commit message from CVS:
Mass change to support compiling for both 0.6 and 0.7.  Common support is now
in common.{defs,override,c,h}.  Specific version support is in
{0.6,0.7}.{defs,override,c,h}.  The common and version specific files are
merged and/or used as needed.

common.override: add gst_version

29 files changed:
configure.ac
gst/0.6.c [new file with mode: 0644]
gst/0.6.defs [new file with mode: 0644]
gst/0.6.h [new file with mode: 0644]
gst/0.6.override [new file with mode: 0644]
gst/0.7.c [new file with mode: 0644]
gst/0.7.defs [new file with mode: 0644]
gst/0.7.h [new file with mode: 0644]
gst/0.7.override [new file with mode: 0644]
gst/Makefile.am
gst/arg-types.py [moved from gstreamer/gstreamer-arg-types.py with 100% similarity]
gst/common.c [moved from gstreamer/gstreamer-fixes.c with 92% similarity]
gst/common.defs [moved from gstreamer/gstreamer-extra.defs with 90% similarity]
gst/common.h [moved from gstreamer/gstreamer-fixes.h with 94% similarity]
gst/common.override [moved from gst/gstreamer.override with 98% similarity]
gstreamer/0.6.c [new file with mode: 0644]
gstreamer/0.6.defs [new file with mode: 0644]
gstreamer/0.6.h [new file with mode: 0644]
gstreamer/0.6.override [new file with mode: 0644]
gstreamer/0.7.c [new file with mode: 0644]
gstreamer/0.7.defs [new file with mode: 0644]
gstreamer/0.7.h [new file with mode: 0644]
gstreamer/0.7.override [new file with mode: 0644]
gstreamer/Makefile.am
gstreamer/arg-types.py [moved from gst/gstreamer-arg-types.py with 100% similarity]
gstreamer/common.c [moved from gst/gstreamer-fixes.c with 92% similarity]
gstreamer/common.defs [moved from gst/gstreamer-extra.defs with 90% similarity]
gstreamer/common.h [moved from gst/gstreamer-fixes.h with 94% similarity]
gstreamer/common.override [moved from gstreamer/gstreamer.override with 98% similarity]

index 9172fb9..99f12d1 100644 (file)
@@ -40,23 +40,18 @@ else
 fi
 AM_CHECK_PYTHON_HEADERS(,[AC_MSG_ERROR(could not find Python headers)])
 
-dnl Only support 0.6 in 0.1.0. Remove this and enable code below for 0.7.
-GST_MAJORMINOR=0.6
+dnl check for GStreamer
+dnl start with 0.7
+GST_MAJORMINOR=0.7
 PKG_CHECK_MODULES(GST, gstreamer-$GST_MAJORMINOR >= $GST_REQ,
                   HAVE_GSTREAMER=yes,HAVE_GSTREAMER=no)
 
-dnl check for GStreamer
-dnl start with 0.7
-dnl GST_MAJORMINOR=0.7
-dnl PKG_CHECK_MODULES(GST, gstreamer-$GST_MAJORMINOR >= $GST_REQ,
-dnl                   HAVE_GSTREAMER=yes,HAVE_GSTREAMER=no)
-dnl 
 dnl try 0.6
-dnl if test "x$HAVE_GSTREAMER" = "xno"; then
-dnl   GST_MAJORMINOR=0.6
-dnl   PKG_CHECK_MODULES(GST, gstreamer-$GST_MAJORMINOR >= $GST_REQ,
-dnl                     HAVE_GSTREAMER=yes,HAVE_GSTREAMER=no)
-dnl fi
+if test "x$HAVE_GSTREAMER" = "xno"; then
+  GST_MAJORMINOR=0.6
+  PKG_CHECK_MODULES(GST, gstreamer-$GST_MAJORMINOR >= $GST_REQ,
+                    HAVE_GSTREAMER=yes,HAVE_GSTREAMER=no)
+fi
 
 dnl Give error and exit if we don't have gstreamer
 if test "x$HAVE_GSTREAMER" = "xno"; then
@@ -66,6 +61,8 @@ fi
 AC_SUBST(GST_LIBS)
 AC_SUBST(GST_CFLAGS)
 AC_SUBST(GST_MAJORMINOR)
+AM_CONDITIONAL(GST_0_6, test $GST_MAJORMINOR = 0.6)
+AM_CONDITIONAL(GST_0_7, test $GST_MAJORMINOR = 0.7)
 
 dnl check for pygtk
 PKG_CHECK_MODULES(PYGTK, pygtk-2.0 >= $PYGTK_REQ)
diff --git a/gst/0.6.c b/gst/0.6.c
new file mode 100644 (file)
index 0000000..6820f91
--- /dev/null
+++ b/gst/0.6.c
@@ -0,0 +1,30 @@
+/* gst-python
+ * Copyright (C) 2002 David I. Lehn
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ * 
+ * Author: David I. Lehn <dlehn@users.sourceforge.net>
+ */
+
+#include "pygobject.h"
+#include <gst/gst.h>
+
+#include "0.6.h"
+
+GstPropsType gst_props_entry_get_props_type(GstPropsEntry *entry)
+{
+       return gst_props_entry_get_type(entry);
+}
diff --git a/gst/0.6.defs b/gst/0.6.defs
new file mode 100644 (file)
index 0000000..e0ed8ee
--- /dev/null
@@ -0,0 +1,9 @@
+;;
+;; Override normal *_get_type handling via rename
+;;
+
+(define-method get_props_type
+  (of-object "GstPropsEntry")
+  (c-name "gst_props_entry_get_props_type")
+  (return-type "GstPropsType")
+)
diff --git a/gst/0.6.h b/gst/0.6.h
new file mode 100644 (file)
index 0000000..ff0bcac
--- /dev/null
+++ b/gst/0.6.h
@@ -0,0 +1,24 @@
+/* gst-python
+ * Copyright (C) 2002 David I. Lehn
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ * 
+ * Author: David I. Lehn <dlehn@users.sourceforge.net>
+ */
+
+#include <gst/gst.h>
+
+GstPropsType gst_props_entry_get_props_type(GstPropsEntry *entry);
diff --git a/gst/0.6.override b/gst/0.6.override
new file mode 100644 (file)
index 0000000..213ab27
--- /dev/null
@@ -0,0 +1,29 @@
+/* -*- Mode: C; c-basic-offset: 4 -*- */
+/* gst-python
+ * Copyright (C) 2002 David I. Lehn
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ * 
+ * Author: David I. Lehn <dlehn@users.sourceforge.net>
+ */
+%%
+headers
+#include <Python.h>
+
+#include "pygobject.h"
+#include <gst/gst.h>
+
+#include "0.6.h"
diff --git a/gst/0.7.c b/gst/0.7.c
new file mode 100644 (file)
index 0000000..b8eb177
--- /dev/null
+++ b/gst/0.7.c
@@ -0,0 +1,25 @@
+/* gst-python
+ * Copyright (C) 2002 David I. Lehn
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ * 
+ * Author: David I. Lehn <dlehn@users.sourceforge.net>
+ */
+
+#include "pygobject.h"
+#include <gst/gst.h>
+
+#include "0.7.h"
diff --git a/gst/0.7.defs b/gst/0.7.defs
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/gst/0.7.h b/gst/0.7.h
new file mode 100644 (file)
index 0000000..66d2bf1
--- /dev/null
+++ b/gst/0.7.h
@@ -0,0 +1,20 @@
+/* gst-python
+ * Copyright (C) 2002 David I. Lehn
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ * 
+ * Author: David I. Lehn <dlehn@users.sourceforge.net>
+ */
diff --git a/gst/0.7.override b/gst/0.7.override
new file mode 100644 (file)
index 0000000..cd53081
--- /dev/null
@@ -0,0 +1,29 @@
+/* -*- Mode: C; c-basic-offset: 4 -*- */
+/* gst-python
+ * Copyright (C) 2002 David I. Lehn
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ * 
+ * Author: David I. Lehn <dlehn@users.sourceforge.net>
+ */
+%%
+headers
+#include <Python.h>
+
+#include "pygobject.h"
+#include <gst/gst.h>
+
+#include "0.7.h"
index fbe0a9a..18b43a1 100644 (file)
@@ -6,40 +6,61 @@ pygstreamer_PYTHON = __init__.py
 
 pygstreamerexecdir = $(pyexecdir)/gstreamer
 
-# gstreamer binding
-OVERRIDES = gstreamer.override
+GST_OVERRIDES = common.override \
+       0.6.override \
+       0.7.override
+GST_DEFS = common.defs \
+       0.6.defs \
+       0.7.defs
+GST_CODE = common.c common.h \
+       0.6.c 0.6.h \
+       0.7.c 0.7.h
+
+# Ugly hack to pick the proper version code.
+# Just setting to $(GST_MAJORMINOR).{ch} will not work
+if GST_0_6
+VERSOURCES = 0.6.c 0.6.h
+endif
+if GST_0_7
+VERSOURCES = 0.7.c 0.7.h
+endif
 
 pyexec_LTLIBRARIES = _gstreamermodule.la
-_gstreamermodule_la_SOURCES = gstreamermodule.c gstreamer-fixes.c gstreamer-fixes.h
+_gstreamermodule_la_SOURCES = \
+       gstreamermodule.c \
+       common.c common.h \
+       $(VERSOURCES)
 _gstreamermodule_la_CFLAGS = $(GST_CFLAGS)
 _gstreamermodule_la_LIBADD = $(GST_LIBS)
 _gstreamermodule_la_LDFLAGS = -module -avoid-version -export-symbols-regex init_gstreamer
 nodist__gstreamermodule_la_SOURCES = gstreamer.c
-CLEANFILES = gstreamer.c gstreamer-base.defs gstreamer.defs
-EXTRA_DIST = gstreamer-extra.defs $(OVERRIDES) gstreamer-arg-types.py
-gstreamer.c: gstreamer.defs $(OVERRIDES)
+
+CLEANFILES = gstreamer.c core.defs gstreamer.defs gstreamer.override
+EXTRA_DIST = $(GST_OVERRIDES) $(GST_DEFS) $(GST_CODE) arg-types.py
+
+gstreamer.c: gstreamer.defs gstreamer.override
 
 GST_EXCLUDE_INCLUDES=\
        $(GST_INCLUDEDIR)/gst/gstatomic_impl.h \
        $(GST_INCLUDEDIR)/gst/gstcompat.h
 GST_INCLUDES=$(filter-out $(GST_EXCLUDE_INCLUDES),$(wildcard $(GST_INCLUDEDIR)/gst/*.h))
 
-gstreamer-base.defs: $(GST_INCLUDES)
-       $(PYTHON) $(PYGTK_H2DEF) $(GST_INCLUDES) > gstreamer-base.defs
+gstreamer.override: common.override $(GST_MAJORMINOR).override
+       cat $+ > $@
 
-gstreamer.defs: gstreamer-base.defs gstreamer-extra.defs $(top_srcdir)/gstreamer/gstreamer-arg-types.py
-       cat gstreamer-base.defs $(srcdir)/gstreamer-extra.defs > gstreamer.defs
+core.defs: $(GST_INCLUDES)
+       $(PYTHON) $(PYGTK_H2DEF) $(GST_INCLUDES) > $@
 
-.defs.c:
+gstreamer.defs: core.defs common.defs $(GST_MAJORMINOR).defs
+       cat $+ > $@
+
+gstreamer.c: gstreamer.defs arg-types.py gstreamer.override
        $(PYGTK_CODEGEN) \
-               --load-types $(srcdir)/gstreamer-arg-types.py \
-               --override $(srcdir)/$*.override \
-               --prefix py$* $*.defs > gen-$*.c \
-       && cp gen-$*.c $*.c \
-       && rm -f gen-$*.c
-
-#          --register $(PYGTK_DEFSDIR)/pango-types.defs
-#          --register $(PYGTK_DEFSDIR)/gdk-types.defs
-#          --register $(PYGTK_DEFSDIR)/gtk-types.defs
-#          --register $(top_srcdir)/bonobo/bonobo-types.defs
-#          --register $(top_srcdir)/bonobo/bonoboui-types.defs
+               --load-types $(srcdir)/arg-types.py \
+               --override $(srcdir)/gstreamer.override \
+               --prefix pygstreamer gstreamer.defs > gen-gstreamer.c \
+       && cp gen-gstreamer.c gstreamer.c \
+       && rm -f gen-gstreamer.c
+
+#              --register $(PYGTK_DEFSDIR)/gtk-types.defs
+#              --register $(top_srcdir)/blah/blah-types.defs
similarity index 92%
rename from gstreamer/gstreamer-fixes.c
rename to gst/common.c
index 3ffb7d4..841283b 100644 (file)
@@ -22,7 +22,7 @@
 #include "pygobject.h"
 #include <gst/gst.h>
 
-#include "gstreamer-fixes.h"
+#include "common.h"
 
 void iterate_bin_all(GstBin *bin) {
        g_return_if_fail(bin != NULL);
@@ -62,8 +62,3 @@ guint add_iterate_bin(GstBin *bin) {
 void remove_iterate_bin(guint id) {
        g_source_remove(id);
 }
-
-GstPropsType gst_props_entry_get_props_type(GstPropsEntry *entry)
-{
-       return gst_props_entry_get_type(entry);
-}
similarity index 90%
rename from gstreamer/gstreamer-extra.defs
rename to gst/common.defs
index acb57cb..02527b0 100644 (file)
 )
 
 ;;
-;; Override normal *_get_type handling via rename
-;;
-
-(define-method get_props_type
-  (of-object "GstPropsEntry")
-  (c-name "gst_props_entry_get_props_type")
-  (return-type "GstPropsType")
-)
-
-;;
 ;; Access GstProps properties list
 ;;
 
 ;; Element constructor override; uses a nonexistant make_element
 ;; which is defined in gstreamer.overrides
 ;;
+
 (define-function gst_element_factory_make_element
   (is-constructor-of "GstElement")
   (c-name "gst_element_factory_make_element")
similarity index 94%
rename from gstreamer/gstreamer-fixes.h
rename to gst/common.h
index 1bd142d..a63f174 100644 (file)
@@ -28,4 +28,3 @@
 void iterate_bin_all(GstBin *bin);
 guint add_iterate_bin(GstBin *bin);
 void remove_iterate_bin(guint id);
-GstPropsType gst_props_entry_get_props_type(GstPropsEntry *entry);
similarity index 98%
rename from gst/gstreamer.override
rename to gst/common.override
index b8bb6fd..416e127 100644 (file)
@@ -26,7 +26,7 @@ headers
 #include "pygobject.h"
 #include <gst/gst.h>
 
-#include "gstreamer-fixes.h"
+#include "common.h"
 
 typedef struct {
        PyGObject *pad;
@@ -516,3 +516,15 @@ _wrap_gst_element_factory_make_element(PyGObject *self, PyObject *args, PyObject
     pygobject_register_wrapper((PyObject *)self);
     return 0;
 }
+%%
+override gst_version
+
+static PyObject *
+_wrap_gst_version(PyGObject *self)
+{
+       guint major, minor, micro;
+
+       gst_version(&major, &minor, &micro);
+
+       return Py_BuildValue("(iii)", major, minor, micro);
+}
diff --git a/gstreamer/0.6.c b/gstreamer/0.6.c
new file mode 100644 (file)
index 0000000..6820f91
--- /dev/null
@@ -0,0 +1,30 @@
+/* gst-python
+ * Copyright (C) 2002 David I. Lehn
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ * 
+ * Author: David I. Lehn <dlehn@users.sourceforge.net>
+ */
+
+#include "pygobject.h"
+#include <gst/gst.h>
+
+#include "0.6.h"
+
+GstPropsType gst_props_entry_get_props_type(GstPropsEntry *entry)
+{
+       return gst_props_entry_get_type(entry);
+}
diff --git a/gstreamer/0.6.defs b/gstreamer/0.6.defs
new file mode 100644 (file)
index 0000000..e0ed8ee
--- /dev/null
@@ -0,0 +1,9 @@
+;;
+;; Override normal *_get_type handling via rename
+;;
+
+(define-method get_props_type
+  (of-object "GstPropsEntry")
+  (c-name "gst_props_entry_get_props_type")
+  (return-type "GstPropsType")
+)
diff --git a/gstreamer/0.6.h b/gstreamer/0.6.h
new file mode 100644 (file)
index 0000000..ff0bcac
--- /dev/null
@@ -0,0 +1,24 @@
+/* gst-python
+ * Copyright (C) 2002 David I. Lehn
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ * 
+ * Author: David I. Lehn <dlehn@users.sourceforge.net>
+ */
+
+#include <gst/gst.h>
+
+GstPropsType gst_props_entry_get_props_type(GstPropsEntry *entry);
diff --git a/gstreamer/0.6.override b/gstreamer/0.6.override
new file mode 100644 (file)
index 0000000..213ab27
--- /dev/null
@@ -0,0 +1,29 @@
+/* -*- Mode: C; c-basic-offset: 4 -*- */
+/* gst-python
+ * Copyright (C) 2002 David I. Lehn
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ * 
+ * Author: David I. Lehn <dlehn@users.sourceforge.net>
+ */
+%%
+headers
+#include <Python.h>
+
+#include "pygobject.h"
+#include <gst/gst.h>
+
+#include "0.6.h"
diff --git a/gstreamer/0.7.c b/gstreamer/0.7.c
new file mode 100644 (file)
index 0000000..b8eb177
--- /dev/null
@@ -0,0 +1,25 @@
+/* gst-python
+ * Copyright (C) 2002 David I. Lehn
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ * 
+ * Author: David I. Lehn <dlehn@users.sourceforge.net>
+ */
+
+#include "pygobject.h"
+#include <gst/gst.h>
+
+#include "0.7.h"
diff --git a/gstreamer/0.7.defs b/gstreamer/0.7.defs
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/gstreamer/0.7.h b/gstreamer/0.7.h
new file mode 100644 (file)
index 0000000..66d2bf1
--- /dev/null
@@ -0,0 +1,20 @@
+/* gst-python
+ * Copyright (C) 2002 David I. Lehn
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ * 
+ * Author: David I. Lehn <dlehn@users.sourceforge.net>
+ */
diff --git a/gstreamer/0.7.override b/gstreamer/0.7.override
new file mode 100644 (file)
index 0000000..cd53081
--- /dev/null
@@ -0,0 +1,29 @@
+/* -*- Mode: C; c-basic-offset: 4 -*- */
+/* gst-python
+ * Copyright (C) 2002 David I. Lehn
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ * 
+ * Author: David I. Lehn <dlehn@users.sourceforge.net>
+ */
+%%
+headers
+#include <Python.h>
+
+#include "pygobject.h"
+#include <gst/gst.h>
+
+#include "0.7.h"
index fbe0a9a..18b43a1 100644 (file)
@@ -6,40 +6,61 @@ pygstreamer_PYTHON = __init__.py
 
 pygstreamerexecdir = $(pyexecdir)/gstreamer
 
-# gstreamer binding
-OVERRIDES = gstreamer.override
+GST_OVERRIDES = common.override \
+       0.6.override \
+       0.7.override
+GST_DEFS = common.defs \
+       0.6.defs \
+       0.7.defs
+GST_CODE = common.c common.h \
+       0.6.c 0.6.h \
+       0.7.c 0.7.h
+
+# Ugly hack to pick the proper version code.
+# Just setting to $(GST_MAJORMINOR).{ch} will not work
+if GST_0_6
+VERSOURCES = 0.6.c 0.6.h
+endif
+if GST_0_7
+VERSOURCES = 0.7.c 0.7.h
+endif
 
 pyexec_LTLIBRARIES = _gstreamermodule.la
-_gstreamermodule_la_SOURCES = gstreamermodule.c gstreamer-fixes.c gstreamer-fixes.h
+_gstreamermodule_la_SOURCES = \
+       gstreamermodule.c \
+       common.c common.h \
+       $(VERSOURCES)
 _gstreamermodule_la_CFLAGS = $(GST_CFLAGS)
 _gstreamermodule_la_LIBADD = $(GST_LIBS)
 _gstreamermodule_la_LDFLAGS = -module -avoid-version -export-symbols-regex init_gstreamer
 nodist__gstreamermodule_la_SOURCES = gstreamer.c
-CLEANFILES = gstreamer.c gstreamer-base.defs gstreamer.defs
-EXTRA_DIST = gstreamer-extra.defs $(OVERRIDES) gstreamer-arg-types.py
-gstreamer.c: gstreamer.defs $(OVERRIDES)
+
+CLEANFILES = gstreamer.c core.defs gstreamer.defs gstreamer.override
+EXTRA_DIST = $(GST_OVERRIDES) $(GST_DEFS) $(GST_CODE) arg-types.py
+
+gstreamer.c: gstreamer.defs gstreamer.override
 
 GST_EXCLUDE_INCLUDES=\
        $(GST_INCLUDEDIR)/gst/gstatomic_impl.h \
        $(GST_INCLUDEDIR)/gst/gstcompat.h
 GST_INCLUDES=$(filter-out $(GST_EXCLUDE_INCLUDES),$(wildcard $(GST_INCLUDEDIR)/gst/*.h))
 
-gstreamer-base.defs: $(GST_INCLUDES)
-       $(PYTHON) $(PYGTK_H2DEF) $(GST_INCLUDES) > gstreamer-base.defs
+gstreamer.override: common.override $(GST_MAJORMINOR).override
+       cat $+ > $@
 
-gstreamer.defs: gstreamer-base.defs gstreamer-extra.defs $(top_srcdir)/gstreamer/gstreamer-arg-types.py
-       cat gstreamer-base.defs $(srcdir)/gstreamer-extra.defs > gstreamer.defs
+core.defs: $(GST_INCLUDES)
+       $(PYTHON) $(PYGTK_H2DEF) $(GST_INCLUDES) > $@
 
-.defs.c:
+gstreamer.defs: core.defs common.defs $(GST_MAJORMINOR).defs
+       cat $+ > $@
+
+gstreamer.c: gstreamer.defs arg-types.py gstreamer.override
        $(PYGTK_CODEGEN) \
-               --load-types $(srcdir)/gstreamer-arg-types.py \
-               --override $(srcdir)/$*.override \
-               --prefix py$* $*.defs > gen-$*.c \
-       && cp gen-$*.c $*.c \
-       && rm -f gen-$*.c
-
-#          --register $(PYGTK_DEFSDIR)/pango-types.defs
-#          --register $(PYGTK_DEFSDIR)/gdk-types.defs
-#          --register $(PYGTK_DEFSDIR)/gtk-types.defs
-#          --register $(top_srcdir)/bonobo/bonobo-types.defs
-#          --register $(top_srcdir)/bonobo/bonoboui-types.defs
+               --load-types $(srcdir)/arg-types.py \
+               --override $(srcdir)/gstreamer.override \
+               --prefix pygstreamer gstreamer.defs > gen-gstreamer.c \
+       && cp gen-gstreamer.c gstreamer.c \
+       && rm -f gen-gstreamer.c
+
+#              --register $(PYGTK_DEFSDIR)/gtk-types.defs
+#              --register $(top_srcdir)/blah/blah-types.defs
similarity index 92%
rename from gst/gstreamer-fixes.c
rename to gstreamer/common.c
index 3ffb7d4..841283b 100644 (file)
@@ -22,7 +22,7 @@
 #include "pygobject.h"
 #include <gst/gst.h>
 
-#include "gstreamer-fixes.h"
+#include "common.h"
 
 void iterate_bin_all(GstBin *bin) {
        g_return_if_fail(bin != NULL);
@@ -62,8 +62,3 @@ guint add_iterate_bin(GstBin *bin) {
 void remove_iterate_bin(guint id) {
        g_source_remove(id);
 }
-
-GstPropsType gst_props_entry_get_props_type(GstPropsEntry *entry)
-{
-       return gst_props_entry_get_type(entry);
-}
similarity index 90%
rename from gst/gstreamer-extra.defs
rename to gstreamer/common.defs
index acb57cb..02527b0 100644 (file)
 )
 
 ;;
-;; Override normal *_get_type handling via rename
-;;
-
-(define-method get_props_type
-  (of-object "GstPropsEntry")
-  (c-name "gst_props_entry_get_props_type")
-  (return-type "GstPropsType")
-)
-
-;;
 ;; Access GstProps properties list
 ;;
 
 ;; Element constructor override; uses a nonexistant make_element
 ;; which is defined in gstreamer.overrides
 ;;
+
 (define-function gst_element_factory_make_element
   (is-constructor-of "GstElement")
   (c-name "gst_element_factory_make_element")
similarity index 94%
rename from gst/gstreamer-fixes.h
rename to gstreamer/common.h
index 1bd142d..a63f174 100644 (file)
@@ -28,4 +28,3 @@
 void iterate_bin_all(GstBin *bin);
 guint add_iterate_bin(GstBin *bin);
 void remove_iterate_bin(guint id);
-GstPropsType gst_props_entry_get_props_type(GstPropsEntry *entry);
similarity index 98%
rename from gstreamer/gstreamer.override
rename to gstreamer/common.override
index b8bb6fd..416e127 100644 (file)
@@ -26,7 +26,7 @@ headers
 #include "pygobject.h"
 #include <gst/gst.h>
 
-#include "gstreamer-fixes.h"
+#include "common.h"
 
 typedef struct {
        PyGObject *pad;
@@ -516,3 +516,15 @@ _wrap_gst_element_factory_make_element(PyGObject *self, PyObject *args, PyObject
     pygobject_register_wrapper((PyObject *)self);
     return 0;
 }
+%%
+override gst_version
+
+static PyObject *
+_wrap_gst_version(PyGObject *self)
+{
+       guint major, minor, micro;
+
+       gst_version(&major, &minor, &micro);
+
+       return Py_BuildValue("(iii)", major, minor, micro);
+}