add pad and element query and convert methods

Original commit message from CVS:
add pad and element query and convert methods
This commit is contained in:
David I. Lehn 2003-01-02 09:08:36 +00:00
parent b8ec40b07c
commit 3075e00bfa
2 changed files with 180 additions and 0 deletions

View file

@ -262,3 +262,93 @@ _wrap_gst_element_set_state(PyGObject *self, PyObject *args, PyObject *kwargs)
pyg_block_threads();
return PyInt_FromLong(ret);
}
%%
override gst_pad_query kwargs
static PyObject *
_wrap_gst_pad_query(PyGObject *self, PyObject *args, PyObject *kwargs)
{
static char *kwlist[] = { "type", "format", NULL };
GstQueryType type;
GstFormat format;
gint64 value;
gboolean gret;
PyObject *ret;
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "ii:GstPad.query", kwlist, &type, &format))
return NULL;
value = 0;
gret = gst_pad_query(GST_PAD(self->obj), type, &format, &value);
ret = PyTuple_New(2);
PyTuple_SetItem(ret, 0, PyInt_FromLong(gret));
PyTuple_SetItem(ret, 1, PyLong_FromLongLong(value));
return ret;
}
%%
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;
gboolean gret;
PyObject *ret;
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "ii:GstElement.query", kwlist, &type, &format))
return NULL;
value = 0;
gret = gst_element_query(GST_ELEMENT(self->obj), type, &format, &value);
ret = PyTuple_New(2);
PyTuple_SetItem(ret, 0, PyInt_FromLong(gret));
PyTuple_SetItem(ret, 1, PyLong_FromLongLong(value));
return ret;
}
%%
override gst_pad_convert kwargs
static PyObject *
_wrap_gst_pad_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 gret;
PyObject *ret;
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "iOi:GstPad.convert", kwlist, &src_format, &src_value_obj, &dest_format))
return NULL;
src_value = PyLong_AsLongLong(src_value_obj);
dest_value = 0;
gret = gst_pad_convert(GST_PAD(self->obj), src_format, src_value, &dest_format, &dest_value);
ret = PyTuple_New(2);
PyTuple_SetItem(ret, 0, PyInt_FromLong(gret));
PyTuple_SetItem(ret, 1, PyLong_FromLongLong(dest_value));
return ret;
}
%%
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 gret;
PyObject *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;
gret = gst_element_convert(GST_ELEMENT(self->obj), src_format, src_value, &dest_format, &dest_value);
ret = PyTuple_New(2);
PyTuple_SetItem(ret, 0, PyInt_FromLong(gret));
PyTuple_SetItem(ret, 1, PyLong_FromLongLong(dest_value));
return ret;
}

View file

@ -262,3 +262,93 @@ _wrap_gst_element_set_state(PyGObject *self, PyObject *args, PyObject *kwargs)
pyg_block_threads();
return PyInt_FromLong(ret);
}
%%
override gst_pad_query kwargs
static PyObject *
_wrap_gst_pad_query(PyGObject *self, PyObject *args, PyObject *kwargs)
{
static char *kwlist[] = { "type", "format", NULL };
GstQueryType type;
GstFormat format;
gint64 value;
gboolean gret;
PyObject *ret;
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "ii:GstPad.query", kwlist, &type, &format))
return NULL;
value = 0;
gret = gst_pad_query(GST_PAD(self->obj), type, &format, &value);
ret = PyTuple_New(2);
PyTuple_SetItem(ret, 0, PyInt_FromLong(gret));
PyTuple_SetItem(ret, 1, PyLong_FromLongLong(value));
return ret;
}
%%
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;
gboolean gret;
PyObject *ret;
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "ii:GstElement.query", kwlist, &type, &format))
return NULL;
value = 0;
gret = gst_element_query(GST_ELEMENT(self->obj), type, &format, &value);
ret = PyTuple_New(2);
PyTuple_SetItem(ret, 0, PyInt_FromLong(gret));
PyTuple_SetItem(ret, 1, PyLong_FromLongLong(value));
return ret;
}
%%
override gst_pad_convert kwargs
static PyObject *
_wrap_gst_pad_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 gret;
PyObject *ret;
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "iOi:GstPad.convert", kwlist, &src_format, &src_value_obj, &dest_format))
return NULL;
src_value = PyLong_AsLongLong(src_value_obj);
dest_value = 0;
gret = gst_pad_convert(GST_PAD(self->obj), src_format, src_value, &dest_format, &dest_value);
ret = PyTuple_New(2);
PyTuple_SetItem(ret, 0, PyInt_FromLong(gret));
PyTuple_SetItem(ret, 1, PyLong_FromLongLong(dest_value));
return ret;
}
%%
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 gret;
PyObject *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;
gret = gst_element_convert(GST_ELEMENT(self->obj), src_format, src_value, &dest_format, &dest_value);
ret = PyTuple_New(2);
PyTuple_SetItem(ret, 0, PyInt_FromLong(gret));
PyTuple_SetItem(ret, 1, PyLong_FromLongLong(dest_value));
return ret;
}