mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-25 01:30:38 +00:00
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:
parent
b8ec40b07c
commit
3075e00bfa
2 changed files with 180 additions and 0 deletions
|
@ -262,3 +262,93 @@ _wrap_gst_element_set_state(PyGObject *self, PyObject *args, PyObject *kwargs)
|
||||||
pyg_block_threads();
|
pyg_block_threads();
|
||||||
return PyInt_FromLong(ret);
|
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;
|
||||||
|
}
|
||||||
|
|
|
@ -262,3 +262,93 @@ _wrap_gst_element_set_state(PyGObject *self, PyObject *args, PyObject *kwargs)
|
||||||
pyg_block_threads();
|
pyg_block_threads();
|
||||||
return PyInt_FromLong(ret);
|
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;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue