Commit 5e7dffcf authored by Johan Dahlin's avatar Johan Dahlin

gst/*: Move interfaces over here, make it build, remove gstreamer.py

Original commit message from CVS:
* gst/*: Move interfaces over here, make it build, remove gstreamer.py
parent 5786a76d
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),
......
......@@ -4,17 +4,15 @@ else
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
......
......@@ -160,7 +160,6 @@ changequote([,])dnl
AC_OUTPUT([
Makefile
gst/Makefile
gstinterfaces/Makefile
gstplay/Makefile
pkgconfig/Makefile
pkgconfig/gst-python.pc
......
......@@ -2,3 +2,4 @@
*.pdf
*.html
gst-python.ent
tmpbuildcatalog
......@@ -9,3 +9,4 @@ Makefile.in
.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
/* 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);
}
......@@ -33,6 +33,7 @@ headers
#include <gst/gsterror.h>
#include <gst/gstqueue.h>
#include <gst/gsttypefind.h>
#include <gst/gsttag.h>
typedef struct {
PyGObject *pad;
......
This diff is collapsed.
/* -*- 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;
}
/* -*- 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");
}
}
;; -*- 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")
)
)
/* -*- 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>
;; -*- 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")
)
)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment