mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 09:10:36 +00:00
Makefile.am: add gstinterfaces dir
Original commit message from CVS: * Makefile.am: add gstinterfaces dir * configure.ac: get interfaces include dirs * gstreamer/.cvsignore: add .py[co] * gstreamer/0.6.defs: * gstreamer/0.6.override: * gstreamer/0.7.defs: * gstreamer/0.7.override: * gstreamer/common.defs: * gstreamer/common.override: rearrange code for both 0.6 and 0.7 support * gstreamer/Makefile.am: add -fno-strict-aliasing due to python issues * gstinterfaces/.cvsignore: * gstinterfaces/0.7.c: * gstinterfaces/0.7.defs: * gstinterfaces/0.7.h: * gstinterfaces/0.7.override: * gstinterfaces/Makefile.am: * gstinterfaces/__init__.py: * gstinterfaces/arg-types.py: * gstinterfaces/common.c: * gstinterfaces/common.defs: * gstinterfaces/common.h: * gstinterfaces/common.override: * gstinterfaces/gstinterfacesmodule.c: messy start of interfaces handling
This commit is contained in:
parent
cf8c160f13
commit
11e199b27c
20 changed files with 546 additions and 385 deletions
29
ChangeLog
29
ChangeLog
|
@ -1,3 +1,32 @@
|
|||
2004-01-27 David I. Lehn <dlehn@users.sourceforge.net>
|
||||
|
||||
* Makefile.am: add gstinterfaces dir
|
||||
* configure.ac: get interfaces include dirs
|
||||
* gstreamer/.cvsignore: add .py[co]
|
||||
* gstreamer/0.6.defs:
|
||||
* gstreamer/0.6.override:
|
||||
* gstreamer/0.7.defs:
|
||||
* gstreamer/0.7.override:
|
||||
* gstreamer/common.defs:
|
||||
* gstreamer/common.override: rearrange code for both 0.6 and 0.7
|
||||
support
|
||||
* gstreamer/Makefile.am: add -fno-strict-aliasing due to python
|
||||
issues
|
||||
* gstinterfaces/.cvsignore:
|
||||
* gstinterfaces/0.7.c:
|
||||
* gstinterfaces/0.7.defs:
|
||||
* gstinterfaces/0.7.h:
|
||||
* gstinterfaces/0.7.override:
|
||||
* gstinterfaces/Makefile.am:
|
||||
* gstinterfaces/__init__.py:
|
||||
* gstinterfaces/arg-types.py:
|
||||
* gstinterfaces/common.c:
|
||||
* gstinterfaces/common.defs:
|
||||
* gstinterfaces/common.h:
|
||||
* gstinterfaces/common.override:
|
||||
* gstinterfaces/gstinterfacesmodule.c: messy start of interfaces
|
||||
handling
|
||||
|
||||
2003-12-07 Gustavo J. A. M. Carneiro <gustavo@users.sourceforge.net>
|
||||
|
||||
* gstreamer/common.override
|
||||
|
|
10
Makefile.am
10
Makefile.am
|
@ -4,9 +4,15 @@ else
|
|||
SUBDIRS_DOCS =
|
||||
endif
|
||||
|
||||
SUBDIRS = gstreamer pkgconfig examples $(SUBDIRS_DOCS) testsuite
|
||||
if GST_0_6
|
||||
INTERFACESDIR =
|
||||
else
|
||||
INTERFACESDIR = gstinterfaces
|
||||
endif
|
||||
|
||||
DIST_SUBDIRS = gstreamer pkgconfig examples docs testsuite
|
||||
UNCONDDIRS = gstreamer pkgconfig examples testsuite
|
||||
SUBDIRS = $(UNCONDDIRS) $(SUBDIRS_DOCS) $(INTERFACESDIR)
|
||||
DIST_SUBDIRS = $(UNCONDDIRS) docs gstinterfaces
|
||||
|
||||
EXTRA_DIST = \
|
||||
gst-python.spec.in gst-python.spec README-docs
|
||||
|
|
2
common
2
common
|
@ -1 +1 @@
|
|||
Subproject commit cd5507ae3df8dc48c07df9e37878846b6b79faa1
|
||||
Subproject commit 0bcde342015b96d9a6ba3b9d9102e2a543399d96
|
18
configure.ac
18
configure.ac
|
@ -88,13 +88,22 @@ AC_MSG_RESULT($PYGTK_H2DEF)
|
|||
#dnl check to make sure we can find gtk
|
||||
#AM_PATH_GTK_2_0(gtk_required_version,,[AC_MSG_ERROR(maybe you want the gtk-gnome-1-2 branch?)],$extra_mods)
|
||||
|
||||
AC_MSG_CHECKING(for gstreamer include dir)
|
||||
AC_MSG_CHECKING(for GStreamer include dir)
|
||||
GST_INCLUDEDIR=`$PKG_CONFIG --variable=includedir gstreamer-$GST_MAJORMINOR`
|
||||
|
||||
AC_SUBST(GST_INCLUDEDIR)
|
||||
AC_MSG_RESULT($GST_INCLUDEDIR)
|
||||
if test "x$GST_INCLUDEDIR" = "x"; then
|
||||
AC_MSG_ERROR(no gstreamer include dir found)
|
||||
AC_MSG_ERROR(no GStreamer include dir found)
|
||||
fi
|
||||
AC_SUBST(GST_INCLUDEDIR)
|
||||
|
||||
if test "x$GST_MAJORMINOR" != "x0.6"; then
|
||||
AC_MSG_CHECKING(for GStreamer interfaces include dir)
|
||||
GST_INTERFACES_INCLUDEDIR=`$PKG_CONFIG --variable=includedir gstreamer-interfaces-$GST_MAJORMINOR`
|
||||
AC_MSG_RESULT($GST_INTERFACES_INCLUDEDIR)
|
||||
if test "x$GST_INTERFACES_INCLUDEDIR" = "x"; then
|
||||
AC_MSG_ERROR(no GStreamer interfaces include dir found)
|
||||
fi
|
||||
AC_SUBST(GST_INTERFACES_INCLUDEDIR)
|
||||
fi
|
||||
|
||||
|
||||
|
@ -143,6 +152,7 @@ changequote([,])dnl
|
|||
AC_OUTPUT([
|
||||
Makefile
|
||||
gstreamer/Makefile
|
||||
gstinterfaces/Makefile
|
||||
pkgconfig/Makefile
|
||||
pkgconfig/gst-python.pc
|
||||
pkgconfig/gst-python-uninstalled.pc
|
||||
|
|
2
gst/.gitignore
vendored
2
gst/.gitignore
vendored
|
@ -4,7 +4,7 @@ Makefile.in
|
|||
*.lo
|
||||
*.la
|
||||
*.so
|
||||
*.pyc
|
||||
*.py[co]
|
||||
.libs
|
||||
.deps
|
||||
gstreamer.c
|
||||
|
|
33
gst/0.6.defs
33
gst/0.6.defs
|
@ -7,3 +7,36 @@
|
|||
(c-name "gst_props_entry_get_props_type")
|
||||
(return-type "GstPropsType")
|
||||
)
|
||||
|
||||
;;
|
||||
;; Access GstProps properties list
|
||||
;;
|
||||
|
||||
(define-method get_list
|
||||
(of-object "GstProps")
|
||||
(c-name "gst_props_get_list")
|
||||
(return-type "const-GList*")
|
||||
)
|
||||
|
||||
;;
|
||||
;; 0.6 Boxed types
|
||||
;;
|
||||
|
||||
(define-boxed BufferPool
|
||||
(in-module "Gst")
|
||||
(c-name "GstBufferPool")
|
||||
(gtype-id "GST_TYPE_BUFFER_POOL")
|
||||
)
|
||||
|
||||
(define-boxed Props
|
||||
(in-module "Gst")
|
||||
(c-name "GstProps")
|
||||
(gtype-id "GST_TYPE_PROPS")
|
||||
)
|
||||
|
||||
(define-boxed PropsEntry
|
||||
(in-module "Gst")
|
||||
(c-name "GstPropsEntry")
|
||||
(gtype-id "GST_TYPE_PROPS_ENTRY")
|
||||
)
|
||||
|
||||
|
|
159
gst/0.6.override
159
gst/0.6.override
|
@ -27,3 +27,162 @@ headers
|
|||
#include <gst/gst.h>
|
||||
|
||||
#include "0.6.h"
|
||||
%%
|
||||
override gst_props_entry_get_int
|
||||
|
||||
static PyObject *
|
||||
_wrap_gst_props_entry_get_int(PyObject *self)
|
||||
{
|
||||
gboolean ret;
|
||||
gint val;
|
||||
|
||||
val = 0;
|
||||
ret = gst_props_entry_get_int(pyg_boxed_get(self, GstPropsEntry), &val);
|
||||
return Py_BuildValue("(bi)", ret, val);
|
||||
}
|
||||
%%
|
||||
override gst_props_entry_get_float
|
||||
|
||||
static PyObject *
|
||||
_wrap_gst_props_entry_get_float(PyObject *self)
|
||||
{
|
||||
gboolean ret;
|
||||
gfloat val;
|
||||
|
||||
val = 0.0f;
|
||||
ret = gst_props_entry_get_float(pyg_boxed_get(self, GstPropsEntry), &val);
|
||||
return Py_BuildValue("(bf)", ret, val);
|
||||
}
|
||||
%%
|
||||
override gst_props_entry_get_fourcc_int
|
||||
|
||||
static PyObject *
|
||||
_wrap_gst_props_entry_get_fourcc_int(PyObject *self)
|
||||
{
|
||||
gboolean ret;
|
||||
gint32 val;
|
||||
|
||||
val = 0;
|
||||
ret = gst_props_entry_get_fourcc_int(pyg_boxed_get(self, GstPropsEntry), &val);
|
||||
return Py_BuildValue("(bi)", ret, val);
|
||||
}
|
||||
%%
|
||||
override gst_props_entry_get_boolean
|
||||
|
||||
static PyObject *
|
||||
_wrap_gst_props_entry_get_boolean(PyObject *self)
|
||||
{
|
||||
gboolean ret;
|
||||
gboolean val;
|
||||
PyObject *py_val;
|
||||
|
||||
val = FALSE;
|
||||
ret = gst_props_entry_get_boolean(pyg_boxed_get(self, GstPropsEntry), &val);
|
||||
|
||||
py_val = val ? Py_True : Py_False;
|
||||
return Py_BuildValue("(bO)", ret, py_val);
|
||||
}
|
||||
%%
|
||||
override gst_props_entry_get_string
|
||||
|
||||
static PyObject *
|
||||
_wrap_gst_props_entry_get_string(PyObject *self)
|
||||
{
|
||||
gboolean ret;
|
||||
const gchar *val;
|
||||
|
||||
val = NULL;
|
||||
ret = gst_props_entry_get_string(pyg_boxed_get(self, GstPropsEntry), &val);
|
||||
if (ret) {
|
||||
return Py_BuildValue("(bs)", ret, val);
|
||||
} else {
|
||||
return Py_BuildValue("(bO)", ret, Py_None);
|
||||
}
|
||||
}
|
||||
%%
|
||||
override gst_props_entry_get_int_range
|
||||
|
||||
static PyObject *
|
||||
_wrap_gst_props_entry_get_int_range(PyObject *self)
|
||||
{
|
||||
gboolean ret;
|
||||
gint min, max;
|
||||
|
||||
min = max = 0;
|
||||
ret = gst_props_entry_get_int_range(pyg_boxed_get(self, GstPropsEntry), &min, &max);
|
||||
return Py_BuildValue("(bii)", ret, min, max);
|
||||
}
|
||||
%%
|
||||
override gst_props_entry_get_float_range
|
||||
|
||||
static PyObject *
|
||||
_wrap_gst_props_entry_get_float_range(PyObject *self)
|
||||
{
|
||||
gboolean ret;
|
||||
gfloat min, max;
|
||||
|
||||
min = max = 0.0f;
|
||||
ret = gst_props_entry_get_float_range(pyg_boxed_get(self, GstPropsEntry), &min, &max);
|
||||
return Py_BuildValue("(bff)", ret, min, max);
|
||||
}
|
||||
%%
|
||||
override gst_props_entry_get_list
|
||||
|
||||
|
||||
|
||||
static PyObject *
|
||||
_wrap_gst_props_entry_get_list(PyObject *self)
|
||||
{
|
||||
gboolean ret;
|
||||
const GList *list;
|
||||
PyObject *tuple, *obj;
|
||||
int i;
|
||||
|
||||
list = NULL;
|
||||
ret = gst_props_entry_get_list(pyg_boxed_get(self, GstPropsEntry), &list);
|
||||
if (ret == TRUE) {
|
||||
tuple = PyTuple_New(g_list_length((GList *) list));
|
||||
for (i = 0; list != NULL; i++, list = g_list_next(list)) {
|
||||
obj = pyg_boxed_new(GST_TYPE_PROPS_ENTRY, list->data, TRUE, TRUE);
|
||||
PyTuple_SET_ITEM(tuple, i, obj);
|
||||
}
|
||||
} else {
|
||||
tuple = Py_None;
|
||||
Py_INCREF(tuple);
|
||||
}
|
||||
return Py_BuildValue("(bO)", ret, tuple);
|
||||
}
|
||||
%%
|
||||
override gst_props_get_list
|
||||
|
||||
static gboolean
|
||||
gst_props_get_list(GstProps *props, GList **list)
|
||||
{
|
||||
*list = GST_PROPS_PROPERTIES(props);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static PyObject *
|
||||
_wrap_gst_props_get_list(PyObject *self)
|
||||
{
|
||||
gboolean ret;
|
||||
GList *list;
|
||||
PyObject *tuple, *obj;
|
||||
int i;
|
||||
|
||||
list = NULL;
|
||||
ret = gst_props_get_list(pyg_boxed_get(self, GstProps), &list);
|
||||
if (ret == TRUE) {
|
||||
tuple = PyTuple_New(g_list_length(list));
|
||||
for (i = 0; list != NULL; i++, list = g_list_next(list)) {
|
||||
obj = pyg_boxed_new(GST_TYPE_PROPS_ENTRY, list->data, TRUE, TRUE);
|
||||
PyTuple_SET_ITEM(tuple, i, obj);
|
||||
}
|
||||
} else {
|
||||
tuple = Py_None;
|
||||
Py_INCREF(tuple);
|
||||
}
|
||||
return Py_BuildValue("(bO)", ret, tuple);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
;;
|
||||
;; 0.7 Boxed types
|
||||
;;
|
||||
|
||||
(define-boxed Structure
|
||||
(in-module "Gst")
|
||||
(c-name "GstStructure")
|
||||
(gtype-id "GST_TYPE_STRUCTURE")
|
||||
)
|
|
@ -27,3 +27,47 @@ headers
|
|||
#include <gst/gst.h>
|
||||
|
||||
#include "0.7.h"
|
||||
%%
|
||||
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;
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ _gstreamermodule_la_SOURCES = \
|
|||
gstreamermodule.c \
|
||||
common.c common.h \
|
||||
$(VERSOURCES)
|
||||
_gstreamermodule_la_CFLAGS = $(GST_CFLAGS)
|
||||
_gstreamermodule_la_CFLAGS = $(GST_CFLAGS) -fno-strict-aliasing
|
||||
_gstreamermodule_la_LIBADD = $(GST_LIBS)
|
||||
_gstreamermodule_la_LDFLAGS = -module -avoid-version -export-symbols-regex init_gstreamer
|
||||
nodist__gstreamermodule_la_SOURCES = gstreamer.c
|
||||
|
|
|
@ -8,12 +8,6 @@
|
|||
(gtype-id "GST_TYPE_BUFFER")
|
||||
)
|
||||
|
||||
(define-boxed BufferPool
|
||||
(in-module "Gst")
|
||||
(c-name "GstBufferPool")
|
||||
(gtype-id "GST_TYPE_BUFFER_POOL")
|
||||
)
|
||||
|
||||
(define-boxed Caps
|
||||
(in-module "Gst")
|
||||
(c-name "GstCaps")
|
||||
|
@ -26,28 +20,6 @@
|
|||
(gtype-id "GST_TYPE_EVENT")
|
||||
)
|
||||
|
||||
(define-boxed Props
|
||||
(in-module "Gst")
|
||||
(c-name "GstProps")
|
||||
(gtype-id "GST_TYPE_PROPS")
|
||||
)
|
||||
|
||||
(define-boxed PropsEntry
|
||||
(in-module "Gst")
|
||||
(c-name "GstPropsEntry")
|
||||
(gtype-id "GST_TYPE_PROPS_ENTRY")
|
||||
)
|
||||
|
||||
;;
|
||||
;; Access GstProps properties list
|
||||
;;
|
||||
|
||||
(define-method get_list
|
||||
(of-object "GstProps")
|
||||
(c-name "gst_props_get_list")
|
||||
(return-type "const-GList*")
|
||||
)
|
||||
|
||||
;;
|
||||
;; Accelerate common GstBin iterate loop
|
||||
;;
|
||||
|
|
|
@ -336,165 +336,6 @@ _wrap_gst_element_convert(PyGObject *self, PyObject *args, PyObject *kwargs)
|
|||
ret = gst_element_convert(GST_ELEMENT(self->obj), src_format, src_value, &dest_format, &dest_value);
|
||||
return Py_BuildValue("(bL)", ret, dest_value);
|
||||
}
|
||||
%%
|
||||
override gst_props_entry_get_int
|
||||
|
||||
static PyObject *
|
||||
_wrap_gst_props_entry_get_int(PyObject *self)
|
||||
{
|
||||
gboolean ret;
|
||||
gint val;
|
||||
|
||||
val = 0;
|
||||
ret = gst_props_entry_get_int(pyg_boxed_get(self, GstPropsEntry), &val);
|
||||
return Py_BuildValue("(bi)", ret, val);
|
||||
}
|
||||
%%
|
||||
override gst_props_entry_get_float
|
||||
|
||||
static PyObject *
|
||||
_wrap_gst_props_entry_get_float(PyObject *self)
|
||||
{
|
||||
gboolean ret;
|
||||
gfloat val;
|
||||
|
||||
val = 0.0f;
|
||||
ret = gst_props_entry_get_float(pyg_boxed_get(self, GstPropsEntry), &val);
|
||||
return Py_BuildValue("(bf)", ret, val);
|
||||
}
|
||||
%%
|
||||
override gst_props_entry_get_fourcc_int
|
||||
|
||||
static PyObject *
|
||||
_wrap_gst_props_entry_get_fourcc_int(PyObject *self)
|
||||
{
|
||||
gboolean ret;
|
||||
gint32 val;
|
||||
|
||||
val = 0;
|
||||
ret = gst_props_entry_get_fourcc_int(pyg_boxed_get(self, GstPropsEntry), &val);
|
||||
return Py_BuildValue("(bi)", ret, val);
|
||||
}
|
||||
%%
|
||||
override gst_props_entry_get_boolean
|
||||
|
||||
static PyObject *
|
||||
_wrap_gst_props_entry_get_boolean(PyObject *self)
|
||||
{
|
||||
gboolean ret;
|
||||
gboolean val;
|
||||
PyObject *py_val;
|
||||
|
||||
val = FALSE;
|
||||
ret = gst_props_entry_get_boolean(pyg_boxed_get(self, GstPropsEntry), &val);
|
||||
|
||||
py_val = val ? Py_True : Py_False;
|
||||
return Py_BuildValue("(bO)", ret, py_val);
|
||||
}
|
||||
%%
|
||||
override gst_props_entry_get_string
|
||||
|
||||
static PyObject *
|
||||
_wrap_gst_props_entry_get_string(PyObject *self)
|
||||
{
|
||||
gboolean ret;
|
||||
const gchar *val;
|
||||
|
||||
val = NULL;
|
||||
ret = gst_props_entry_get_string(pyg_boxed_get(self, GstPropsEntry), &val);
|
||||
if (ret) {
|
||||
return Py_BuildValue("(bs)", ret, val);
|
||||
} else {
|
||||
return Py_BuildValue("(bO)", ret, Py_None);
|
||||
}
|
||||
}
|
||||
%%
|
||||
override gst_props_entry_get_int_range
|
||||
|
||||
static PyObject *
|
||||
_wrap_gst_props_entry_get_int_range(PyObject *self)
|
||||
{
|
||||
gboolean ret;
|
||||
gint min, max;
|
||||
|
||||
min = max = 0;
|
||||
ret = gst_props_entry_get_int_range(pyg_boxed_get(self, GstPropsEntry), &min, &max);
|
||||
return Py_BuildValue("(bii)", ret, min, max);
|
||||
}
|
||||
%%
|
||||
override gst_props_entry_get_float_range
|
||||
|
||||
static PyObject *
|
||||
_wrap_gst_props_entry_get_float_range(PyObject *self)
|
||||
{
|
||||
gboolean ret;
|
||||
gfloat min, max;
|
||||
|
||||
min = max = 0.0f;
|
||||
ret = gst_props_entry_get_float_range(pyg_boxed_get(self, GstPropsEntry), &min, &max);
|
||||
return Py_BuildValue("(bff)", ret, min, max);
|
||||
}
|
||||
%%
|
||||
override gst_props_entry_get_list
|
||||
|
||||
|
||||
|
||||
static PyObject *
|
||||
_wrap_gst_props_entry_get_list(PyObject *self)
|
||||
{
|
||||
gboolean ret;
|
||||
const GList *list;
|
||||
PyObject *tuple, *obj;
|
||||
int i;
|
||||
|
||||
list = NULL;
|
||||
ret = gst_props_entry_get_list(pyg_boxed_get(self, GstPropsEntry), &list);
|
||||
if (ret == TRUE) {
|
||||
tuple = PyTuple_New(g_list_length((GList *) list));
|
||||
for (i = 0; list != NULL; i++, list = g_list_next(list)) {
|
||||
obj = pyg_boxed_new(GST_TYPE_PROPS_ENTRY, list->data, TRUE, TRUE);
|
||||
PyTuple_SET_ITEM(tuple, i, obj);
|
||||
}
|
||||
} else {
|
||||
tuple = Py_None;
|
||||
Py_INCREF(tuple);
|
||||
}
|
||||
return Py_BuildValue("(bO)", ret, tuple);
|
||||
}
|
||||
%%
|
||||
override gst_props_get_list
|
||||
|
||||
static gboolean
|
||||
gst_props_get_list(GstProps *props, GList **list)
|
||||
{
|
||||
*list = GST_PROPS_PROPERTIES(props);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static PyObject *
|
||||
_wrap_gst_props_get_list(PyObject *self)
|
||||
{
|
||||
gboolean ret;
|
||||
GList *list;
|
||||
PyObject *tuple, *obj;
|
||||
int i;
|
||||
|
||||
list = NULL;
|
||||
ret = gst_props_get_list(pyg_boxed_get(self, GstProps), &list);
|
||||
if (ret == TRUE) {
|
||||
tuple = PyTuple_New(g_list_length(list));
|
||||
for (i = 0; list != NULL; i++, list = g_list_next(list)) {
|
||||
obj = pyg_boxed_new(GST_TYPE_PROPS_ENTRY, list->data, TRUE, TRUE);
|
||||
PyTuple_SET_ITEM(tuple, i, obj);
|
||||
}
|
||||
} else {
|
||||
tuple = Py_None;
|
||||
Py_INCREF(tuple);
|
||||
}
|
||||
return Py_BuildValue("(bO)", ret, tuple);
|
||||
}
|
||||
|
||||
|
||||
%%
|
||||
override gst_element_factory_make_element
|
||||
|
||||
|
|
2
gstreamer/.gitignore
vendored
2
gstreamer/.gitignore
vendored
|
@ -4,7 +4,7 @@ Makefile.in
|
|||
*.lo
|
||||
*.la
|
||||
*.so
|
||||
*.pyc
|
||||
*.py[co]
|
||||
.libs
|
||||
.deps
|
||||
gstreamer.c
|
||||
|
|
|
@ -7,3 +7,36 @@
|
|||
(c-name "gst_props_entry_get_props_type")
|
||||
(return-type "GstPropsType")
|
||||
)
|
||||
|
||||
;;
|
||||
;; Access GstProps properties list
|
||||
;;
|
||||
|
||||
(define-method get_list
|
||||
(of-object "GstProps")
|
||||
(c-name "gst_props_get_list")
|
||||
(return-type "const-GList*")
|
||||
)
|
||||
|
||||
;;
|
||||
;; 0.6 Boxed types
|
||||
;;
|
||||
|
||||
(define-boxed BufferPool
|
||||
(in-module "Gst")
|
||||
(c-name "GstBufferPool")
|
||||
(gtype-id "GST_TYPE_BUFFER_POOL")
|
||||
)
|
||||
|
||||
(define-boxed Props
|
||||
(in-module "Gst")
|
||||
(c-name "GstProps")
|
||||
(gtype-id "GST_TYPE_PROPS")
|
||||
)
|
||||
|
||||
(define-boxed PropsEntry
|
||||
(in-module "Gst")
|
||||
(c-name "GstPropsEntry")
|
||||
(gtype-id "GST_TYPE_PROPS_ENTRY")
|
||||
)
|
||||
|
||||
|
|
|
@ -27,3 +27,162 @@ headers
|
|||
#include <gst/gst.h>
|
||||
|
||||
#include "0.6.h"
|
||||
%%
|
||||
override gst_props_entry_get_int
|
||||
|
||||
static PyObject *
|
||||
_wrap_gst_props_entry_get_int(PyObject *self)
|
||||
{
|
||||
gboolean ret;
|
||||
gint val;
|
||||
|
||||
val = 0;
|
||||
ret = gst_props_entry_get_int(pyg_boxed_get(self, GstPropsEntry), &val);
|
||||
return Py_BuildValue("(bi)", ret, val);
|
||||
}
|
||||
%%
|
||||
override gst_props_entry_get_float
|
||||
|
||||
static PyObject *
|
||||
_wrap_gst_props_entry_get_float(PyObject *self)
|
||||
{
|
||||
gboolean ret;
|
||||
gfloat val;
|
||||
|
||||
val = 0.0f;
|
||||
ret = gst_props_entry_get_float(pyg_boxed_get(self, GstPropsEntry), &val);
|
||||
return Py_BuildValue("(bf)", ret, val);
|
||||
}
|
||||
%%
|
||||
override gst_props_entry_get_fourcc_int
|
||||
|
||||
static PyObject *
|
||||
_wrap_gst_props_entry_get_fourcc_int(PyObject *self)
|
||||
{
|
||||
gboolean ret;
|
||||
gint32 val;
|
||||
|
||||
val = 0;
|
||||
ret = gst_props_entry_get_fourcc_int(pyg_boxed_get(self, GstPropsEntry), &val);
|
||||
return Py_BuildValue("(bi)", ret, val);
|
||||
}
|
||||
%%
|
||||
override gst_props_entry_get_boolean
|
||||
|
||||
static PyObject *
|
||||
_wrap_gst_props_entry_get_boolean(PyObject *self)
|
||||
{
|
||||
gboolean ret;
|
||||
gboolean val;
|
||||
PyObject *py_val;
|
||||
|
||||
val = FALSE;
|
||||
ret = gst_props_entry_get_boolean(pyg_boxed_get(self, GstPropsEntry), &val);
|
||||
|
||||
py_val = val ? Py_True : Py_False;
|
||||
return Py_BuildValue("(bO)", ret, py_val);
|
||||
}
|
||||
%%
|
||||
override gst_props_entry_get_string
|
||||
|
||||
static PyObject *
|
||||
_wrap_gst_props_entry_get_string(PyObject *self)
|
||||
{
|
||||
gboolean ret;
|
||||
const gchar *val;
|
||||
|
||||
val = NULL;
|
||||
ret = gst_props_entry_get_string(pyg_boxed_get(self, GstPropsEntry), &val);
|
||||
if (ret) {
|
||||
return Py_BuildValue("(bs)", ret, val);
|
||||
} else {
|
||||
return Py_BuildValue("(bO)", ret, Py_None);
|
||||
}
|
||||
}
|
||||
%%
|
||||
override gst_props_entry_get_int_range
|
||||
|
||||
static PyObject *
|
||||
_wrap_gst_props_entry_get_int_range(PyObject *self)
|
||||
{
|
||||
gboolean ret;
|
||||
gint min, max;
|
||||
|
||||
min = max = 0;
|
||||
ret = gst_props_entry_get_int_range(pyg_boxed_get(self, GstPropsEntry), &min, &max);
|
||||
return Py_BuildValue("(bii)", ret, min, max);
|
||||
}
|
||||
%%
|
||||
override gst_props_entry_get_float_range
|
||||
|
||||
static PyObject *
|
||||
_wrap_gst_props_entry_get_float_range(PyObject *self)
|
||||
{
|
||||
gboolean ret;
|
||||
gfloat min, max;
|
||||
|
||||
min = max = 0.0f;
|
||||
ret = gst_props_entry_get_float_range(pyg_boxed_get(self, GstPropsEntry), &min, &max);
|
||||
return Py_BuildValue("(bff)", ret, min, max);
|
||||
}
|
||||
%%
|
||||
override gst_props_entry_get_list
|
||||
|
||||
|
||||
|
||||
static PyObject *
|
||||
_wrap_gst_props_entry_get_list(PyObject *self)
|
||||
{
|
||||
gboolean ret;
|
||||
const GList *list;
|
||||
PyObject *tuple, *obj;
|
||||
int i;
|
||||
|
||||
list = NULL;
|
||||
ret = gst_props_entry_get_list(pyg_boxed_get(self, GstPropsEntry), &list);
|
||||
if (ret == TRUE) {
|
||||
tuple = PyTuple_New(g_list_length((GList *) list));
|
||||
for (i = 0; list != NULL; i++, list = g_list_next(list)) {
|
||||
obj = pyg_boxed_new(GST_TYPE_PROPS_ENTRY, list->data, TRUE, TRUE);
|
||||
PyTuple_SET_ITEM(tuple, i, obj);
|
||||
}
|
||||
} else {
|
||||
tuple = Py_None;
|
||||
Py_INCREF(tuple);
|
||||
}
|
||||
return Py_BuildValue("(bO)", ret, tuple);
|
||||
}
|
||||
%%
|
||||
override gst_props_get_list
|
||||
|
||||
static gboolean
|
||||
gst_props_get_list(GstProps *props, GList **list)
|
||||
{
|
||||
*list = GST_PROPS_PROPERTIES(props);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static PyObject *
|
||||
_wrap_gst_props_get_list(PyObject *self)
|
||||
{
|
||||
gboolean ret;
|
||||
GList *list;
|
||||
PyObject *tuple, *obj;
|
||||
int i;
|
||||
|
||||
list = NULL;
|
||||
ret = gst_props_get_list(pyg_boxed_get(self, GstProps), &list);
|
||||
if (ret == TRUE) {
|
||||
tuple = PyTuple_New(g_list_length(list));
|
||||
for (i = 0; list != NULL; i++, list = g_list_next(list)) {
|
||||
obj = pyg_boxed_new(GST_TYPE_PROPS_ENTRY, list->data, TRUE, TRUE);
|
||||
PyTuple_SET_ITEM(tuple, i, obj);
|
||||
}
|
||||
} else {
|
||||
tuple = Py_None;
|
||||
Py_INCREF(tuple);
|
||||
}
|
||||
return Py_BuildValue("(bO)", ret, tuple);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
;;
|
||||
;; 0.7 Boxed types
|
||||
;;
|
||||
|
||||
(define-boxed Structure
|
||||
(in-module "Gst")
|
||||
(c-name "GstStructure")
|
||||
(gtype-id "GST_TYPE_STRUCTURE")
|
||||
)
|
|
@ -27,3 +27,47 @@ headers
|
|||
#include <gst/gst.h>
|
||||
|
||||
#include "0.7.h"
|
||||
%%
|
||||
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;
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ _gstreamermodule_la_SOURCES = \
|
|||
gstreamermodule.c \
|
||||
common.c common.h \
|
||||
$(VERSOURCES)
|
||||
_gstreamermodule_la_CFLAGS = $(GST_CFLAGS)
|
||||
_gstreamermodule_la_CFLAGS = $(GST_CFLAGS) -fno-strict-aliasing
|
||||
_gstreamermodule_la_LIBADD = $(GST_LIBS)
|
||||
_gstreamermodule_la_LDFLAGS = -module -avoid-version -export-symbols-regex init_gstreamer
|
||||
nodist__gstreamermodule_la_SOURCES = gstreamer.c
|
||||
|
|
|
@ -8,12 +8,6 @@
|
|||
(gtype-id "GST_TYPE_BUFFER")
|
||||
)
|
||||
|
||||
(define-boxed BufferPool
|
||||
(in-module "Gst")
|
||||
(c-name "GstBufferPool")
|
||||
(gtype-id "GST_TYPE_BUFFER_POOL")
|
||||
)
|
||||
|
||||
(define-boxed Caps
|
||||
(in-module "Gst")
|
||||
(c-name "GstCaps")
|
||||
|
@ -26,28 +20,6 @@
|
|||
(gtype-id "GST_TYPE_EVENT")
|
||||
)
|
||||
|
||||
(define-boxed Props
|
||||
(in-module "Gst")
|
||||
(c-name "GstProps")
|
||||
(gtype-id "GST_TYPE_PROPS")
|
||||
)
|
||||
|
||||
(define-boxed PropsEntry
|
||||
(in-module "Gst")
|
||||
(c-name "GstPropsEntry")
|
||||
(gtype-id "GST_TYPE_PROPS_ENTRY")
|
||||
)
|
||||
|
||||
;;
|
||||
;; Access GstProps properties list
|
||||
;;
|
||||
|
||||
(define-method get_list
|
||||
(of-object "GstProps")
|
||||
(c-name "gst_props_get_list")
|
||||
(return-type "const-GList*")
|
||||
)
|
||||
|
||||
;;
|
||||
;; Accelerate common GstBin iterate loop
|
||||
;;
|
||||
|
|
|
@ -336,165 +336,6 @@ _wrap_gst_element_convert(PyGObject *self, PyObject *args, PyObject *kwargs)
|
|||
ret = gst_element_convert(GST_ELEMENT(self->obj), src_format, src_value, &dest_format, &dest_value);
|
||||
return Py_BuildValue("(bL)", ret, dest_value);
|
||||
}
|
||||
%%
|
||||
override gst_props_entry_get_int
|
||||
|
||||
static PyObject *
|
||||
_wrap_gst_props_entry_get_int(PyObject *self)
|
||||
{
|
||||
gboolean ret;
|
||||
gint val;
|
||||
|
||||
val = 0;
|
||||
ret = gst_props_entry_get_int(pyg_boxed_get(self, GstPropsEntry), &val);
|
||||
return Py_BuildValue("(bi)", ret, val);
|
||||
}
|
||||
%%
|
||||
override gst_props_entry_get_float
|
||||
|
||||
static PyObject *
|
||||
_wrap_gst_props_entry_get_float(PyObject *self)
|
||||
{
|
||||
gboolean ret;
|
||||
gfloat val;
|
||||
|
||||
val = 0.0f;
|
||||
ret = gst_props_entry_get_float(pyg_boxed_get(self, GstPropsEntry), &val);
|
||||
return Py_BuildValue("(bf)", ret, val);
|
||||
}
|
||||
%%
|
||||
override gst_props_entry_get_fourcc_int
|
||||
|
||||
static PyObject *
|
||||
_wrap_gst_props_entry_get_fourcc_int(PyObject *self)
|
||||
{
|
||||
gboolean ret;
|
||||
gint32 val;
|
||||
|
||||
val = 0;
|
||||
ret = gst_props_entry_get_fourcc_int(pyg_boxed_get(self, GstPropsEntry), &val);
|
||||
return Py_BuildValue("(bi)", ret, val);
|
||||
}
|
||||
%%
|
||||
override gst_props_entry_get_boolean
|
||||
|
||||
static PyObject *
|
||||
_wrap_gst_props_entry_get_boolean(PyObject *self)
|
||||
{
|
||||
gboolean ret;
|
||||
gboolean val;
|
||||
PyObject *py_val;
|
||||
|
||||
val = FALSE;
|
||||
ret = gst_props_entry_get_boolean(pyg_boxed_get(self, GstPropsEntry), &val);
|
||||
|
||||
py_val = val ? Py_True : Py_False;
|
||||
return Py_BuildValue("(bO)", ret, py_val);
|
||||
}
|
||||
%%
|
||||
override gst_props_entry_get_string
|
||||
|
||||
static PyObject *
|
||||
_wrap_gst_props_entry_get_string(PyObject *self)
|
||||
{
|
||||
gboolean ret;
|
||||
const gchar *val;
|
||||
|
||||
val = NULL;
|
||||
ret = gst_props_entry_get_string(pyg_boxed_get(self, GstPropsEntry), &val);
|
||||
if (ret) {
|
||||
return Py_BuildValue("(bs)", ret, val);
|
||||
} else {
|
||||
return Py_BuildValue("(bO)", ret, Py_None);
|
||||
}
|
||||
}
|
||||
%%
|
||||
override gst_props_entry_get_int_range
|
||||
|
||||
static PyObject *
|
||||
_wrap_gst_props_entry_get_int_range(PyObject *self)
|
||||
{
|
||||
gboolean ret;
|
||||
gint min, max;
|
||||
|
||||
min = max = 0;
|
||||
ret = gst_props_entry_get_int_range(pyg_boxed_get(self, GstPropsEntry), &min, &max);
|
||||
return Py_BuildValue("(bii)", ret, min, max);
|
||||
}
|
||||
%%
|
||||
override gst_props_entry_get_float_range
|
||||
|
||||
static PyObject *
|
||||
_wrap_gst_props_entry_get_float_range(PyObject *self)
|
||||
{
|
||||
gboolean ret;
|
||||
gfloat min, max;
|
||||
|
||||
min = max = 0.0f;
|
||||
ret = gst_props_entry_get_float_range(pyg_boxed_get(self, GstPropsEntry), &min, &max);
|
||||
return Py_BuildValue("(bff)", ret, min, max);
|
||||
}
|
||||
%%
|
||||
override gst_props_entry_get_list
|
||||
|
||||
|
||||
|
||||
static PyObject *
|
||||
_wrap_gst_props_entry_get_list(PyObject *self)
|
||||
{
|
||||
gboolean ret;
|
||||
const GList *list;
|
||||
PyObject *tuple, *obj;
|
||||
int i;
|
||||
|
||||
list = NULL;
|
||||
ret = gst_props_entry_get_list(pyg_boxed_get(self, GstPropsEntry), &list);
|
||||
if (ret == TRUE) {
|
||||
tuple = PyTuple_New(g_list_length((GList *) list));
|
||||
for (i = 0; list != NULL; i++, list = g_list_next(list)) {
|
||||
obj = pyg_boxed_new(GST_TYPE_PROPS_ENTRY, list->data, TRUE, TRUE);
|
||||
PyTuple_SET_ITEM(tuple, i, obj);
|
||||
}
|
||||
} else {
|
||||
tuple = Py_None;
|
||||
Py_INCREF(tuple);
|
||||
}
|
||||
return Py_BuildValue("(bO)", ret, tuple);
|
||||
}
|
||||
%%
|
||||
override gst_props_get_list
|
||||
|
||||
static gboolean
|
||||
gst_props_get_list(GstProps *props, GList **list)
|
||||
{
|
||||
*list = GST_PROPS_PROPERTIES(props);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static PyObject *
|
||||
_wrap_gst_props_get_list(PyObject *self)
|
||||
{
|
||||
gboolean ret;
|
||||
GList *list;
|
||||
PyObject *tuple, *obj;
|
||||
int i;
|
||||
|
||||
list = NULL;
|
||||
ret = gst_props_get_list(pyg_boxed_get(self, GstProps), &list);
|
||||
if (ret == TRUE) {
|
||||
tuple = PyTuple_New(g_list_length(list));
|
||||
for (i = 0; list != NULL; i++, list = g_list_next(list)) {
|
||||
obj = pyg_boxed_new(GST_TYPE_PROPS_ENTRY, list->data, TRUE, TRUE);
|
||||
PyTuple_SET_ITEM(tuple, i, obj);
|
||||
}
|
||||
} else {
|
||||
tuple = Py_None;
|
||||
Py_INCREF(tuple);
|
||||
}
|
||||
return Py_BuildValue("(bO)", ret, tuple);
|
||||
}
|
||||
|
||||
|
||||
%%
|
||||
override gst_element_factory_make_element
|
||||
|
||||
|
|
Loading…
Reference in a new issue