mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
fix version numbers
Original commit message from CVS: fix version numbers
This commit is contained in:
parent
a903161f22
commit
c032ce22d4
3 changed files with 67 additions and 13 deletions
|
@ -3,12 +3,12 @@
|
|||
* configure.ac:
|
||||
back to development
|
||||
|
||||
=== gst-python 0.8.3 ===
|
||||
=== gst-python 0.9.3 ===
|
||||
|
||||
2005-10-03 Thomas Vander Stichele <thomas at apestaart dot org>
|
||||
|
||||
* configure.ac:
|
||||
Releasing 0.8.3, "For the Virgin"
|
||||
Releasing 0.9.3, "For the Virgin"
|
||||
|
||||
2005-10-02 Johan Dahlin <johan@gnome.org>
|
||||
|
||||
|
|
|
@ -81,36 +81,45 @@ _wrap_gst_element_get_state(PyGObject *self, PyObject *args, PyObject *kwargs)
|
|||
GstState state;
|
||||
GstState pending;
|
||||
GstStateChangeReturn ret;
|
||||
PyObject *timeout = Py_None;
|
||||
PyObject *timeout = NULL;
|
||||
gdouble timeoutd;
|
||||
GTimeVal *timevalp = NULL;
|
||||
GTimeVal timeval;
|
||||
PyObject *tuple;
|
||||
|
||||
/*
|
||||
* infinite timeout: timevalp == NULL
|
||||
* 0 timeout: timeval set to 0, timevalp points to timeval
|
||||
* x timeout: timeval set to gdouble conversion, timevalp points to timeval
|
||||
*/
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kwargs,
|
||||
"|O:GstElement.get_state", kwlist,
|
||||
&timeout)) {
|
||||
PyErr_SetString(PyExc_RuntimeError, "Timeout not specified correctly");
|
||||
return NULL;
|
||||
}
|
||||
if (timeout != Py_None) {
|
||||
gdouble timeoutd;
|
||||
|
||||
if (timeout == Py_None) {
|
||||
/* infinite timeout */
|
||||
}
|
||||
else {
|
||||
if (timeout == NULL) {
|
||||
timeoutd = 0.0;
|
||||
} else {
|
||||
if (!PyFloat_Check (timeout)) {
|
||||
PyErr_SetString(PyExc_TypeError, "Timeout not specified as double");
|
||||
return NULL;
|
||||
}
|
||||
timeoutd = PyFloat_AsDouble (timeout);
|
||||
}
|
||||
|
||||
timeval.tv_sec = (glong) timeoutd;
|
||||
timeval.tv_usec = (glong) ((timeoutd - (gdouble) timeval.tv_sec)
|
||||
* 1000.0 * 1000.0);
|
||||
timevalp = &timeval;
|
||||
} else {
|
||||
GST_TIME_TO_TIMEVAL (0, timeval);
|
||||
}
|
||||
|
||||
ret = gst_element_get_state(GST_ELEMENT (self->obj), &state, &pending,
|
||||
&timeval);
|
||||
timevalp);
|
||||
|
||||
tuple = Py_BuildValue("OOO",
|
||||
pyg_enum_from_gtype (GST_TYPE_STATE_CHANGE_RETURN, ret),
|
||||
|
|
|
@ -122,5 +122,50 @@ class BinAddRemove(TestCase):
|
|||
self.bin.remove(src, sink)
|
||||
self.assertRaises(gst.RemoveError, self.bin.remove, src, sink)
|
||||
|
||||
class Preroll(TestCase):
|
||||
def setUp(self):
|
||||
TestCase.setUp(self)
|
||||
self.bin = gst.Bin('bin')
|
||||
|
||||
def tearDown(self):
|
||||
del self.bin
|
||||
TestCase.tearDown(self)
|
||||
|
||||
def testFake(self):
|
||||
src = gst.element_factory_make('fakesrc')
|
||||
sink = gst.element_factory_make('fakesink')
|
||||
self.bin.add(src)
|
||||
|
||||
# bin will go to paused, src pad task will start and error out
|
||||
self.bin.set_state(gst.STATE_PAUSED)
|
||||
ret = self.bin.get_state(timeout=None)
|
||||
self.assertEquals(ret[0], gst.STATE_CHANGE_SUCCESS)
|
||||
self.assertEquals(ret[1], gst.STATE_PAUSED)
|
||||
self.assertEquals(ret[2], gst.STATE_VOID_PENDING)
|
||||
|
||||
# adding the sink will cause the bin to go in preroll mode
|
||||
gst.debug('adding sink and setting to PAUSED, should cause preroll')
|
||||
self.bin.add(sink)
|
||||
sink.set_state(gst.STATE_PAUSED)
|
||||
ret = self.bin.get_state(timeout=0.0)
|
||||
self.assertEquals(ret[0], gst.STATE_CHANGE_ASYNC)
|
||||
self.assertEquals(ret[1], gst.STATE_PAUSED)
|
||||
self.assertEquals(ret[2], gst.STATE_VOID_PENDING)
|
||||
print ret
|
||||
|
||||
# to actually complete preroll, we need to link and re-enable fakesrc
|
||||
src.set_state(gst.STATE_READY)
|
||||
src.link(sink)
|
||||
src.set_state(gst.STATE_PAUSED)
|
||||
ret = self.bin.get_state(timeout=None)
|
||||
self.assertEquals(ret[0], gst.STATE_CHANGE_SUCCESS)
|
||||
self.assertEquals(ret[1], gst.STATE_PAUSED)
|
||||
self.assertEquals(ret[2], gst.STATE_VOID_PENDING)
|
||||
|
||||
print ret
|
||||
|
||||
self.bin.set_state(gst.STATE_NULL)
|
||||
self.bin.get_state(timeout=None)
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
|
Loading…
Reference in a new issue