diff --git a/ChangeLog b/ChangeLog index a58db209d0..97ba2739cd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2005-09-21 Andy Wingo + + * gst/gst.defs: Update for probe removal api + + * gst/gstpad.override (_wrap_gst_pad_remove_data_probe) + (_wrap_gst_pad_remove_event_probe) + (_wrap_gst_pad_remove_buffer_probe): Removed, upstream does the + right thing now. + (_wrap_gst_pad_add_data_probe, _wrap_gst_pad_add_event_probe) + (_wrap_gst_pad_add_buffer_probe): Indent. + 2005-09-20 Thomas Vander Stichele * gst/gst.defs: diff --git a/gst/gst.defs b/gst/gst.defs index e17e8807a6..d5b2cbf801 100644 --- a/gst/gst.defs +++ b/gst/gst.defs @@ -3497,8 +3497,7 @@ (c-name "gst_pad_remove_data_probe") (return-type "none") (parameters - '("GCallback" "handler") - '("gpointer" "data") + '("guint" "handler_id") ) ) @@ -3517,8 +3516,7 @@ (c-name "gst_pad_remove_event_probe") (return-type "none") (parameters - '("GCallback" "handler") - '("gpointer" "data") + '("guint" "handler_id") ) ) @@ -3537,8 +3535,7 @@ (c-name "gst_pad_remove_buffer_probe") (return-type "none") (parameters - '("GCallback" "handler") - '("gpointer" "data") + '("guint" "handler_id") ) ) diff --git a/gst/gstpad.override b/gst/gstpad.override index 552e5bed9b..5172b2058d 100644 --- a/gst/gstpad.override +++ b/gst/gstpad.override @@ -598,20 +598,20 @@ _wrap_gst_pad_add_data_probe(PyGObject *self, PyObject *args) len = PyTuple_Size(args); if (len < 1) { - PyErr_SetString(PyExc_TypeError, "Probe requires at least 1 arg"); - return NULL; + PyErr_SetString(PyExc_TypeError, "Probe requires at least 1 arg"); + return NULL; } callback = PySequence_GetItem(args, 0); if (!PyCallable_Check(callback)) { - PyErr_SetString(PyExc_TypeError, "callback is not callable"); - return NULL; + PyErr_SetString(PyExc_TypeError, "callback is not callable"); + return NULL; } cbargs = PySequence_GetSlice(args, 1, len); if (cbargs == NULL) - return NULL; + return NULL; data = Py_BuildValue("(ON)", callback, cbargs); if (data == NULL) - return NULL; + return NULL; sigid = gst_pad_add_data_probe (GST_PAD (self->obj), (GCallback) probe_handler_marshal, data); return PyLong_FromUnsignedLong(sigid); @@ -628,20 +628,20 @@ _wrap_gst_pad_add_event_probe(PyGObject *self, PyObject *args) len = PyTuple_Size(args); if (len < 1) { - PyErr_SetString(PyExc_TypeError, "Probe requires at least 1 arg"); - return NULL; + PyErr_SetString(PyExc_TypeError, "Probe requires at least 1 arg"); + return NULL; } callback = PySequence_GetItem(args, 0); if (!PyCallable_Check(callback)) { - PyErr_SetString(PyExc_TypeError, "callback is not callable"); - return NULL; + PyErr_SetString(PyExc_TypeError, "callback is not callable"); + return NULL; } cbargs = PySequence_GetSlice(args, 1, len); if (cbargs == NULL) - return NULL; + return NULL; data = Py_BuildValue("(ON)", callback, cbargs); if (data == NULL) - return NULL; + return NULL; sigid = gst_pad_add_event_probe (GST_PAD (self->obj), (GCallback) probe_handler_marshal, data); return PyLong_FromUnsignedLong(sigid); @@ -658,104 +658,25 @@ _wrap_gst_pad_add_buffer_probe(PyGObject *self, PyObject *args) len = PyTuple_Size(args); if (len < 1) { - PyErr_SetString(PyExc_TypeError, "Probe requires at least 1 arg"); - return NULL; + PyErr_SetString(PyExc_TypeError, "Probe requires at least 1 arg"); + return NULL; } callback = PySequence_GetItem(args, 0); if (!PyCallable_Check(callback)) { - PyErr_SetString(PyExc_TypeError, "callback is not callable"); - return NULL; + PyErr_SetString(PyExc_TypeError, "callback is not callable"); + return NULL; } cbargs = PySequence_GetSlice(args, 1, len); if (cbargs == NULL) - return NULL; + return NULL; data = Py_BuildValue("(ON)", callback, cbargs); if (data == NULL) - return NULL; + return NULL; sigid = gst_pad_add_buffer_probe (GST_PAD (self->obj), (GCallback) probe_handler_marshal, data); return PyLong_FromUnsignedLong(sigid); } %% -override gst_pad_remove_data_probe kwargs -static PyObject * -_wrap_gst_pad_remove_data_probe(PyGObject *self, PyObject *args, PyObject *kwargs) -{ - static char *kwlist[] = { "signalid", NULL }; - gulong signalid; - GstPad *pad = GST_PAD (self->obj); - - if (!PyArg_ParseTupleAndKeywords(args, kwargs, - "k:GstPad.remove_data_probe", - kwlist, &signalid)) - return NULL; - GST_LOCK (pad); - if (!g_signal_handler_is_connected ((gpointer) pad, signalid)) { - GST_UNLOCK (pad); - Py_INCREF (Py_False); - return Py_False; - } - g_signal_handler_disconnect ((gpointer) pad, signalid); - GST_PAD_DO_BUFFER_SIGNALS (pad) -= 1; - GST_PAD_DO_EVENT_SIGNALS (pad) -= 1; - - GST_UNLOCK (pad); - Py_INCREF (Py_True); - return Py_True; -} -%% -override gst_pad_remove_event_probe kwargs -static PyObject * -_wrap_gst_pad_remove_event_probe(PyGObject *self, PyObject *args, PyObject *kwargs) -{ - static char *kwlist[] = { "signalid", NULL }; - gulong signalid; - GstPad *pad = GST_PAD (self->obj); - - if (!PyArg_ParseTupleAndKeywords(args, kwargs, - "k:GstPad.remove_event_probe", - kwlist, &signalid)) - return NULL; - GST_LOCK (pad); - if (!g_signal_handler_is_connected ((gpointer) pad, signalid)) { - GST_UNLOCK (pad); - Py_INCREF (Py_False); - return Py_False; - } - g_signal_handler_disconnect ((gpointer) pad, signalid); - GST_PAD_DO_EVENT_SIGNALS (pad) -= 1; - - GST_UNLOCK (pad); - Py_INCREF (Py_True); - return Py_True; -} -%% -override gst_pad_remove_buffer_probe kwargs -static PyObject * -_wrap_gst_pad_remove_buffer_probe(PyGObject *self, PyObject *args, PyObject *kwargs) -{ - static char *kwlist[] = { "signalid", NULL }; - gulong signalid; - GstPad *pad = GST_PAD (self->obj); - - if (!PyArg_ParseTupleAndKeywords(args, kwargs, - "k:GstPad.remove_buffer_probe", - kwlist, &signalid)) - return NULL; - GST_LOCK (pad); - if (!g_signal_handler_is_connected ((gpointer) pad, signalid)) { - GST_UNLOCK (pad); - Py_INCREF (Py_False); - return Py_False; - } - g_signal_handler_disconnect ((gpointer) pad, signalid); - GST_PAD_DO_BUFFER_SIGNALS (pad) -= 1; - - GST_UNLOCK (pad); - Py_INCREF (Py_True); - return Py_True; -} -%% override-slot GstPadTemplate.tp_getattr #define IS_ATTR(name) (strcmp (name, attr) == 0) PyObject *