2005-12-20 11:15:50 +00:00
|
|
|
/* -*- Mode: C; c-basic-offset: 4 -*- */
|
2005-10-13 10:41:06 +00:00
|
|
|
/*
|
|
|
|
* gstelementfactory.override - gstreamer element factory override
|
|
|
|
* Copyright (C) 2005 Alessandro Decina
|
|
|
|
*
|
|
|
|
* Authors:
|
|
|
|
* Alessandro Decina <alessandro@nnva.org>
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
%%
|
|
|
|
override gst_element_factory_make kwargs
|
|
|
|
static PyObject *
|
|
|
|
_wrap_gst_element_factory_make(PyObject *self, PyObject *args, PyObject *kwargs){
|
|
|
|
static char *kwlist[] = { "factoryname", "name", NULL };
|
|
|
|
char *factoryname, *name = NULL;
|
|
|
|
PyObject *py_ret;
|
|
|
|
GstElement *ret;
|
|
|
|
|
|
|
|
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s|z:element_factory_make", kwlist, &factoryname, &name))
|
|
|
|
return NULL;
|
|
|
|
ret = gst_element_factory_make(factoryname, name);
|
|
|
|
if (ret == NULL) {
|
2007-01-17 07:30:11 +00:00
|
|
|
PyErr_SetString(PyGstExc_ElementNotFoundError, factoryname);
|
2005-10-13 10:41:06 +00:00
|
|
|
return NULL;
|
|
|
|
}
|
2006-07-02 15:25:04 +00:00
|
|
|
py_ret = pygobject_new((GObject *)ret);
|
|
|
|
g_object_unref((GObject *)ret);
|
2005-10-13 10:41:06 +00:00
|
|
|
return py_ret;
|
|
|
|
}
|
2005-12-20 11:15:50 +00:00
|
|
|
%%
|
|
|
|
override gst_element_factory_get_static_pad_templates noargs
|
|
|
|
static PyObject *
|
|
|
|
_wrap_gst_element_factory_get_static_pad_templates(PyGObject *self)
|
|
|
|
{
|
|
|
|
const GList *list;
|
|
|
|
GList *l;
|
|
|
|
PyObject *py_list;
|
|
|
|
int i = 0;
|
|
|
|
|
|
|
|
list = gst_element_factory_get_static_pad_templates (GST_ELEMENT_FACTORY (self->obj));
|
2005-10-13 10:41:06 +00:00
|
|
|
|
2005-12-20 11:15:50 +00:00
|
|
|
py_list = PyList_New(g_list_length ((GList*) list));
|
|
|
|
|
|
|
|
for (l = (GList*) list; l ; l = g_list_next(l), i++) {
|
|
|
|
GstStaticPadTemplate *templ = (GstStaticPadTemplate*) l->data;
|
|
|
|
PyList_SetItem(py_list, i, pyg_pointer_new(GST_TYPE_STATIC_PAD_TEMPLATE, (gpointer) templ));
|
|
|
|
}
|
|
|
|
return py_list;
|
|
|
|
}
|