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>
* 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))
return NULL;
if (pyg_boxed_check(py_event, GST_TYPE_EVENT))
event = pyg_boxed_get(py_event, GstEvent);
else {
if (pygstminiobject_check (py_event, &PyGstEvent_Type)) {
event = GST_EVENT (pygstminiobject_get (py_event));
} else {
PyErr_SetString(PyExc_TypeError, "event should be a GstEvent");
return NULL;
}
@ -406,6 +406,7 @@ _wrap_gst_element_query_position (PyGObject *self, PyObject *args)
PyList_Append(ret, PyLong_FromLongLong(end));
PyList_Append(ret, pyg_enum_from_gtype (GST_TYPE_FORMAT, format ));
} else {
g_print("FIXME: query failed\n");
Py_INCREF(Py_None);
ret = Py_None;
}

View file

@ -30,14 +30,18 @@ class EventTest(unittest.TestCase):
self.sink = pipeline.get_by_name('sink')
pipeline.set_state(gst.STATE_PLAYING)
# def testEventEmpty(self):
# event = gst.Event(gst.EVENT_EMPTY)
# self.sink.send_event(event)
# def testEventSeek(self):
# event = gst.event_new_seek(gst.SEEK_METHOD_CUR, 0)
# assert event
# self.sink.send_event(event)
def testEventSeek(self):
event = gst.event_new_seek(1.0, gst.FORMAT_BYTES, gst.SEEK_FLAG_FLUSH,
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)
# FIXME: fix these tests
#class EventFileSrcTest(unittest.TestCase):