gstreamer/gst/0.6.override

189 lines
4.3 KiB
Text
Raw Normal View History

/* -*- 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);
}