mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-30 12:49:40 +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:
|
* configure.ac:
|
||||||
back to development
|
back to development
|
||||||
|
|
||||||
=== gst-python 0.8.3 ===
|
=== gst-python 0.9.3 ===
|
||||||
|
|
||||||
2005-10-03 Thomas Vander Stichele <thomas at apestaart dot org>
|
2005-10-03 Thomas Vander Stichele <thomas at apestaart dot org>
|
||||||
|
|
||||||
* configure.ac:
|
* configure.ac:
|
||||||
Releasing 0.8.3, "For the Virgin"
|
Releasing 0.9.3, "For the Virgin"
|
||||||
|
|
||||||
2005-10-02 Johan Dahlin <johan@gnome.org>
|
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 state;
|
||||||
GstState pending;
|
GstState pending;
|
||||||
GstStateChangeReturn ret;
|
GstStateChangeReturn ret;
|
||||||
PyObject *timeout = Py_None;
|
PyObject *timeout = NULL;
|
||||||
|
gdouble timeoutd;
|
||||||
GTimeVal *timevalp = NULL;
|
GTimeVal *timevalp = NULL;
|
||||||
GTimeVal timeval;
|
GTimeVal timeval;
|
||||||
PyObject *tuple;
|
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,
|
if (!PyArg_ParseTupleAndKeywords(args, kwargs,
|
||||||
"|O:GstElement.get_state", kwlist,
|
"|O:GstElement.get_state", kwlist,
|
||||||
&timeout)) {
|
&timeout)) {
|
||||||
PyErr_SetString(PyExc_RuntimeError, "Timeout not specified correctly");
|
PyErr_SetString(PyExc_RuntimeError, "Timeout not specified correctly");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
if (timeout != Py_None) {
|
if (timeout == Py_None) {
|
||||||
gdouble timeoutd;
|
/* infinite timeout */
|
||||||
|
}
|
||||||
if (!PyFloat_Check (timeout)) {
|
else {
|
||||||
PyErr_SetString(PyExc_TypeError, "Timeout not specified as double");
|
if (timeout == NULL) {
|
||||||
return NULL;
|
timeoutd = 0.0;
|
||||||
|
} else {
|
||||||
|
if (!PyFloat_Check (timeout)) {
|
||||||
|
PyErr_SetString(PyExc_TypeError, "Timeout not specified as double");
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
timeoutd = PyFloat_AsDouble (timeout);
|
||||||
}
|
}
|
||||||
timeoutd = PyFloat_AsDouble (timeout);
|
|
||||||
|
|
||||||
timeval.tv_sec = (glong) timeoutd;
|
timeval.tv_sec = (glong) timeoutd;
|
||||||
timeval.tv_usec = (glong) ((timeoutd - (gdouble) timeval.tv_sec)
|
timeval.tv_usec = (glong) ((timeoutd - (gdouble) timeval.tv_sec)
|
||||||
* 1000.0 * 1000.0);
|
* 1000.0 * 1000.0);
|
||||||
timevalp = &timeval;
|
timevalp = &timeval;
|
||||||
} else {
|
|
||||||
GST_TIME_TO_TIMEVAL (0, timeval);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = gst_element_get_state(GST_ELEMENT (self->obj), &state, &pending,
|
ret = gst_element_get_state(GST_ELEMENT (self->obj), &state, &pending,
|
||||||
&timeval);
|
timevalp);
|
||||||
|
|
||||||
tuple = Py_BuildValue("OOO",
|
tuple = Py_BuildValue("OOO",
|
||||||
pyg_enum_from_gtype (GST_TYPE_STATE_CHANGE_RETURN, ret),
|
pyg_enum_from_gtype (GST_TYPE_STATE_CHANGE_RETURN, ret),
|
||||||
|
|
|
@ -121,6 +121,51 @@ class BinAddRemove(TestCase):
|
||||||
self.assertRaises(gst.AddError, self.bin.add, src, sink)
|
self.assertRaises(gst.AddError, self.bin.add, src, sink)
|
||||||
self.bin.remove(src, sink)
|
self.bin.remove(src, sink)
|
||||||
self.assertRaises(gst.RemoveError, 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__":
|
if __name__ == "__main__":
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|
Loading…
Reference in a new issue