+2004-03-15 Johan Dahlin <johan@gnome.org>
+
+ * gst/*: Move interfaces over here, make it build, remove gstreamer.py
+
2004-03-12 Johan Dahlin <johan@gnome.org>
* configure.ac: PyGtk 1.99.14 should be okay (Shipped with RH9),
SUBDIRS_DOCS =
endif
-INTERFACESDIR = gstinterfaces
#PLAYDIR = gstplay
PLAYDIR =
UNCONDDIRS = gst pkgconfig examples testsuite
SUBDIRS = \
$(UNCONDDIRS) \
- $(INTERFACESDIR) \
$(PLAYDIR) \
$(SUBDIRS_DOCS)
-DIST_SUBDIRS = $(UNCONDDIRS) docs gstinterfaces $(PLAYDIR)
+DIST_SUBDIRS = $(UNCONDDIRS) docs $(PLAYDIR)
EXTRA_DIST = \
gst-python.spec.in gst-python.spec README-docs
AC_OUTPUT([
Makefile
gst/Makefile
- gstinterfaces/Makefile
gstplay/Makefile
pkgconfig/Makefile
pkgconfig/gst-python.pc
*.pdf
*.html
gst-python.ent
+tmpbuildcatalog
.deps
gst.c
gen-*.c
+interfaces.c
INCLUDES = $(PYTHON_INCLUDES) $(PYGTK_CFLAGS)
PYGTK_DEFSDIR = @PYGTK_DEFSDIR@
+defs_DATA =
+defsdir = $(pkgdatadir)/2.0/defs
+
+EXTRA_DIST = $(defs_DATA)
+
pkgpythondir = $(pythondir)/gst
pkgpyexecdir = $(pyexecdir)/gst
+common_ldflags = -module -avoid-version
+
pygstdir = $(pkgpythondir)
pygst_PYTHON = __init__.py
-# Backwards comptibility
-pygstreamerdir = $(pythondir)
-pygstreamer_PYTHON = gstreamer.py
-
pygstexecdir = $(pkgpyexecdir)
+# GStreamer bindings
GST_OVERRIDES = gst.override gstpad-handlers.override
+GST_DEFS = gst.defs gst-types.defs
-pygstexec_LTLIBRARIES = _gstmodule.la
-_gstmodule_la_SOURCES = gstmodule.c gst-types.c
+pygstexec_LTLIBRARIES = _gst.la
+_gst_la_CFLAGS = $(GST_CFLAGS) -fno-strict-aliasing
+_gst_la_LIBADD = $(GST_LIBS)
+_gst_la_LDFLAGS = $(common_ldflags) -export-symbols-regex init_gst
+_gst_la_SOURCES = gst-argtypes.c gstmodule.c
+nodist__gst_la_SOURCES = gst.c
+CLEANFILES = gst.c
+EXTRA_DIST += $(GST_OVERRIDES) arg-types.py
+defs_DATA += $(GST_DEFS)
+gst.c: $(GST_DEFS) $(GST_OVERRIDES)
-_gstmodule_la_CFLAGS = $(GST_CFLAGS) -fno-strict-aliasing
-_gstmodule_la_LIBADD = $(GST_LIBS)
-_gstmodule_la_LDFLAGS = -module -avoid-version -export-symbols-regex init_gst
-nodist__gstmodule_la_SOURCES = gst.c
+# GStreamer interfaces bindings
-defs_DATA = \
- gst.defs \
- gst-types.defs
-defsdir = $(pkgdatadir)/2.0/defs
+INTERFACES_OVERRIDES = interfaces.override xoverlay.override
+INTERFACES_DEFS = interfaces.defs xoverlay.defs xwindowlistener.defs
-CLEANFILES = gst.c
-EXTRA_DIST = $(defs_DATA) $(GST_OVERRIDES) arg-types.py
+GST_INTERFACES_INCLUDES=
+GST_INTERFACES_INCLUDES += $(GST_INTERFACES_INCLUDEDIR)/gst/colorbalance/colorbalance.h
+GST_INTERFACES_INCLUDES += $(GST_INTERFACES_INCLUDEDIR)/gst/colorbalance/colorbalancechannel.h
+GST_INTERFACES_INCLUDES += $(GST_INTERFACES_INCLUDEDIR)/gst/mixer/mixer.h
+GST_INTERFACES_INCLUDES += $(GST_INTERFACES_INCLUDEDIR)/gst/mixer/mixertrack.h
+GST_INTERFACES_INCLUDES += $(GST_INTERFACES_INCLUDEDIR)/gst/navigation/navigation.h
+GST_INTERFACES_INCLUDES += $(GST_INTERFACES_INCLUDEDIR)/gst/propertyprobe/propertyprobe.h
+GST_INTERFACES_INCLUDES += $(GST_INTERFACES_INCLUDEDIR)/gst/tuner/tuner.h
+GST_INTERFACES_INCLUDES += $(GST_INTERFACES_INCLUDEDIR)/gst/tuner/tunerchannel.h
+GST_INTERFACES_INCLUDES += $(GST_INTERFACES_INCLUDEDIR)/gst/tuner/tunernorm.h
+
+# FIXME: configure.ac
+#if USE_X
+GST_INTERFACES_INCLUDES+=$(GST_INTERFACES_INCLUDEDIR)/gst/xoverlay/xoverlay.h
+GST_INTERFACES_INCLUDES+=$(GST_INTERFACES_INCLUDEDIR)/gst/xwindowlistener/xwindowlistener.h
+#endif
-gst.c: $(srcdir)/gst.defs $(srcdir)/gst-types.defs $(GST_OVERRIDES)
- (cd $(srcdir)\
- && $(PYGTK_CODEGEN) \
+# FIXEME: configure.ac
+#if BUILD_INTERFACES
+pygstexec_LTLIBRARIES += interfaces.la
+#endif
+interfaces_la_CFLAGS = $(GST_CFLAGS) $(GST_INTERFACES_CFLAGS) -fno-strict-aliasing
+interfaces_la_LIBADD = $(GST_LIBS) $(GST_INTERFACES_LIBS)
+interfaces_la_LDFLAGS = $(common_ldflags) -export-symbols-regex initinterface
+interfaces_la_SOURCES = interfacesmodule.c
+nodist_interfaces_la_SOURCES = interfaces.c
+CLEANFILES += interfaces.c
+EXTRA_DIST += $(INTERFACES_OVERRIDES) arg-types.py
+defs_DATA += $(INTERFACES_DEFS)
+interfaces.c: $(INTERFACES_DEFS) $(INTERFACES_OVERRIDES)
+
+.defs.c:
+ (cd $(srcdir) \
+ && $(PYGTK_CODEGEN) \
--load-types $(srcdir)/arg-types.py \
--register $(srcdir)/gst-types.defs \
--override $*.override \
--prefix py$* $*.defs) > gen-$*.c \
&& cp gen-$*.c $*.c \
&& rm -f gen-$*.c
-
--- /dev/null
+/* gst-python
+ * Copyright (C) 2004 Johan Dahlin
+ *
+ * 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: Johan Dahlin <johan@gnome.org>
+ */
+
+#include <gst/gst.h>
+#include <pygobject.h>
+
+gboolean
+pygst_data_from_pyobject(PyObject *object, GstData **data)
+{
+ if (pyg_boxed_check(object, GST_TYPE_DATA)) {
+ *data = pyg_boxed_get(object, GstData);
+ return TRUE;
+ } else if (pyg_boxed_check(object, GST_TYPE_BUFFER)) {
+ *data = GST_DATA (pyg_boxed_get(object, GstBuffer));
+ return TRUE;
+ } else if (pyg_boxed_check(object, GST_TYPE_EVENT)) {
+ *data = GST_DATA (pyg_boxed_get(object, GstEvent));
+ return TRUE;
+ }
+
+ PyErr_Clear();
+ PyErr_SetString(PyExc_TypeError, "could not convert to GstData");
+ return FALSE;
+}
+
+static PyObject *
+PyGstData_from_value(const GValue *value)
+{
+ GstData *data = (GstData *)g_value_get_boxed(value);
+
+ return pyg_boxed_new(GST_TYPE_DATA, data, TRUE, TRUE);
+}
+
+static int
+PyGstData_to_value(GValue *value, PyObject *object)
+{
+ GstData* data;
+
+ if (!pygst_data_from_pyobject(object, &data))
+ return -1;
+
+ g_value_set_boxed(value, data);
+ return 0;
+}
+
+void
+_pygst_register_boxed_types(PyObject *moddict)
+{
+ pyg_register_boxed_custom(GST_TYPE_DATA,
+ PyGstData_from_value,
+ PyGstData_to_value);
+}
#include <gst/gsterror.h>
#include <gst/gstqueue.h>
#include <gst/gsttypefind.h>
+#include <gst/gsttag.h>
typedef struct {
PyGObject *pad;
--- /dev/null
+;; -*- scheme -*-
+
+(include "xoverlay.defs")
+
+; object definitions ...
+;(define-object XWindowListener
+; (in-module "Gst")
+; (parent "GObject")
+; (c-name "GstXWindowListener")
+; (gtype-id "GST_TYPE_X_WINDOW_LISTENER")
+;)
+
+;; Enumerations and flags ...
+
+(define-enum ColorBalanceType
+ (in-module "Gst")
+ (c-name "GstColorBalanceType")
+ (gtype-id "GST_TYPE_COLOR_BALANCE_TYPE")
+ (values
+ '("hardware" "GST_COLOR_BALANCE_HARDWARE")
+ '("software" "GST_COLOR_BALANCE_SOFTWARE")
+ )
+)
+
+(define-enum MixerType
+ (in-module "Gst")
+ (c-name "GstMixerType")
+ (gtype-id "GST_TYPE_MIXER_TYPE")
+ (values
+ '("hardware" "GST_MIXER_HARDWARE")
+ '("software" "GST_MIXER_SOFTWARE")
+ )
+)
+
+
+;; From /opt/gnome/include/gstreamer-0.7/gst/colorbalance/colorbalance.h
+
+(define-function gst_color_balance_get_type
+ (c-name "gst_color_balance_get_type")
+ (return-type "GType")
+)
+
+(define-method list_channels
+ (of-object "GstColorBalance")
+ (c-name "gst_color_balance_list_channels")
+ (return-type "const-GList*")
+)
+
+(define-method set_value
+ (of-object "GstColorBalance")
+ (c-name "gst_color_balance_set_value")
+ (return-type "none")
+ (parameters
+ '("GstColorBalanceChannel*" "channel")
+ '("gint" "value")
+ )
+)
+
+(define-method get_value
+ (of-object "GstColorBalance")
+ (c-name "gst_color_balance_get_value")
+ (return-type "gint")
+ (parameters
+ '("GstColorBalanceChannel*" "channel")
+ )
+)
+
+(define-method value_changed
+ (of-object "GstColorBalance")
+ (c-name "gst_color_balance_value_changed")
+ (return-type "none")
+ (parameters
+ '("GstColorBalanceChannel*" "channel")
+ '("gint" "value")
+ )
+)
+
+
+
+;; From /opt/gnome/include/gstreamer-0.7/gst/mixer/mixer.h
+
+(define-function gst_mixer_get_type
+ (c-name "gst_mixer_get_type")
+ (return-type "GType")
+)
+
+(define-method list_tracks
+ (of-object "GstMixer")
+ (c-name "gst_mixer_list_tracks")
+ (return-type "const-GList*")
+)
+
+(define-method set_volume
+ (of-object "GstMixer")
+ (c-name "gst_mixer_set_volume")
+ (return-type "none")
+ (parameters
+ '("GstMixerTrack*" "track")
+ '("gint*" "volumes")
+ )
+)
+
+(define-method get_volume
+ (of-object "GstMixer")
+ (c-name "gst_mixer_get_volume")
+ (return-type "none")
+ (parameters
+ '("GstMixerTrack*" "track")
+ '("gint*" "volumes")
+ )
+)
+
+(define-method set_mute
+ (of-object "GstMixer")
+ (c-name "gst_mixer_set_mute")
+ (return-type "none")
+ (parameters
+ '("GstMixerTrack*" "track")
+ '("gboolean" "mute")
+ )
+)
+
+(define-method set_record
+ (of-object "GstMixer")
+ (c-name "gst_mixer_set_record")
+ (return-type "none")
+ (parameters
+ '("GstMixerTrack*" "track")
+ '("gboolean" "record")
+ )
+)
+
+(define-method mute_toggled
+ (of-object "GstMixer")
+ (c-name "gst_mixer_mute_toggled")
+ (return-type "none")
+ (parameters
+ '("GstMixerTrack*" "track")
+ '("gboolean" "mute")
+ )
+)
+
+(define-method record_toggled
+ (of-object "GstMixer")
+ (c-name "gst_mixer_record_toggled")
+ (return-type "none")
+ (parameters
+ '("GstMixerTrack*" "track")
+ '("gboolean" "record")
+ )
+)
+
+(define-method volume_changed
+ (of-object "GstMixer")
+ (c-name "gst_mixer_volume_changed")
+ (return-type "none")
+ (parameters
+ '("GstMixerTrack*" "track")
+ '("gint*" "volumes")
+ )
+)
+
+
+
+;; From /opt/gnome/include/gstreamer-0.7/gst/navigation/navigation.h
+
+(define-function gst_navigation_get_type
+ (c-name "gst_navigation_get_type")
+ (return-type "GType")
+)
+
+(define-method send_event
+ (of-object "GstNavigation")
+ (c-name "gst_navigation_send_event")
+ (return-type "none")
+ (parameters
+ '("GstStructure*" "structure")
+ )
+)
+
+(define-method send_key_event
+ (of-object "GstNavigation")
+ (c-name "gst_navigation_send_key_event")
+ (return-type "none")
+ (parameters
+ '("const-char*" "event")
+ '("const-char*" "key")
+ )
+)
+
+(define-method send_mouse_event
+ (of-object "GstNavigation")
+ (c-name "gst_navigation_send_mouse_event")
+ (return-type "none")
+ (parameters
+ '("const-char*" "event")
+ '("int" "button")
+ '("double" "x")
+ '("double" "y")
+ )
+)
+
+
+
+;; From /opt/gnome/include/gstreamer-0.7/gst/propertyprobe/propertyprobe.h
+
+(define-function gst_property_probe_get_type
+ (c-name "gst_property_probe_get_type")
+ (return-type "GType")
+)
+
+(define-method get_properties
+ (of-object "GstPropertyProbe")
+ (c-name "gst_property_probe_get_properties")
+ (return-type "const-GList*")
+)
+
+(define-method get_property
+ (of-object "GstPropertyProbe")
+ (c-name "gst_property_probe_get_property")
+ (return-type "const-GParamSpec*")
+ (parameters
+ '("const-gchar*" "name")
+ )
+)
+
+(define-method probe_property
+ (of-object "GstPropertyProbe")
+ (c-name "gst_property_probe_probe_property")
+ (return-type "none")
+ (parameters
+ '("const-GParamSpec*" "pspec")
+ )
+)
+
+(define-method probe_property_name
+ (of-object "GstPropertyProbe")
+ (c-name "gst_property_probe_probe_property_name")
+ (return-type "none")
+ (parameters
+ '("const-gchar*" "name")
+ )
+)
+
+(define-method needs_probe
+ (of-object "GstPropertyProbe")
+ (c-name "gst_property_probe_needs_probe")
+ (return-type "gboolean")
+ (parameters
+ '("const-GParamSpec*" "pspec")
+ )
+)
+
+(define-method needs_probe_name
+ (of-object "GstPropertyProbe")
+ (c-name "gst_property_probe_needs_probe_name")
+ (return-type "gboolean")
+ (parameters
+ '("const-gchar*" "name")
+ )
+)
+
+(define-method get_values
+ (of-object "GstPropertyProbe")
+ (c-name "gst_property_probe_get_values")
+ (return-type "GValueArray*")
+ (parameters
+ '("const-GParamSpec*" "pspec")
+ )
+)
+
+(define-method get_values_name
+ (of-object "GstPropertyProbe")
+ (c-name "gst_property_probe_get_values_name")
+ (return-type "GValueArray*")
+ (parameters
+ '("const-gchar*" "name")
+ )
+)
+
+(define-method probe_and_get_values
+ (of-object "GstPropertyProbe")
+ (c-name "gst_property_probe_probe_and_get_values")
+ (return-type "GValueArray*")
+ (parameters
+ '("const-GParamSpec*" "pspec")
+ )
+)
+
+(define-method probe_and_get_values_name
+ (of-object "GstPropertyProbe")
+ (c-name "gst_property_probe_probe_and_get_values_name")
+ (return-type "GValueArray*")
+ (parameters
+ '("const-gchar*" "name")
+ )
+)
+
+
+
+;; From /opt/gnome/include/gstreamer-0.7/gst/tuner/tuner.h
+
+(define-function gst_tuner_get_type
+ (c-name "gst_tuner_get_type")
+ (return-type "GType")
+)
+
+(define-method list_channels
+ (of-object "GstTuner")
+ (c-name "gst_tuner_list_channels")
+ (return-type "const-GList*")
+)
+
+(define-method set_channel
+ (of-object "GstTuner")
+ (c-name "gst_tuner_set_channel")
+ (return-type "none")
+ (parameters
+ '("GstTunerChannel*" "channel")
+ )
+)
+
+(define-method get_channel
+ (of-object "GstTuner")
+ (c-name "gst_tuner_get_channel")
+ (return-type "GstTunerChannel*")
+)
+
+(define-method list_norms
+ (of-object "GstTuner")
+ (c-name "gst_tuner_list_norms")
+ (return-type "const-GList*")
+)
+
+(define-method set_norm
+ (of-object "GstTuner")
+ (c-name "gst_tuner_set_norm")
+ (return-type "none")
+ (parameters
+ '("GstTunerNorm*" "channel")
+ )
+)
+
+(define-method get_norm
+ (of-object "GstTuner")
+ (c-name "gst_tuner_get_norm")
+ (return-type "GstTunerNorm*")
+)
+
+(define-method set_frequency
+ (of-object "GstTuner")
+ (c-name "gst_tuner_set_frequency")
+ (return-type "none")
+ (parameters
+ '("GstTunerChannel*" "channel")
+ '("gulong" "frequency")
+ )
+)
+
+(define-method get_frequency
+ (of-object "GstTuner")
+ (c-name "gst_tuner_get_frequency")
+ (return-type "gulong")
+ (parameters
+ '("GstTunerChannel*" "channel")
+ )
+)
+
+(define-method signal_strength
+ (of-object "GstTuner")
+ (c-name "gst_tuner_signal_strength")
+ (return-type "gint")
+ (parameters
+ '("GstTunerChannel*" "channel")
+ )
+)
+
+(define-method find_norm_by_name
+ (of-object "GstTuner")
+ (c-name "gst_tuner_find_norm_by_name")
+ (return-type "GstTunerNorm*")
+ (parameters
+ '("gchar*" "norm")
+ )
+)
+
+(define-method find_channel_by_name
+ (of-object "GstTuner")
+ (c-name "gst_tuner_find_channel_by_name")
+ (return-type "GstTunerChannel*")
+ (parameters
+ '("gchar*" "channel")
+ )
+)
+
+(define-method channel_changed
+ (of-object "GstTuner")
+ (c-name "gst_tuner_channel_changed")
+ (return-type "none")
+ (parameters
+ '("GstTunerChannel*" "channel")
+ )
+)
+
+(define-method norm_changed
+ (of-object "GstTuner")
+ (c-name "gst_tuner_norm_changed")
+ (return-type "none")
+ (parameters
+ '("GstTunerNorm*" "norm")
+ )
+)
+
+(define-method frequency_changed
+ (of-object "GstTuner")
+ (c-name "gst_tuner_frequency_changed")
+ (return-type "none")
+ (parameters
+ '("GstTunerChannel*" "channel")
+ '("gulong" "frequency")
+ )
+)
+
+(define-method signal_changed
+ (of-object "GstTuner")
+ (c-name "gst_tuner_signal_changed")
+ (return-type "none")
+ (parameters
+ '("GstTunerChannel*" "channel")
+ '("gint" "signal")
+ )
+)
+
+
+
+
+;; From /opt/gnome/include/gstreamer-0.7/gst/xwindowlistener/xwindowlistener.h
+
+(define-function gst_x_window_listener_get_type
+ (c-name "gst_x_window_listener_get_type")
+ (return-type "GType")
+)
+
+(define-function gst_x_window_listener_new
+ (c-name "gst_x_window_listener_new")
+ (is-constructor-of "GstXWindowListener")
+ (return-type "GstXWindowListener*")
+ (parameters
+ '("gchar*" "display")
+ '("MapWindowFunc" "map_window_func")
+ '("SetWindowFunc" "set_window_func")
+ '("gpointer" "private_data")
+ )
+)
+
+(define-method set_xid
+ (of-object "GstXWindowListener")
+ (c-name "gst_x_window_listener_set_xid")
+ (return-type "none")
+ (parameters
+ '("XID" "id")
+ )
+)
+
+
+;;
+;; interface definitions ...
+;;
+
+(define-interface ColorBalance
+ (in-module "Gst")
+ (c-name "GstColorBalance")
+ (gtype-id "GST_TYPE_COLOR_BALANCE")
+)
+
+(define-object ColorBalanceChannel
+ (in-module "Gst")
+ (parent "GstObject")
+ (c-name "GstColorBalanceChannel")
+ (gtype-id "GST_TYPE_COLOR_BALANCE_CHANNEL")
+)
+
+(define-interface Mixer
+ (in-module "Gst")
+ (c-name "GstMixer")
+ (gtype-id "GST_TYPE_MIXER")
+)
+
+(define-object MixerTrack
+ (in-module "Gst")
+ (parent "GstObject")
+ (c-name "GstMixerTrack")
+ (gtype-id "GST_TYPE_MIXER_TRACK")
+)
+
+(define-interface Navigation
+ (in-module "Gst")
+ (c-name "GstNavigation")
+ (gtype-id "GST_TYPE_NAVIGATION")
+)
+
+(define-interface PropertyProbe
+ (in-module "Gst")
+ (c-name "GstPropertyProbe")
+ (gtype-id "GST_TYPE_PROPERTY_PROBE")
+)
+
+(define-interface Tuner
+ (in-module "Gst")
+ (c-name "GstTuner")
+ (gtype-id "GST_TYPE_TUNER")
+)
+
+(define-object TunerChannel
+ (in-module "Gst")
+ (parent "GstObject")
+ (c-name "GstTunerChannel")
+ (gtype-id "GST_TYPE_TUNER_CHANNEL")
+)
+
+(define-object TunerNorm
+ (in-module "Gst")
+ (parent "GstObject")
+ (c-name "GstTunerNorm")
+ (gtype-id "GST_TYPE_TUNER_NORM")
+)
--- /dev/null
+/* -*- Mode: C; c-basic-offset: 4 -*- */
+/* gst-python
+ * Copyright (C) 2004 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 <gst/colorbalance/colorbalance.h>
+#include <gst/colorbalance/colorbalancechannel.h>
+#include <gst/mixer/mixer.h>
+#include <gst/mixer/mixertrack.h>
+#include <gst/navigation/navigation.h>
+#include <gst/propertyprobe/propertyprobe.h>
+#include <gst/tuner/tuner.h>
+#include <gst/xwindowlistener/xwindowlistener.h>
+
+%%
+modulename gstinterfaces
+%%
+import gobject.GObject as PyGObject_Type
+import gst.Object as PyGstObject_Type
+import gst.Structure as PyGstStructure_Type
+import gst.Element as PyGstElement_Type
+%%
+include
+ xoverlay.override
+%%
+ignore-glob
+ _*
+ gstinterfaces_*init
+ *_get_type
+%%
+%%
+override gst_tuner_make kwargs
+
+static PyObject *
+_wrap_gst_tuner_make(PyObject *self, PyObject *args, PyObject *kwargs)
+{
+ static char *kwlist[] = { "obj", NULL };
+ PyObject *py_value = NULL;
+ GValue value = { 0 };
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:GstStructure.set_value", kwlist, &py_value))
+ return NULL;
+ g_value_init(&value, G_TYPE_STRING);
+ if (pyg_value_from_pyobject(&value, py_value) != 0) {
+ return NULL;
+ }
+ gst_structure_set_value(pyg_boxed_get(self, GstStructure), field, &value);
+
+ Py_INCREF(Py_None);
+ return Py_None;
+}
+%%
+override gst_structure_new kwargs
+
+static int
+_wrap_gst_structure_new(PyGBoxed *self, PyObject *args, PyObject *kwargs)
+{
+ static char *kwlist[] = { "name", NULL };
+ char *name;
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s:GstStructure.__init__", kwlist, &name))
+ return -1;
+ self->gtype = GST_TYPE_STRUCTURE;
+ self->free_on_dealloc = FALSE;
+ self->boxed = gst_structure_new(name, NULL);
+
+ if (!self->boxed) {
+ PyErr_SetString(PyExc_RuntimeError, "could not create GstStructure object");
+ return -1;
+ }
+ self->free_on_dealloc = TRUE;
+ return 0;
+}
+%%
+override gst_structure_set_value kwargs
+
+static PyObject *
+_wrap_gst_structure_set_value(PyObject *self, PyObject *args, PyObject *kwargs)
+{
+ static char *kwlist[] = { "field", "value", NULL };
+ char *field;
+ PyObject *py_value = NULL;
+ GValue value = { 0 };
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "sO:GstStructure.set_value", kwlist, &field, &py_value))
+ return NULL;
+ g_value_init(&value, G_TYPE_STRING);
+ if (pyg_value_from_pyobject(&value, py_value) != 0) {
+ return NULL;
+ }
+ gst_structure_set_value(pyg_boxed_get(self, GstStructure), field, &value);
+
+ Py_INCREF(Py_None);
+ return Py_None;
+}
--- /dev/null
+/* -*- Mode: C; c-basic-offset: 4 -*- */
+/* gst-python
+ * Copyright (C) 2004 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>
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+/* include this first, before NO_IMPORT_PYGOBJECT is defined */
+#include <pygobject.h>
+#include <gst/gst.h>
+
+void pyinterfaces_register_classes (PyObject *d);
+void pyinterfaces_add_constants(PyObject *module, const gchar *strip_prefix);
+
+extern PyMethodDef pyinterfaces_functions[];
+
+DL_EXPORT(void)
+initinterfaces (void)
+{
+ PyObject *m, *d;
+
+ m = Py_InitModule ("interfaces", pyinterfaces_functions);
+ d = PyModule_GetDict (m);
+
+ pyinterfaces_register_classes (d);
+ pyinterfaces_add_constants (m, "GST_");
+
+ if (PyErr_Occurred ()) {
+ Py_FatalError ("can't initialize module gst.interfaces");
+ }
+}
--- /dev/null
+;; -*- scheme -*-
+; object definitions ...
+;; Enumerations and flags ...
+
+(define-interface XOverlay
+ (in-module "Gst")
+ (c-name "GstXOverlay")
+ (gtype-id "GST_TYPE_X_OVERLAY")
+)
+
+;; From /opt/gnome/include/gstreamer-0.7/gst/xoverlay/xoverlay.h
+
+(define-method set_xwindow_id
+ (of-object "GstXOverlay")
+ (c-name "gst_x_overlay_set_xwindow_id")
+ (return-type "none")
+ (parameters
+ '("gulong" "xwindow_id")
+ )
+)
+
+(define-method get_desired_size
+ (of-object "GstXOverlay")
+ (c-name "gst_x_overlay_get_desired_size")
+ (return-type "none")
+ (parameters
+ '("guint*" "width")
+ '("guint*" "height")
+ )
+)
+
+(define-method expose
+ (of-object "GstXOverlay")
+ (c-name "gst_x_overlay_expose")
+ (return-type "none")
+)
+
+(define-method got_xwindow_id
+ (of-object "GstXOverlay")
+ (c-name "gst_x_overlay_got_xwindow_id")
+ (return-type "none")
+ (parameters
+ '("XID" "xwindow_id")
+ )
+)
+
+(define-method got_desired_size
+ (of-object "GstXOverlay")
+ (c-name "gst_x_overlay_got_desired_size")
+ (return-type "none")
+ (parameters
+ '("guint" "width")
+ '("guint" "height")
+ )
+)
+
+
--- /dev/null
+/* -*- Mode: C; c-basic-offset: 4 -*- */
+/* gst-python
+ * Copyright (C) 2004 Johan Dahlin
+ *
+ * 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.
+ *
+ */
+%%
+headers
+
+#include <gst/xoverlay/xoverlay.h>
--- /dev/null
+;; -*- scheme -*-
+; object definitions ...
+(define-object XWindowListener
+ (in-module "Gst")
+ (parent "GObject")
+ (c-name "GstXWindowListener")
+ (gtype-id "GST_TYPE_XWINDOW_LISTENER")
+)
+
+;; Enumerations and flags ...
+
+
+;; From /opt/gnome/include/gstreamer-0.7/gst/xwindowlistener/xwindowlistener.h
+
+(define-function gst_x_window_listener_get_type
+ (c-name "gst_x_window_listener_get_type")
+ (return-type "GType")
+)
+
+(define-function gst_x_window_listener_new
+ (c-name "gst_x_window_listener_new")
+ (is-constructor-of "GstXWindowListener")
+ (return-type "GstXWindowListener*")
+ (parameters
+ '("gchar*" "display")
+ '("MapWindowFunc" "map_window_func")
+ '("SetWindowFunc" "set_window_func")
+ '("gpointer" "private_data")
+ )
+)
+
+(define-method set_xid
+ (of-object "GstXWindowListener")
+ (c-name "gst_x_window_listener_set_xid")
+ (return-type "none")
+ (parameters
+ '("XID" "id")
+ )
+)
+
+