2005-08-16 16:47:45 +00:00
|
|
|
/* -*- Mode: C; c-basic-offset: 8 -*- */
|
2005-01-01 15:23:42 +00:00
|
|
|
/* gst-python
|
|
|
|
* Copyright (C) 2005 Johan Dahlin
|
|
|
|
*
|
|
|
|
* 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: Johan Dahlin <johan@gnome.org>
|
|
|
|
*/
|
|
|
|
%%
|
|
|
|
ignore
|
|
|
|
gst_element_get
|
|
|
|
gst_element_set
|
|
|
|
gst_element_get_property
|
|
|
|
gst_element_set_property
|
|
|
|
%%
|
2005-08-16 16:47:45 +00:00
|
|
|
override gst_element_get_pad_template args
|
|
|
|
static PyObject *
|
|
|
|
_wrap_gst_element_get_pad_template(PyGObject *self, PyObject *args)
|
|
|
|
{
|
|
|
|
PyObject *ret;
|
|
|
|
gchar *name;
|
|
|
|
GstPadTemplate *tmpl;
|
|
|
|
|
|
|
|
if (!PyArg_ParseTuple(args, "s:GstElement.get_pad_template", &name))
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
tmpl = gst_element_class_get_pad_template
|
|
|
|
(GST_ELEMENT_GET_CLASS (self->obj), name);
|
|
|
|
|
|
|
|
if (tmpl) {
|
2005-09-28 12:17:29 +00:00
|
|
|
ret = pygstobject_new (G_OBJECT (tmpl));
|
2005-08-16 16:47:45 +00:00
|
|
|
} else {
|
|
|
|
ret = Py_None;
|
|
|
|
Py_INCREF (ret);
|
|
|
|
}
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
%%
|
2005-01-01 15:23:42 +00:00
|
|
|
override gst_element_get_pad_list noargs
|
|
|
|
static PyObject *
|
|
|
|
_wrap_gst_element_get_pad_list(PyGObject *self)
|
|
|
|
{
|
|
|
|
GList *l, *pads;
|
|
|
|
PyObject *list;
|
|
|
|
|
|
|
|
pads = GST_ELEMENT_PADS(GST_ELEMENT(self->obj));
|
|
|
|
|
|
|
|
list = PyList_New(0);
|
|
|
|
for (l = pads; l; l = l->next) {
|
|
|
|
GstPad *pad = (GstPad*)l->data;
|
2005-09-28 12:17:29 +00:00
|
|
|
PyList_Append(list, pygstobject_new(G_OBJECT(pad)));
|
2005-01-01 15:23:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return list;
|
|
|
|
}
|
|
|
|
%%
|
|
|
|
override gst_element_get_pad_template_list noargs
|
|
|
|
static PyObject *
|
|
|
|
_wrap_gst_element_get_pad_template_list(PyGObject *self)
|
|
|
|
{
|
|
|
|
GList *l, *pads;
|
|
|
|
PyObject *list;
|
|
|
|
|
|
|
|
pads = (GList*)gst_element_get_pad_template_list(GST_ELEMENT(self->obj));
|
|
|
|
|
|
|
|
list = PyList_New(0);
|
|
|
|
for (l = pads; l; l = l->next) {
|
|
|
|
GstPad *pad = (GstPad*)l->data;
|
2005-09-28 12:17:29 +00:00
|
|
|
PyList_Append(list, pygstobject_new(G_OBJECT(pad)));
|
2005-01-01 15:23:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return list;
|
|
|
|
}
|
|
|
|
%%
|
|
|
|
override gst_element_set_state kwargs
|
|
|
|
static PyObject *
|
|
|
|
_wrap_gst_element_set_state(PyGObject *self, PyObject *args, PyObject *kwargs)
|
|
|
|
{
|
|
|
|
static char *kwlist[] = { "state", NULL };
|
|
|
|
PyObject *py_state = NULL;
|
2005-09-02 16:21:45 +00:00
|
|
|
GstState state;
|
2005-01-01 15:23:42 +00:00
|
|
|
gint ret;
|
|
|
|
|
|
|
|
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:GstElement.set_state", kwlist, &py_state))
|
|
|
|
return NULL;
|
2005-09-02 16:21:45 +00:00
|
|
|
if (pyg_enum_get_value(GST_TYPE_STATE, py_state, (gint *)&state))
|
2005-01-01 15:23:42 +00:00
|
|
|
return NULL;
|
|
|
|
|
|
|
|
pyg_begin_allow_threads;
|
|
|
|
|
|
|
|
ret = gst_element_set_state(GST_ELEMENT(self->obj), state);
|
|
|
|
|
|
|
|
pyg_end_allow_threads;
|
|
|
|
|
|
|
|
return PyInt_FromLong(ret);
|
|
|
|
}
|
|
|
|
%%
|
2005-06-26 13:59:34 +00:00
|
|
|
override gst_element_get_state kwargs
|
|
|
|
static PyObject *
|
|
|
|
_wrap_gst_element_get_state(PyGObject *self, PyObject *args, PyObject *kwargs)
|
|
|
|
{
|
2005-09-08 15:13:06 +00:00
|
|
|
static char *kwlist[] = { "timeout", NULL };
|
2005-09-02 16:21:45 +00:00
|
|
|
GstState state;
|
2005-09-08 15:13:06 +00:00
|
|
|
GstState pending;
|
|
|
|
GstStateChangeReturn ret;
|
|
|
|
PyObject *timeout;
|
|
|
|
GTimeVal *timevalp = NULL;
|
|
|
|
GTimeVal timeval;
|
|
|
|
PyObject *tuple;
|
2005-06-26 13:59:34 +00:00
|
|
|
|
2005-09-08 15:13:06 +00:00
|
|
|
if (!PyArg_ParseTupleAndKeywords(args, kwargs,
|
|
|
|
"O:GstElement.get_state", kwlist,
|
|
|
|
&timeout)) {
|
|
|
|
PyErr_SetString(PyExc_RuntimeError, "Timeout not specified correctly");
|
|
|
|
return NULL;
|
2005-06-26 13:59:34 +00:00
|
|
|
}
|
2005-09-08 15:13:06 +00:00
|
|
|
if (timeout != Py_None) {
|
|
|
|
gdouble timeoutd;
|
|
|
|
|
|
|
|
if (!PyFloat_Check (timeout)) {
|
|
|
|
PyErr_SetString(PyExc_TypeError, "Timeout not specified as double");
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
timeoutd = PyFloat_AsDouble (timeout);
|
|
|
|
|
|
|
|
timeval.tv_sec = (glong) timeoutd;
|
|
|
|
timeval.tv_usec = (glong) ((timeoutd - (gdouble) timeval.tv_sec)
|
|
|
|
* 1000.0 * 1000.0);
|
|
|
|
timevalp = &timeval;
|
|
|
|
}
|
|
|
|
|
|
|
|
ret = gst_element_get_state(GST_ELEMENT (self->obj), &state, &pending,
|
|
|
|
&timeval);
|
|
|
|
|
|
|
|
tuple = Py_BuildValue("OOO",
|
|
|
|
pyg_enum_from_gtype (GST_TYPE_STATE_CHANGE_RETURN, ret),
|
|
|
|
pyg_enum_from_gtype (GST_TYPE_STATE, state),
|
|
|
|
pyg_enum_from_gtype (GST_TYPE_STATE, pending));
|
|
|
|
|
|
|
|
return tuple;
|
2005-06-26 13:59:34 +00:00
|
|
|
}
|
|
|
|
%%
|
2005-06-20 21:39:34 +00:00
|
|
|
/* override gst_element_query kwargs */
|
|
|
|
/* static PyObject * */
|
|
|
|
/* _wrap_gst_element_query(PyGObject *self, PyObject *args, PyObject *kwargs) */
|
|
|
|
/* { */
|
|
|
|
/* static char *kwlist[] = { "type", "format", NULL }; */
|
|
|
|
/* GstQueryType type; */
|
|
|
|
/* GstFormat format; */
|
|
|
|
/* gint64 value = 0; */
|
|
|
|
/* gboolean ret; */
|
2005-01-01 15:23:42 +00:00
|
|
|
|
2005-06-20 21:39:34 +00:00
|
|
|
/* if (!PyArg_ParseTupleAndKeywords(args, kwargs, */
|
|
|
|
/* "ii:GstElement.query", kwlist, */
|
|
|
|
/* &type, &format)) */
|
|
|
|
/* return NULL; */
|
2005-01-01 15:23:42 +00:00
|
|
|
|
2005-06-20 21:39:34 +00:00
|
|
|
/* ret = gst_element_query(GST_ELEMENT(self->obj), type, &format, &value); */
|
|
|
|
/* return PyLong_FromLongLong(value); */
|
|
|
|
/* } */
|
|
|
|
/* %% */
|
2005-01-01 15:23:42 +00:00
|
|
|
override gst_element_convert kwargs
|
|
|
|
static PyObject *
|
|
|
|
_wrap_gst_element_convert(PyGObject *self, PyObject *args, PyObject *kwargs)
|
|
|
|
{
|
|
|
|
static char *kwlist[] = { "src_format", "src_value", "dest_format", NULL };
|
|
|
|
GstFormat src_format, dest_format;
|
|
|
|
PyObject *src_value_obj;
|
|
|
|
gint64 src_value, dest_value;
|
|
|
|
gboolean ret;
|
|
|
|
|
|
|
|
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "iOi:GstElement.convert", kwlist, &src_format, &src_value_obj, &dest_format))
|
|
|
|
return NULL;
|
|
|
|
src_value = PyLong_AsLongLong(src_value_obj);
|
|
|
|
dest_value = 0;
|
|
|
|
ret = gst_element_convert(GST_ELEMENT(self->obj), src_format, src_value, &dest_format, &dest_value);
|
|
|
|
if (!ret) {
|
|
|
|
PyErr_SetString(PyExc_RuntimeError, "conversion could not be performed");
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
return PyInt_FromLong(dest_value);
|
|
|
|
}
|
|
|
|
%%
|
|
|
|
override gst_element_link_many args
|
|
|
|
static PyObject *
|
|
|
|
_wrap_gst_element_link_many(PyObject *self, PyObject *args)
|
|
|
|
{
|
|
|
|
PyGObject *element, *element2;
|
|
|
|
int i, len;
|
|
|
|
|
|
|
|
len = PyTuple_Size(args);
|
|
|
|
if (len < 2)
|
|
|
|
{
|
|
|
|
PyErr_SetString(PyExc_TypeError, "gst.element_link_many requires at least two argument");
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < len; i++)
|
|
|
|
{
|
|
|
|
element = (PyGObject*)PyTuple_GetItem(args, i);
|
|
|
|
if (!pygobject_check(element, &PyGstElement_Type))
|
|
|
|
{
|
|
|
|
PyErr_SetString(PyExc_TypeError, "argument must be a GstElement");
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Mimic the real gst_element_link_many */
|
|
|
|
element = (PyGObject*)PyTuple_GetItem(args, 0);
|
|
|
|
element2 = (PyGObject*)PyTuple_GetItem(args, 1);
|
|
|
|
|
|
|
|
i = 2;
|
|
|
|
while (1) {
|
|
|
|
|
|
|
|
if (!gst_element_link(GST_ELEMENT(element->obj),
|
|
|
|
GST_ELEMENT(element2->obj)))
|
|
|
|
{
|
|
|
|
PyErr_Format(PyGstExc_LinkError,
|
|
|
|
"failed to link %s with %s",
|
|
|
|
GST_ELEMENT_NAME(element->obj),
|
|
|
|
GST_ELEMENT_NAME(element2->obj));
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (i >= len)
|
|
|
|
break;
|
|
|
|
|
|
|
|
element = element2;
|
|
|
|
element2 = (PyGObject*)PyTuple_GetItem(args, i);
|
|
|
|
|
|
|
|
i++;
|
|
|
|
}
|
|
|
|
|
|
|
|
Py_INCREF(Py_True);
|
|
|
|
return Py_True;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-06-20 21:39:34 +00:00
|
|
|
/* %% */
|
|
|
|
/* override gst_element_link kwargs */
|
|
|
|
/* static PyObject * */
|
|
|
|
/* _wrap_gst_element_link(PyGObject *self, PyObject *args, PyObject *kwargs) */
|
|
|
|
/* { */
|
|
|
|
/* static char *kwlist[] = { "dest", "filtercaps", NULL }; */
|
|
|
|
/* PyGObject *dest; */
|
|
|
|
/* PyObject *py_caps = NULL; */
|
|
|
|
/* int ret; */
|
|
|
|
/* GstCaps *caps = NULL; */
|
|
|
|
/* gboolean caps_is_copy; */
|
2005-01-01 15:23:42 +00:00
|
|
|
|
2005-06-20 21:39:34 +00:00
|
|
|
/* if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O!|O:GstElement.link", */
|
|
|
|
/* kwlist, &PyGstElement_Type, &dest, &py_caps)) */
|
|
|
|
/* return NULL; */
|
|
|
|
/* if (py_caps == NULL) */
|
|
|
|
/* caps = NULL; */
|
|
|
|
/* else */
|
|
|
|
/* caps = pygst_caps_from_pyobject (py_caps, &caps_is_copy); */
|
|
|
|
/* ret = gst_element_link_filtered(GST_ELEMENT(self->obj), GST_ELEMENT(dest->obj), caps); */
|
|
|
|
/* if (caps && caps_is_copy) */
|
|
|
|
/* gst_caps_unref (caps); */
|
|
|
|
/* if (!ret) { */
|
|
|
|
/* PyErr_Format(PyGstExc_LinkError, */
|
|
|
|
/* "failed to link %s with %s", */
|
|
|
|
/* GST_ELEMENT_NAME(self->obj), */
|
|
|
|
/* GST_ELEMENT_NAME(dest->obj)); */
|
|
|
|
/* return NULL; */
|
|
|
|
/* } */
|
|
|
|
/* return PyBool_FromLong(ret); */
|
|
|
|
/* } */
|
2005-01-01 15:23:42 +00:00
|
|
|
|
2005-06-20 21:39:34 +00:00
|
|
|
/* %% */
|
|
|
|
/* override gst_element_link_filtered kwargs */
|
|
|
|
/* static PyObject * */
|
|
|
|
/* _wrap_gst_element_link_filtered(PyGObject *self, PyObject *args, */
|
|
|
|
/* PyObject *kwargs) */
|
|
|
|
/* { */
|
|
|
|
/* if (PyErr_Warn(PyExc_DeprecationWarning, "element.link_filtered is deprecated, use element.link") < 0) */
|
|
|
|
/* return NULL; */
|
|
|
|
/* return _wrap_gst_element_link (self, args, kwargs); */
|
|
|
|
/* } */
|
2005-01-01 15:23:42 +00:00
|
|
|
|
|
|
|
%%
|
|
|
|
override gst_element_link_pads kwargs
|
2005-06-17 10:59:47 +00:00
|
|
|
static gboolean
|
|
|
|
pad_name_from_object (PyObject *object, const gchar **name)
|
|
|
|
{
|
|
|
|
if (object == Py_None) {
|
|
|
|
*name = NULL;
|
|
|
|
return TRUE;
|
|
|
|
} else if (PyString_Check (object)) {
|
|
|
|
*name = PyString_AsString (object);
|
|
|
|
return TRUE;
|
|
|
|
} else if (pygobject_check (object, &PyGstPad_Type)) {
|
|
|
|
*name = gst_object_get_name (GST_OBJECT (pygobject_get (object)));
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
PyErr_SetString(PyExc_TypeError, "argument could not be converted to a pad");
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2005-01-01 15:23:42 +00:00
|
|
|
static PyObject *
|
|
|
|
_wrap_gst_element_link_pads(PyGObject *self, PyObject *args, PyObject *kwargs)
|
|
|
|
{
|
|
|
|
static char *kwlist[] = { "srcpadname", "dest", "destpadname", NULL };
|
2005-06-17 10:59:47 +00:00
|
|
|
const char *srcpadname, *destpadname;
|
2005-01-01 15:23:42 +00:00
|
|
|
PyGObject *dest;
|
2005-06-17 10:59:47 +00:00
|
|
|
PyObject *srcpad, *destpad;
|
2005-01-01 15:23:42 +00:00
|
|
|
int ret;
|
|
|
|
|
|
|
|
if (!PyArg_ParseTupleAndKeywords(args, kwargs,
|
2005-06-17 10:59:47 +00:00
|
|
|
"OO!O:GstElement.link_pads", kwlist,
|
|
|
|
&srcpad, &PyGstElement_Type, &dest,
|
|
|
|
&destpad))
|
2005-01-01 15:23:42 +00:00
|
|
|
return NULL;
|
2005-06-17 10:59:47 +00:00
|
|
|
if (!pad_name_from_object (srcpad, &srcpadname) ||
|
|
|
|
!pad_name_from_object (destpad, &destpadname))
|
|
|
|
return NULL;
|
2005-01-01 15:23:42 +00:00
|
|
|
ret = gst_element_link_pads(GST_ELEMENT(self->obj), srcpadname,
|
|
|
|
GST_ELEMENT(dest->obj), destpadname);
|
|
|
|
if (!ret) {
|
|
|
|
PyErr_SetString(PyGstExc_LinkError, "link failed");
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
return PyBool_FromLong(ret);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
%%
|
|
|
|
override gst_element_link_pads_filtered kwargs
|
|
|
|
static PyObject *
|
|
|
|
_wrap_gst_element_link_pads_filtered(PyGObject *self, PyObject *args,
|
|
|
|
PyObject *kwargs)
|
|
|
|
{
|
|
|
|
static char *kwlist[] = { "srcpadname", "dest", "destpadname",
|
|
|
|
"filtercaps", NULL };
|
|
|
|
char *srcpadname, *destpadname;
|
|
|
|
PyGObject *dest;
|
|
|
|
int ret;
|
|
|
|
PyObject *py_filtercaps;
|
|
|
|
GstCaps *filtercaps = NULL;
|
|
|
|
|
|
|
|
if (!PyArg_ParseTupleAndKeywords(args, kwargs,
|
|
|
|
"sO!sO:GstElement.link_pads_filtered",
|
|
|
|
kwlist, &srcpadname, &PyGstElement_Type,
|
|
|
|
&dest, &destpadname, &py_filtercaps))
|
|
|
|
return NULL;
|
|
|
|
if (pyg_boxed_check(py_filtercaps, GST_TYPE_CAPS))
|
|
|
|
filtercaps = pyg_boxed_get(py_filtercaps, GstCaps);
|
|
|
|
else {
|
|
|
|
PyErr_SetString(PyExc_TypeError, "filtercaps should be a GstCaps");
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
ret = gst_element_link_pads_filtered(GST_ELEMENT(self->obj), srcpadname,
|
|
|
|
GST_ELEMENT(dest->obj), destpadname,
|
|
|
|
filtercaps);
|
|
|
|
if (!ret) {
|
|
|
|
PyErr_SetString(PyGstExc_LinkError, "link failed");
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
return PyBool_FromLong(ret);
|
|
|
|
}
|
|
|
|
|
|
|
|
%%
|
|
|
|
override gst_element_unlink_many args
|
|
|
|
static PyObject *
|
|
|
|
_wrap_gst_element_unlink_many(PyObject *self, PyObject *args)
|
|
|
|
{
|
|
|
|
PyGObject *element, *element2;
|
|
|
|
int i, len;
|
|
|
|
|
|
|
|
len = PyTuple_Size(args);
|
|
|
|
if (len < 2)
|
|
|
|
{
|
|
|
|
PyErr_SetString(PyExc_TypeError, "gst.element_unlink_many requires at least two arguments");
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < len; i++)
|
|
|
|
{
|
|
|
|
element = (PyGObject*)PyTuple_GetItem(args, i);
|
|
|
|
if (!pygobject_check(element, &PyGstElement_Type))
|
|
|
|
{
|
|
|
|
PyErr_SetString(PyExc_TypeError, "argument must be a GstElement");
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Mimic the real gst_element_unlink_many */
|
|
|
|
element = (PyGObject*)PyTuple_GetItem(args, 0);
|
|
|
|
element2 = (PyGObject*)PyTuple_GetItem(args, 1);
|
|
|
|
|
|
|
|
i = 2;
|
|
|
|
while (1) {
|
|
|
|
gst_element_unlink(GST_ELEMENT(element->obj), GST_ELEMENT(element2->obj));
|
|
|
|
|
|
|
|
if (i >= len)
|
|
|
|
break;
|
|
|
|
|
|
|
|
element = element2;
|
|
|
|
element2 = (PyGObject*)PyTuple_GetItem(args, i);
|
|
|
|
|
|
|
|
i++;
|
|
|
|
}
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
return Py_None;
|
|
|
|
}
|
gst/: Added GError wrapping,
Original commit message from CVS:
* gst/gst-types.defs:
* gst/gst.defs:
Added GError wrapping,
Removed data field from Buffer,
Added virtual methods to object
Updated to latest API
* gst/gst.override:
wrapped gst_plugin_get_feature_list(), gst_uri_handler_get_protocols(),
gst_registry_pool_list()
* gst/gstbuffer.override:
gst.Buffer() works
get/setters fixed
wrapped gst_buffer_stamp()
* gst/gstbus.override:
wrapped gst_bus_set_sync_handler() and gst_bus_add_watch()
* gst/gstelement.override:
wrapped gst_element_send_event(), gst_element_factory_get_pad_templates()
gst_element_query_convert(), gst_element_get_query_types()
* gst/gstevent.override:
wrapped gst_event_discont_get_value()
* gst/gstmessage.override:
wrapped gst_message_parse_state_changed(), gst_message_parse_error(),
gst_message_parse_warning(), gst_message_parse_tag()
* gst/gstmodule.c:
Added registration of new fundamental type with pygtk
* gst/gstpad.override:
wrapped gst_pad_query(), gst_pad_[add|remove]_[data|event|buffer]_probe(),
gst_pad_query_position(), gst_pad_query_convert()
* gst/gstquery.override:
wrapped gst_query_parse_position(), gst_query_parse_convert(),
gst_query_parse_seeking_query(), gst_query_parse_seeking_reponse()
* gst/pygstminiobject.c:
fixes
* gst/Makefile.am:
added gstbus.override, gstmessage.override, gstquery.override
* testsuite/test_buffer.py:
* testsuite/test_element.py:
* testsuite/test_event.py:
* testsuite/test_pipeline.py:
Updating testsuites
2005-07-12 09:45:58 +00:00
|
|
|
/* override gst_element_send_event kwargs */
|
|
|
|
/* static PyObject * */
|
|
|
|
/* _wrap_gst_element_send_event(PyGObject *self, PyObject *args, PyObject *kwargs) */
|
|
|
|
/* { */
|
|
|
|
/* static char *kwlist[] = { "event", NULL }; */
|
|
|
|
/* PyObject *py_event; */
|
|
|
|
/* int ret; */
|
|
|
|
/* GstEvent *event = NULL; */
|
2005-01-01 15:23:42 +00:00
|
|
|
|
gst/: Added GError wrapping,
Original commit message from CVS:
* gst/gst-types.defs:
* gst/gst.defs:
Added GError wrapping,
Removed data field from Buffer,
Added virtual methods to object
Updated to latest API
* gst/gst.override:
wrapped gst_plugin_get_feature_list(), gst_uri_handler_get_protocols(),
gst_registry_pool_list()
* gst/gstbuffer.override:
gst.Buffer() works
get/setters fixed
wrapped gst_buffer_stamp()
* gst/gstbus.override:
wrapped gst_bus_set_sync_handler() and gst_bus_add_watch()
* gst/gstelement.override:
wrapped gst_element_send_event(), gst_element_factory_get_pad_templates()
gst_element_query_convert(), gst_element_get_query_types()
* gst/gstevent.override:
wrapped gst_event_discont_get_value()
* gst/gstmessage.override:
wrapped gst_message_parse_state_changed(), gst_message_parse_error(),
gst_message_parse_warning(), gst_message_parse_tag()
* gst/gstmodule.c:
Added registration of new fundamental type with pygtk
* gst/gstpad.override:
wrapped gst_pad_query(), gst_pad_[add|remove]_[data|event|buffer]_probe(),
gst_pad_query_position(), gst_pad_query_convert()
* gst/gstquery.override:
wrapped gst_query_parse_position(), gst_query_parse_convert(),
gst_query_parse_seeking_query(), gst_query_parse_seeking_reponse()
* gst/pygstminiobject.c:
fixes
* gst/Makefile.am:
added gstbus.override, gstmessage.override, gstquery.override
* testsuite/test_buffer.py:
* testsuite/test_element.py:
* testsuite/test_event.py:
* testsuite/test_pipeline.py:
Updating testsuites
2005-07-12 09:45:58 +00:00
|
|
|
/* if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:GstElement.send_event", kwlist, &py_event)) */
|
|
|
|
/* return NULL; */
|
|
|
|
/* if (pyg_boxed_check(py_event, GST_TYPE_EVENT)) */
|
|
|
|
/* event = pyg_boxed_get(py_event, GstEvent); */
|
|
|
|
/* else { */
|
|
|
|
/* PyErr_SetString(PyExc_TypeError, "event should be a GstEvent"); */
|
|
|
|
/* return NULL; */
|
|
|
|
/* } */
|
2005-01-01 15:23:42 +00:00
|
|
|
|
gst/: Added GError wrapping,
Original commit message from CVS:
* gst/gst-types.defs:
* gst/gst.defs:
Added GError wrapping,
Removed data field from Buffer,
Added virtual methods to object
Updated to latest API
* gst/gst.override:
wrapped gst_plugin_get_feature_list(), gst_uri_handler_get_protocols(),
gst_registry_pool_list()
* gst/gstbuffer.override:
gst.Buffer() works
get/setters fixed
wrapped gst_buffer_stamp()
* gst/gstbus.override:
wrapped gst_bus_set_sync_handler() and gst_bus_add_watch()
* gst/gstelement.override:
wrapped gst_element_send_event(), gst_element_factory_get_pad_templates()
gst_element_query_convert(), gst_element_get_query_types()
* gst/gstevent.override:
wrapped gst_event_discont_get_value()
* gst/gstmessage.override:
wrapped gst_message_parse_state_changed(), gst_message_parse_error(),
gst_message_parse_warning(), gst_message_parse_tag()
* gst/gstmodule.c:
Added registration of new fundamental type with pygtk
* gst/gstpad.override:
wrapped gst_pad_query(), gst_pad_[add|remove]_[data|event|buffer]_probe(),
gst_pad_query_position(), gst_pad_query_convert()
* gst/gstquery.override:
wrapped gst_query_parse_position(), gst_query_parse_convert(),
gst_query_parse_seeking_query(), gst_query_parse_seeking_reponse()
* gst/pygstminiobject.c:
fixes
* gst/Makefile.am:
added gstbus.override, gstmessage.override, gstquery.override
* testsuite/test_buffer.py:
* testsuite/test_element.py:
* testsuite/test_event.py:
* testsuite/test_pipeline.py:
Updating testsuites
2005-07-12 09:45:58 +00:00
|
|
|
/* /\* The pipeline unrefs the event, but we want to keep the ownership *\/ */
|
|
|
|
/* gst_event_ref(event); */
|
2005-01-01 15:23:42 +00:00
|
|
|
|
gst/: Added GError wrapping,
Original commit message from CVS:
* gst/gst-types.defs:
* gst/gst.defs:
Added GError wrapping,
Removed data field from Buffer,
Added virtual methods to object
Updated to latest API
* gst/gst.override:
wrapped gst_plugin_get_feature_list(), gst_uri_handler_get_protocols(),
gst_registry_pool_list()
* gst/gstbuffer.override:
gst.Buffer() works
get/setters fixed
wrapped gst_buffer_stamp()
* gst/gstbus.override:
wrapped gst_bus_set_sync_handler() and gst_bus_add_watch()
* gst/gstelement.override:
wrapped gst_element_send_event(), gst_element_factory_get_pad_templates()
gst_element_query_convert(), gst_element_get_query_types()
* gst/gstevent.override:
wrapped gst_event_discont_get_value()
* gst/gstmessage.override:
wrapped gst_message_parse_state_changed(), gst_message_parse_error(),
gst_message_parse_warning(), gst_message_parse_tag()
* gst/gstmodule.c:
Added registration of new fundamental type with pygtk
* gst/gstpad.override:
wrapped gst_pad_query(), gst_pad_[add|remove]_[data|event|buffer]_probe(),
gst_pad_query_position(), gst_pad_query_convert()
* gst/gstquery.override:
wrapped gst_query_parse_position(), gst_query_parse_convert(),
gst_query_parse_seeking_query(), gst_query_parse_seeking_reponse()
* gst/pygstminiobject.c:
fixes
* gst/Makefile.am:
added gstbus.override, gstmessage.override, gstquery.override
* testsuite/test_buffer.py:
* testsuite/test_element.py:
* testsuite/test_event.py:
* testsuite/test_pipeline.py:
Updating testsuites
2005-07-12 09:45:58 +00:00
|
|
|
/* ret = gst_element_send_event(GST_ELEMENT(self->obj), event); */
|
|
|
|
/* return PyBool_FromLong(ret); */
|
2005-06-17 10:59:47 +00:00
|
|
|
|
gst/: Added GError wrapping,
Original commit message from CVS:
* gst/gst-types.defs:
* gst/gst.defs:
Added GError wrapping,
Removed data field from Buffer,
Added virtual methods to object
Updated to latest API
* gst/gst.override:
wrapped gst_plugin_get_feature_list(), gst_uri_handler_get_protocols(),
gst_registry_pool_list()
* gst/gstbuffer.override:
gst.Buffer() works
get/setters fixed
wrapped gst_buffer_stamp()
* gst/gstbus.override:
wrapped gst_bus_set_sync_handler() and gst_bus_add_watch()
* gst/gstelement.override:
wrapped gst_element_send_event(), gst_element_factory_get_pad_templates()
gst_element_query_convert(), gst_element_get_query_types()
* gst/gstevent.override:
wrapped gst_event_discont_get_value()
* gst/gstmessage.override:
wrapped gst_message_parse_state_changed(), gst_message_parse_error(),
gst_message_parse_warning(), gst_message_parse_tag()
* gst/gstmodule.c:
Added registration of new fundamental type with pygtk
* gst/gstpad.override:
wrapped gst_pad_query(), gst_pad_[add|remove]_[data|event|buffer]_probe(),
gst_pad_query_position(), gst_pad_query_convert()
* gst/gstquery.override:
wrapped gst_query_parse_position(), gst_query_parse_convert(),
gst_query_parse_seeking_query(), gst_query_parse_seeking_reponse()
* gst/pygstminiobject.c:
fixes
* gst/Makefile.am:
added gstbus.override, gstmessage.override, gstquery.override
* testsuite/test_buffer.py:
* testsuite/test_element.py:
* testsuite/test_event.py:
* testsuite/test_pipeline.py:
Updating testsuites
2005-07-12 09:45:58 +00:00
|
|
|
/* } */
|
|
|
|
/* %% */
|
2005-06-28 16:13:53 +00:00
|
|
|
%%
|
|
|
|
override gst_element_query_position args
|
|
|
|
static PyObject *
|
|
|
|
_wrap_gst_element_query_position (PyGObject *self, PyObject *args)
|
|
|
|
{
|
|
|
|
gint64 cur, end;
|
|
|
|
gint format;
|
|
|
|
PyObject *pformat;
|
|
|
|
PyObject *ret;
|
|
|
|
|
|
|
|
pformat = (PyObject*)PyTuple_GetItem(args, 0);
|
|
|
|
if (pyg_enum_get_value (GST_TYPE_FORMAT, pformat, &format)) {
|
|
|
|
PyErr_SetString(PyExc_TypeError, "argument should be a GstFormat");
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
ret = PyList_New(0);
|
|
|
|
if ((gst_element_query_position(GST_ELEMENT (self->obj), (GstFormat*) &format, &cur, &end))) {
|
2005-08-01 09:59:55 +00:00
|
|
|
PyList_Append(ret, PyLong_FromLongLong(cur));
|
|
|
|
PyList_Append(ret, PyLong_FromLongLong(end));
|
2005-06-28 16:13:53 +00:00
|
|
|
PyList_Append(ret, pyg_enum_from_gtype (GST_TYPE_FORMAT, format ));
|
|
|
|
} else {
|
gst/: Added GError wrapping,
Original commit message from CVS:
* gst/gst-types.defs:
* gst/gst.defs:
Added GError wrapping,
Removed data field from Buffer,
Added virtual methods to object
Updated to latest API
* gst/gst.override:
wrapped gst_plugin_get_feature_list(), gst_uri_handler_get_protocols(),
gst_registry_pool_list()
* gst/gstbuffer.override:
gst.Buffer() works
get/setters fixed
wrapped gst_buffer_stamp()
* gst/gstbus.override:
wrapped gst_bus_set_sync_handler() and gst_bus_add_watch()
* gst/gstelement.override:
wrapped gst_element_send_event(), gst_element_factory_get_pad_templates()
gst_element_query_convert(), gst_element_get_query_types()
* gst/gstevent.override:
wrapped gst_event_discont_get_value()
* gst/gstmessage.override:
wrapped gst_message_parse_state_changed(), gst_message_parse_error(),
gst_message_parse_warning(), gst_message_parse_tag()
* gst/gstmodule.c:
Added registration of new fundamental type with pygtk
* gst/gstpad.override:
wrapped gst_pad_query(), gst_pad_[add|remove]_[data|event|buffer]_probe(),
gst_pad_query_position(), gst_pad_query_convert()
* gst/gstquery.override:
wrapped gst_query_parse_position(), gst_query_parse_convert(),
gst_query_parse_seeking_query(), gst_query_parse_seeking_reponse()
* gst/pygstminiobject.c:
fixes
* gst/Makefile.am:
added gstbus.override, gstmessage.override, gstquery.override
* testsuite/test_buffer.py:
* testsuite/test_element.py:
* testsuite/test_event.py:
* testsuite/test_pipeline.py:
Updating testsuites
2005-07-12 09:45:58 +00:00
|
|
|
Py_INCREF(Py_None);
|
|
|
|
ret = Py_None;
|
|
|
|
}
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
%%
|
|
|
|
override gst_element_query_convert kwargs
|
|
|
|
static PyObject *
|
|
|
|
_wrap_gst_element_query_convert (PyGObject *self, PyObject *args, PyObject *kwargs)
|
|
|
|
{
|
|
|
|
static char *kwlist[] = { "fromformat", "fromvalue", "destformat", NULL };
|
|
|
|
PyObject *pfromformat, *pdestformat;
|
|
|
|
GstFormat srcformat, destformat;
|
|
|
|
gint64 fromval, dstval;
|
|
|
|
PyObject *ret;
|
|
|
|
|
|
|
|
/* Input : src_format, src_val, dst_format */
|
|
|
|
/* Returns : dst_format, dst_val OR None */
|
|
|
|
|
|
|
|
if (!PyArg_ParseTupleAndKeywords(args, kwargs,
|
|
|
|
"0L0:GstElement.query_convert",
|
|
|
|
kwlist, &pfromformat, &fromval, &pdestformat))
|
|
|
|
return NULL;
|
|
|
|
if (pyg_enum_get_value(GST_TYPE_FORMAT, pfromformat, (gint *) &srcformat)) {
|
|
|
|
PyErr_SetString(PyExc_TypeError, "argument should be a GstFormat");
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
if (pyg_enum_get_value(GST_TYPE_FORMAT, pdestformat, (gint *) &destformat)) {
|
|
|
|
PyErr_SetString(PyExc_TypeError, "argument should be a GstFormat");
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!(gst_element_query_convert (GST_ELEMENT(self->obj),
|
|
|
|
srcformat, fromval,
|
|
|
|
&destformat, &dstval))) {
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
return Py_None;
|
2005-06-28 16:13:53 +00:00
|
|
|
}
|
gst/: Added GError wrapping,
Original commit message from CVS:
* gst/gst-types.defs:
* gst/gst.defs:
Added GError wrapping,
Removed data field from Buffer,
Added virtual methods to object
Updated to latest API
* gst/gst.override:
wrapped gst_plugin_get_feature_list(), gst_uri_handler_get_protocols(),
gst_registry_pool_list()
* gst/gstbuffer.override:
gst.Buffer() works
get/setters fixed
wrapped gst_buffer_stamp()
* gst/gstbus.override:
wrapped gst_bus_set_sync_handler() and gst_bus_add_watch()
* gst/gstelement.override:
wrapped gst_element_send_event(), gst_element_factory_get_pad_templates()
gst_element_query_convert(), gst_element_get_query_types()
* gst/gstevent.override:
wrapped gst_event_discont_get_value()
* gst/gstmessage.override:
wrapped gst_message_parse_state_changed(), gst_message_parse_error(),
gst_message_parse_warning(), gst_message_parse_tag()
* gst/gstmodule.c:
Added registration of new fundamental type with pygtk
* gst/gstpad.override:
wrapped gst_pad_query(), gst_pad_[add|remove]_[data|event|buffer]_probe(),
gst_pad_query_position(), gst_pad_query_convert()
* gst/gstquery.override:
wrapped gst_query_parse_position(), gst_query_parse_convert(),
gst_query_parse_seeking_query(), gst_query_parse_seeking_reponse()
* gst/pygstminiobject.c:
fixes
* gst/Makefile.am:
added gstbus.override, gstmessage.override, gstquery.override
* testsuite/test_buffer.py:
* testsuite/test_element.py:
* testsuite/test_event.py:
* testsuite/test_pipeline.py:
Updating testsuites
2005-07-12 09:45:58 +00:00
|
|
|
|
|
|
|
ret = PyList_New(0);
|
|
|
|
PyList_Append(ret, pyg_enum_from_gtype (GST_TYPE_FORMAT, destformat));
|
|
|
|
PyList_Append(ret, PyLong_FromLongLong(dstval));
|
2005-06-28 16:13:53 +00:00
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
gst/: Added GError wrapping,
Original commit message from CVS:
* gst/gst-types.defs:
* gst/gst.defs:
Added GError wrapping,
Removed data field from Buffer,
Added virtual methods to object
Updated to latest API
* gst/gst.override:
wrapped gst_plugin_get_feature_list(), gst_uri_handler_get_protocols(),
gst_registry_pool_list()
* gst/gstbuffer.override:
gst.Buffer() works
get/setters fixed
wrapped gst_buffer_stamp()
* gst/gstbus.override:
wrapped gst_bus_set_sync_handler() and gst_bus_add_watch()
* gst/gstelement.override:
wrapped gst_element_send_event(), gst_element_factory_get_pad_templates()
gst_element_query_convert(), gst_element_get_query_types()
* gst/gstevent.override:
wrapped gst_event_discont_get_value()
* gst/gstmessage.override:
wrapped gst_message_parse_state_changed(), gst_message_parse_error(),
gst_message_parse_warning(), gst_message_parse_tag()
* gst/gstmodule.c:
Added registration of new fundamental type with pygtk
* gst/gstpad.override:
wrapped gst_pad_query(), gst_pad_[add|remove]_[data|event|buffer]_probe(),
gst_pad_query_position(), gst_pad_query_convert()
* gst/gstquery.override:
wrapped gst_query_parse_position(), gst_query_parse_convert(),
gst_query_parse_seeking_query(), gst_query_parse_seeking_reponse()
* gst/pygstminiobject.c:
fixes
* gst/Makefile.am:
added gstbus.override, gstmessage.override, gstquery.override
* testsuite/test_buffer.py:
* testsuite/test_element.py:
* testsuite/test_event.py:
* testsuite/test_pipeline.py:
Updating testsuites
2005-07-12 09:45:58 +00:00
|
|
|
%%
|
|
|
|
override gst_element_get_query_types noargs
|
|
|
|
static PyObject *
|
|
|
|
_wrap_gst_element_get_query_types (PyGObject *self)
|
|
|
|
{
|
|
|
|
PyObject *ret;
|
|
|
|
PyObject *item;
|
|
|
|
int i;
|
|
|
|
GstQueryType *tab;
|
|
|
|
|
|
|
|
tab = (GstQueryType*) gst_element_get_query_types(GST_ELEMENT(self->obj));
|
|
|
|
if (tab == NULL) {
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
return Py_None;
|
|
|
|
}
|
|
|
|
|
|
|
|
ret = PyList_New(0);
|
|
|
|
for (i = 0; tab[i] != 0; i++) {
|
|
|
|
item = pyg_enum_from_gtype (GST_TYPE_QUERY_TYPE, tab[i]);
|
|
|
|
PyList_Append(ret, item);
|
|
|
|
}
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|