gstreamer/gst/0.7.override
David I. Lehn 11e199b27c 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
2004-01-27 05:51:53 +00:00

73 lines
2.2 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.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;
}