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.7.h"
|
2004-01-27 05:51:53 +00:00
|
|
|
%%
|
|
|
|
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;
|
|
|
|
}
|