diff options
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | gst/gst.defs | 14 | ||||
-rw-r--r-- | gst/gstbus.override | 22 | ||||
-rw-r--r-- | testsuite/test_bus.py | 2 | ||||
-rw-r--r-- | testsuite/test_pipeline.py | 3 |
5 files changed, 23 insertions, 26 deletions
@@ -1,6 +1,14 @@ 2005-09-29 Edward Hervey <edward@fluendo.com> * gst/gst.defs: + * gst/gstbus.override: + * testsuite/test_bus.py: + * testsuite/test_pipeline.py: + Updated definitions, wrapper and testsuite for changes in GstBus API + +2005-09-29 Edward Hervey <edward@fluendo.com> + + * gst/gst.defs: Updated definitions * gst/gst.override: ignoring _init, gst_param_spec* and gst_iterator_new_list functions diff --git a/gst/gst.defs b/gst/gst.defs index 0a0b779..858053d 100644 --- a/gst/gst.defs +++ b/gst/gst.defs @@ -262,9 +262,6 @@ (of-object "GstBus") (c-name "gst_bus_have_pending") (return-type "gboolean") - (parameters - '("GstMessageType" "events") - ) ) (define-method peek @@ -304,9 +301,6 @@ (of-object "GstBus") (c-name "gst_bus_create_watch") (return-type "GSource*") - (parameters - '("GstMessageType" "events") - ) ) (define-method add_watch_full @@ -315,7 +309,6 @@ (return-type "guint") (parameters '("gint" "priority") - '("GstMessageType" "events") '("GstBusFunc" "func") '("gpointer" "user_data") '("GDestroyNotify" "notify") @@ -327,7 +320,6 @@ (c-name "gst_bus_add_watch") (return-type "guint") (parameters - '("GstMessageType" "events") '("GstBusFunc" "func") '("gpointer" "user_data") ) @@ -364,6 +356,12 @@ ) ) +(define-method add_signal_watch + (of-object "GstBus") + (c-name "gst_bus_add_signal_watch") + (return-type "guint") +) + ;; From ../gstreamer/gst/gstcaps.h diff --git a/gst/gstbus.override b/gst/gstbus.override index 3b10ee1..fd58c81 100644 --- a/gst/gstbus.override +++ b/gst/gstbus.override @@ -182,38 +182,30 @@ override gst_bus_add_watch args static PyObject * _wrap_gst_bus_add_watch (PyGObject *self, PyObject *args) { - PyObject *callback, *py_events, *cbargs = NULL, *data; + PyObject *callback, *cbargs = NULL, *data; guint sigid; guint len; - GstMessageType events; len = PyTuple_Size(args); - if (len < 2) { - PyErr_SetString(PyExc_TypeError, "Bus.add_watch requires at least 2 args"); - return NULL; - } - py_events = PySequence_GetItem(args, 0); - if (pyg_flags_get_value (GST_TYPE_MESSAGE_TYPE, py_events, - (gint *)&events)) { - PyErr_SetString(PyExc_TypeError, - "message type is not a GST_TYPE_MESSAGE_TYPE"); + if (len < 1) { + PyErr_SetString(PyExc_TypeError, "Bus.add_watch requires at least 1 argument"); return NULL; } - - callback = PySequence_GetItem(args, 1); + + callback = PySequence_GetItem(args, 0); if (!PyCallable_Check(callback)) { PyErr_SetString(PyExc_TypeError, "callback is not callable"); return NULL; } - cbargs = PySequence_GetSlice(args, 2, len); + cbargs = PySequence_GetSlice(args, 1, len); if (cbargs == NULL) return NULL; /* FIXME: thomas: I'm pretty sure the second N needs to be O */ data = Py_BuildValue("(ON)", callback, cbargs); if (data == NULL) return NULL; - sigid = gst_bus_add_watch (GST_BUS (self->obj), events, + sigid = gst_bus_add_watch (GST_BUS (self->obj), (GstBusFunc) bus_func, data); return PyInt_FromLong(sigid); diff --git a/testsuite/test_bus.py b/testsuite/test_bus.py index 0b7e15a..ab3e2dc 100644 --- a/testsuite/test_bus.py +++ b/testsuite/test_bus.py @@ -34,7 +34,7 @@ class BusAddWatchTest(TestCase): bus = pipeline.get_bus() self.assertEquals(bus.__gstrefcount__, 2) self.assertEquals(pipeline.__gstrefcount__, 1) - watch_id = bus.add_watch(gst.MESSAGE_ANY, self._message_received, pipeline, loop, "one") + watch_id = bus.add_watch(self._message_received, pipeline, loop, "one") self.assertEquals(bus.__gstrefcount__, 3) self.assertEquals(pipeline.__gstrefcount__, 1) diff --git a/testsuite/test_pipeline.py b/testsuite/test_pipeline.py index df6a609..2192e13 100644 --- a/testsuite/test_pipeline.py +++ b/testsuite/test_pipeline.py @@ -98,8 +98,7 @@ class PipelineAndBus(TestCase): self.bus = self.pipeline.get_bus() self.assertEquals(self.bus.__gstrefcount__, 2) - self.handler = self.bus.add_watch( - gst.MESSAGE_ANY, self._message_received) + self.handler = self.bus.add_watch(self._message_received) self.assertEquals(self.bus.__gstrefcount__, 3) self.loop = gobject.MainLoop() |