Mass change to support compiling for both 0.6 and 0.7. Common support is now in common.{defs,override,c,h}. Specifi...
Original commit message from CVS:
Mass change to support compiling for both 0.6 and 0.7. Common support is now
in common.{defs,override,c,h}. Specific version support is in
{0.6,0.7}.{defs,override,c,h}. The common and version specific files are
merged and/or used as needed.
common.override: add gst_version
2003-10-10 04:21:21 +00:00
|
|
|
/* -*- Mode: C; c-basic-offset: 4 -*- */
|
2002-03-24 04:32:10 +00:00
|
|
|
/* 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.
|
|
|
|
*
|
2002-12-17 17:40:42 +00:00
|
|
|
* Author: David I. Lehn <dlehn@users.sourceforge.net>
|
2002-03-24 04:32:10 +00:00
|
|
|
*/
|
Mass change to support compiling for both 0.6 and 0.7. Common support is now in common.{defs,override,c,h}. Specifi...
Original commit message from CVS:
Mass change to support compiling for both 0.6 and 0.7. Common support is now
in common.{defs,override,c,h}. Specific version support is in
{0.6,0.7}.{defs,override,c,h}. The common and version specific files are
merged and/or used as needed.
common.override: add gst_version
2003-10-10 04:21:21 +00:00
|
|
|
%%
|
|
|
|
headers
|
|
|
|
#include <Python.h>
|
2002-03-24 04:32:10 +00:00
|
|
|
|
Mass change to support compiling for both 0.6 and 0.7. Common support is now in common.{defs,override,c,h}. Specifi...
Original commit message from CVS:
Mass change to support compiling for both 0.6 and 0.7. Common support is now
in common.{defs,override,c,h}. Specific version support is in
{0.6,0.7}.{defs,override,c,h}. The common and version specific files are
merged and/or used as needed.
common.override: add gst_version
2003-10-10 04:21:21 +00:00
|
|
|
#include "pygobject.h"
|
2002-03-24 04:32:10 +00:00
|
|
|
#include <gst/gst.h>
|
|
|
|
|
Mass change to support compiling for both 0.6 and 0.7. Common support is now in common.{defs,override,c,h}. Specifi...
Original commit message from CVS:
Mass change to support compiling for both 0.6 and 0.7. Common support is now
in common.{defs,override,c,h}. Specific version support is in
{0.6,0.7}.{defs,override,c,h}. The common and version specific files are
merged and/or used as needed.
common.override: add gst_version
2003-10-10 04:21:21 +00:00
|
|
|
#include "0.6.h"
|
2004-01-27 05:51:53 +00:00
|
|
|
%%
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
|
|
|
|
|