now we can send events to elements again

Original commit message from CVS:
* gst/gstelement.override:
* testsuite/test_event.py:
now we can send events to elements again
This commit is contained in:
Thomas Vander Stichele 2005-10-09 16:02:42 +00:00
parent c3f136f836
commit c37b502949
3 changed files with 22 additions and 11 deletions

View file

@ -1,3 +1,9 @@
2005-10-09 Thomas Vander Stichele <thomas at apestaart dot org>
* gst/gstelement.override:
* testsuite/test_event.py:
now we can send events to elements again
2005-10-09 Thomas Vander Stichele <thomas at apestaart dot org> 2005-10-09 Thomas Vander Stichele <thomas at apestaart dot org>
* gst/gst.defs: * gst/gst.defs:

View file

@ -370,9 +370,9 @@ _wrap_gst_element_send_event(PyGObject *self, PyObject *args, PyObject *kwargs)
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:GstElement.send_event", kwlist, &py_event)) if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:GstElement.send_event", kwlist, &py_event))
return NULL; return NULL;
if (pyg_boxed_check(py_event, GST_TYPE_EVENT)) if (pygstminiobject_check (py_event, &PyGstEvent_Type)) {
event = pyg_boxed_get(py_event, GstEvent); event = GST_EVENT (pygstminiobject_get (py_event));
else { } else {
PyErr_SetString(PyExc_TypeError, "event should be a GstEvent"); PyErr_SetString(PyExc_TypeError, "event should be a GstEvent");
return NULL; return NULL;
} }
@ -406,6 +406,7 @@ _wrap_gst_element_query_position (PyGObject *self, PyObject *args)
PyList_Append(ret, PyLong_FromLongLong(end)); PyList_Append(ret, PyLong_FromLongLong(end));
PyList_Append(ret, pyg_enum_from_gtype (GST_TYPE_FORMAT, format )); PyList_Append(ret, pyg_enum_from_gtype (GST_TYPE_FORMAT, format ));
} else { } else {
g_print("FIXME: query failed\n");
Py_INCREF(Py_None); Py_INCREF(Py_None);
ret = Py_None; ret = Py_None;
} }

View file

@ -30,14 +30,18 @@ class EventTest(unittest.TestCase):
self.sink = pipeline.get_by_name('sink') self.sink = pipeline.get_by_name('sink')
pipeline.set_state(gst.STATE_PLAYING) pipeline.set_state(gst.STATE_PLAYING)
# def testEventEmpty(self): def testEventSeek(self):
# event = gst.Event(gst.EVENT_EMPTY) event = gst.event_new_seek(1.0, gst.FORMAT_BYTES, gst.SEEK_FLAG_FLUSH,
# self.sink.send_event(event) gst.SEEK_TYPE_NONE, 0, gst.SEEK_TYPE_NONE, 0)
assert event
self.sink.send_event(event)
def testWrongEvent(self):
buffer = gst.Buffer()
self.assertRaises(TypeError, self.sink.send_event, buffer)
number = 1
self.assertRaises(TypeError, self.sink.send_event, number)
# def testEventSeek(self):
# event = gst.event_new_seek(gst.SEEK_METHOD_CUR, 0)
# assert event
# self.sink.send_event(event)
# FIXME: fix these tests # FIXME: fix these tests
#class EventFileSrcTest(unittest.TestCase): #class EventFileSrcTest(unittest.TestCase):