mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
gst/: Remove dead code
Original commit message from CVS: * gst/gst.override: * gst/gstbin.override: * gst/gstbuffer.override: * gst/gstevent.override: Remove dead code * gst/gstelement.override: Remove dead code and re-enable link with filtering and _send_event()
This commit is contained in:
parent
60961d9b93
commit
9ba2f7fbbe
6 changed files with 73 additions and 314 deletions
11
ChangeLog
11
ChangeLog
|
@ -1,3 +1,14 @@
|
|||
2005-09-28 Edward Hervey <edward@fluendo.com>
|
||||
|
||||
* gst/gst.override:
|
||||
* gst/gstbin.override:
|
||||
* gst/gstbuffer.override:
|
||||
* gst/gstevent.override:
|
||||
Remove dead code
|
||||
|
||||
* gst/gstelement.override:
|
||||
Remove dead code and re-enable link with filtering and _send_event()
|
||||
|
||||
2005-09-28 Edward Hervey <edward@fluendo.com>
|
||||
|
||||
* gst/Makefile.am:
|
||||
|
|
|
@ -367,36 +367,6 @@ _wrap_gst_g_error_tp_str(PyGObject *self)
|
|||
return PyString_FromString(gst_error_get_message (error->domain,
|
||||
error->code));
|
||||
}
|
||||
%%
|
||||
override gst_main noargs
|
||||
static PyObject *
|
||||
_wrap_gst_main(PyObject *self)
|
||||
{
|
||||
pyg_begin_allow_threads;
|
||||
|
||||
_pygst_main();
|
||||
|
||||
pyg_end_allow_threads;
|
||||
|
||||
if (PyErr_Occurred())
|
||||
return NULL;
|
||||
|
||||
Py_INCREF(Py_None);
|
||||
return Py_None;
|
||||
|
||||
}
|
||||
%%
|
||||
override gst_main_quit args
|
||||
static PyObject *
|
||||
_wrap_gst_main_quit(PyObject *self)
|
||||
{
|
||||
|
||||
_pygst_main_quit();
|
||||
|
||||
Py_INCREF(Py_None);
|
||||
return Py_None;
|
||||
}
|
||||
|
||||
%%
|
||||
override gst_registry_get_path_list
|
||||
static PyObject *
|
||||
|
@ -686,29 +656,6 @@ _wrap_gst_uri_handler_get_protocols (PyGObject *self)
|
|||
return ret;
|
||||
}
|
||||
%%
|
||||
override gst_registry_pool_list noargs
|
||||
static PyObject *
|
||||
_wrap_gst_registry_pool_list (PyObject *what)
|
||||
{
|
||||
PyObject *ret, *item;
|
||||
GList *res, *tmp;
|
||||
|
||||
ret = PyList_New(0);
|
||||
res = gst_registry_pool_list();
|
||||
for (tmp = res; tmp; tmp = g_list_next(tmp)) {
|
||||
item = pygobject_new((GObject*) GST_REGISTRY(tmp->data));
|
||||
|
||||
if (!item) {
|
||||
Py_DECREF(ret);
|
||||
return NULL;
|
||||
}
|
||||
PyList_Append(ret, item);
|
||||
|
||||
Py_DECREF(item);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
%%
|
||||
override gst_flow_get_name kwargs
|
||||
static PyObject *
|
||||
_wrap_gst_flow_get_name(PyObject *self, PyObject *args, PyObject *kwargs)
|
||||
|
|
|
@ -88,50 +88,6 @@ _wrap_gst_bin_remove_many(PyGObject *self, PyObject *args)
|
|||
return Py_None;
|
||||
}
|
||||
%%
|
||||
override gst_bin_iterate noargs
|
||||
static PyObject *
|
||||
_wrap_gst_bin_iterate(PyGObject *self)
|
||||
{
|
||||
int ret;
|
||||
|
||||
/* XXX: Find out which one is the most correct */
|
||||
#if 1
|
||||
pyg_begin_allow_threads;
|
||||
|
||||
ret = gst_bin_iterate(GST_BIN(self->obj));
|
||||
|
||||
pyg_end_allow_threads;
|
||||
|
||||
#else
|
||||
PyGILState_STATE state;
|
||||
|
||||
state = pyg_gil_state_ensure();
|
||||
ret = gst_bin_iterate(GST_BIN(self->obj));
|
||||
pyg_gil_state_release(state);
|
||||
#endif
|
||||
return PyInt_FromLong(ret);
|
||||
}
|
||||
%%
|
||||
override gst_bin_get_list noargs
|
||||
static PyObject *
|
||||
_wrap_gst_bin_get_list(PyGObject *self)
|
||||
{
|
||||
GList *elements, *l;
|
||||
PyObject *tuple;
|
||||
int i;
|
||||
|
||||
elements = (GList*)gst_bin_get_list(GST_BIN(self->obj));
|
||||
tuple = PyTuple_New(g_list_length(elements));
|
||||
for (i = 0, l = elements; l; l = l->next, i++) {
|
||||
GstElement *element = (GstElement*)l->data;
|
||||
if (!element)
|
||||
continue;
|
||||
PyTuple_SetItem(tuple, i, pygstobject_new(G_OBJECT(element)));
|
||||
}
|
||||
|
||||
return tuple;
|
||||
}
|
||||
%%
|
||||
override gst_bin_get_by_name kwargs
|
||||
static PyObject *
|
||||
_wrap_gst_bin_get_by_name(PyGObject *self, PyObject *args, PyObject *kwargs)
|
||||
|
|
|
@ -75,48 +75,6 @@ _wrap_gst_buffer_new(PyGstMiniObject *self, PyObject *args, PyObject *kwargs)
|
|||
|
||||
return 0;
|
||||
}
|
||||
%%
|
||||
override gst_buffer_get_data
|
||||
static PyObject*
|
||||
_wrap_gst_buffer_get_data(PyObject *self)
|
||||
{
|
||||
GstBuffer *buf = pyg_boxed_get(self, GstBuffer);
|
||||
return PyString_FromStringAndSize((gchar *) GST_BUFFER_DATA(buf),
|
||||
GST_BUFFER_SIZE(buf));
|
||||
}
|
||||
%%
|
||||
override gst_buffer_set_data kwargs
|
||||
static PyObject*
|
||||
_wrap_gst_buffer_set_data(PyObject *self, PyObject *args, PyObject *kwargs)
|
||||
{
|
||||
static char *kwlist[] = {"data", NULL};
|
||||
PyObject *data;
|
||||
GstBuffer *buf;
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:GstBuffer:set_data", kwlist, &data))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
if (!PyString_Check(data)) {
|
||||
PyErr_SetString(PyExc_TypeError, "data should be a string");
|
||||
return NULL;
|
||||
}
|
||||
buf = pyg_boxed_get(self, GstBuffer);
|
||||
if (GST_BUFFER_FLAGS(buf) & GST_BUFFER_READONLY) {
|
||||
PyErr_SetString(PyExc_TypeError, "set_data can't use a READONLY buffer");
|
||||
return NULL;
|
||||
}
|
||||
GST_BUFFER_SIZE(buf) = PyString_Size(data);
|
||||
GST_BUFFER_DATA(buf) = (guint8 *) g_new0(char, GST_BUFFER_SIZE(buf));
|
||||
|
||||
memcpy(GST_BUFFER_DATA(buf),
|
||||
PyString_AsString(data),
|
||||
PyString_Size(data));
|
||||
|
||||
Py_INCREF(Py_None);
|
||||
return Py_None;
|
||||
}
|
||||
|
||||
%%
|
||||
override-slot GstBuffer.tp_str
|
||||
static PyObject *
|
||||
|
|
|
@ -50,42 +50,6 @@ _wrap_gst_element_get_pad_template(PyGObject *self, PyObject *args)
|
|||
return ret;
|
||||
}
|
||||
%%
|
||||
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;
|
||||
PyList_Append(list, pygstobject_new(G_OBJECT(pad)));
|
||||
}
|
||||
|
||||
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;
|
||||
PyList_Append(list, pygstobject_new(G_OBJECT(pad)));
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
%%
|
||||
override gst_element_set_state kwargs
|
||||
static PyObject *
|
||||
_wrap_gst_element_set_state(PyGObject *self, PyObject *args, PyObject *kwargs)
|
||||
|
@ -154,48 +118,6 @@ _wrap_gst_element_get_state(PyGObject *self, PyObject *args, PyObject *kwargs)
|
|||
return tuple;
|
||||
}
|
||||
%%
|
||||
/* 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; */
|
||||
|
||||
/* if (!PyArg_ParseTupleAndKeywords(args, kwargs, */
|
||||
/* "ii:GstElement.query", kwlist, */
|
||||
/* &type, &format)) */
|
||||
/* return NULL; */
|
||||
|
||||
/* ret = gst_element_query(GST_ELEMENT(self->obj), type, &format, &value); */
|
||||
/* return PyLong_FromLongLong(value); */
|
||||
/* } */
|
||||
/* %% */
|
||||
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)
|
||||
|
@ -252,48 +174,48 @@ _wrap_gst_element_link_many(PyObject *self, PyObject *args)
|
|||
}
|
||||
|
||||
|
||||
/* %% */
|
||||
/* 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; */
|
||||
%%
|
||||
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;
|
||||
|
||||
/* 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); */
|
||||
/* } */
|
||||
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);
|
||||
}
|
||||
|
||||
/* %% */
|
||||
/* 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); */
|
||||
/* } */
|
||||
%%
|
||||
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);
|
||||
}
|
||||
|
||||
%%
|
||||
override gst_element_link_pads kwargs
|
||||
|
@ -421,32 +343,32 @@ _wrap_gst_element_unlink_many(PyObject *self, PyObject *args)
|
|||
Py_INCREF(Py_None);
|
||||
return Py_None;
|
||||
}
|
||||
/* 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; */
|
||||
%%
|
||||
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;
|
||||
|
||||
/* 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; */
|
||||
/* } */
|
||||
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;
|
||||
}
|
||||
|
||||
/* /\* The pipeline unrefs the event, but we want to keep the ownership *\/ */
|
||||
/* gst_event_ref(event); */
|
||||
/* The pipeline unrefs the event, but we want to keep the ownership */
|
||||
gst_event_ref(event);
|
||||
|
||||
/* ret = gst_element_send_event(GST_ELEMENT(self->obj), event); */
|
||||
/* return PyBool_FromLong(ret); */
|
||||
ret = gst_element_send_event(GST_ELEMENT(self->obj), event);
|
||||
return PyBool_FromLong(ret);
|
||||
|
||||
/* } */
|
||||
/* %% */
|
||||
}
|
||||
%%
|
||||
override gst_element_query_position args
|
||||
static PyObject *
|
||||
|
|
|
@ -20,41 +20,6 @@
|
|||
* Author: Johan Dahlin <johan@gnome.org>
|
||||
*/
|
||||
%%
|
||||
override gst_event_discont_get_value kwargs
|
||||
static PyObject *
|
||||
_wrap_gst_event_discont_get_value(PyGstMiniObject *self, PyObject *args, PyObject *kwargs)
|
||||
{
|
||||
static char *kwlist[] = { "format", NULL};
|
||||
PyObject *pformat;
|
||||
GstFormat format;
|
||||
gint64 start, end;
|
||||
PyObject *ret;
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kwargs,
|
||||
"O:GstEvent.discont_get_value",
|
||||
kwlist, &pformat))
|
||||
return NULL;
|
||||
if (pyg_enum_get_value (GST_TYPE_FORMAT, pformat, (gint *) &format)) {
|
||||
PyErr_SetString(PyExc_TypeError, "argument should be a GstFormat");
|
||||
return NULL;
|
||||
}
|
||||
if (GST_EVENT_TYPE(self->obj) != GST_EVENT_DISCONTINUOUS) {
|
||||
PyErr_SetString(PyExc_TypeError, "Event is not a discontinuous event");
|
||||
return NULL;
|
||||
}
|
||||
if (!gst_event_discont_get_value(GST_EVENT (self->obj), format,
|
||||
&start, &end)) {
|
||||
Py_INCREF (Py_None);
|
||||
return Py_None;
|
||||
}
|
||||
|
||||
ret = PyList_New(0);
|
||||
PyList_Append(ret, PyLong_FromLongLong(start));
|
||||
PyList_Append(ret, PyLong_FromLongLong(end));
|
||||
|
||||
return ret;
|
||||
}
|
||||
%%
|
||||
override gst_event_get_structure noargs
|
||||
static PyObject *
|
||||
_wrap_gst_event_get_structure(PyGstMiniObject *self)
|
||||
|
|
Loading…
Reference in a new issue