mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-24 02:31:03 +00:00
11e199b27c
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
188 lines
4.3 KiB
C
188 lines
4.3 KiB
C
/* -*- 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"
|
|
%%
|
|
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);
|
|
}
|
|
|
|
|