diff --git a/ChangeLog b/ChangeLog index f395b671bc..f39dd062a7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +2005-10-19 Edward Hervey + + * gst/gst-types.defs: + * gst/gst.defs: + Update (hopefully) final API modifications + + * gst/gstelement.override: + * gst/gstpad.override: + * gst/gstquery.override: + Updated position querying/parsing + Removed useless debug line + + * testsuite/test_element.py: + Updated test for new API + 2005-10-19 Edward Hervey * gst/gstmessage.override: diff --git a/gst/gst-types.defs b/gst/gst-types.defs index 91c82808fd..bd125698c4 100644 --- a/gst/gst-types.defs +++ b/gst/gst-types.defs @@ -812,6 +812,7 @@ (values '("none" "GST_QUERY_NONE") '("position" "GST_QUERY_POSITION") + '("duration" "GST_QUERY_DURATION") '("latency" "GST_QUERY_LATENCY") '("jitter" "GST_QUERY_JITTER") '("rate" "GST_QUERY_RATE") diff --git a/gst/gst.defs b/gst/gst.defs index 30bb271f68..b21cb4b9b3 100644 --- a/gst/gst.defs +++ b/gst/gst.defs @@ -4100,7 +4100,6 @@ (parameters '("GstFormat" "format") '("gint64" "cur") - '("gint64" "end") ) ) @@ -4111,7 +4110,34 @@ (parameters '("GstFormat*" "format") '("gint64*" "cur") - '("gint64*" "end") + ) +) + +(define-function gst_query_new_duration + (c-name "gst_query_new_duration") + (return-type "GstQuery*") + (parameters + '("GstFormat" "format") + ) +) + +(define-method set_duration + (of-object "GstQuery") + (c-name "gst_query_set_duration") + (return-type "none") + (parameters + '("GstFormat" "format") + '("gint64" "duration") + ) +) + +(define-method parse_duration + (of-object "GstQuery") + (c-name "gst_query_parse_duration") + (return-type "none") + (parameters + '("GstFormat*" "format") + '("gint64*" "duration") ) ) @@ -4168,7 +4194,6 @@ '("GstFormat" "format") '("gint64" "start_value") '("gint64" "stop_value") - '("gint64" "base") ) ) @@ -4181,7 +4206,6 @@ '("GstFormat*" "format") '("gint64*" "start_value") '("gint64*" "stop_value") - '("gint64*" "base") ) ) @@ -6003,7 +6027,16 @@ (parameters '("GstFormat*" "format") '("gint64*" "cur") - '("gint64*" "end") + ) +) + +(define-method query_duration + (of-object "GstElement") + (c-name "gst_element_query_duration") + (return-type "gboolean") + (parameters + '("GstFormat*" "format") + '("gint64*" "duration") ) ) @@ -6081,7 +6114,16 @@ (parameters '("GstFormat*" "format") '("gint64*" "cur") - '("gint64*" "end") + ) +) + +(define-method query_duration + (of-object "GstPad") + (c-name "gst_pad_query_duration") + (return-type "gboolean") + (parameters + '("GstFormat*" "format") + '("gint64*" "duration") ) ) diff --git a/gst/gstelement.override b/gst/gstelement.override index 2583004188..3fc24e0fa2 100644 --- a/gst/gstelement.override +++ b/gst/gstelement.override @@ -91,8 +91,6 @@ _wrap_gst_element_get_state(PyGObject *self, PyObject *args, PyObject *kwargs) return NULL; } - GST_DEBUG ("timeout:%lld", timeout); - pyg_begin_allow_threads; ret = gst_element_get_state(GST_ELEMENT (self->obj), &state, &pending, @@ -364,7 +362,7 @@ override gst_element_query_position args static PyObject * _wrap_gst_element_query_position (PyGObject *self, PyObject *args) { - gint64 cur, end; + gint64 cur; gint format; PyObject *pformat; PyObject *ret; @@ -376,9 +374,8 @@ _wrap_gst_element_query_position (PyGObject *self, PyObject *args) } ret = PyList_New(0); - if ((gst_element_query_position(GST_ELEMENT (self->obj), (GstFormat*) &format, &cur, &end))) { + if ((gst_element_query_position(GST_ELEMENT (self->obj), (GstFormat*) &format, &cur))) { PyList_Append(ret, PyLong_FromLongLong(cur)); - PyList_Append(ret, PyLong_FromLongLong(end)); PyList_Append(ret, pyg_enum_from_gtype (GST_TYPE_FORMAT, format )); } else { g_print("FIXME: query failed\n"); diff --git a/gst/gstpad.override b/gst/gstpad.override index d24e4309c7..e14f213bde 100644 --- a/gst/gstpad.override +++ b/gst/gstpad.override @@ -663,7 +663,7 @@ override gst_pad_query_position args static PyObject * _wrap_gst_pad_query_position (PyGObject *self, PyObject *args) { - gint64 cur, end; + gint64 cur; gint format; PyObject *pformat; PyObject *ret; @@ -674,10 +674,9 @@ _wrap_gst_pad_query_position (PyGObject *self, PyObject *args) return NULL; } - if ((gst_pad_query_position(GST_PAD (self->obj), (GstFormat*) &format, &cur, &end))) { - ret = PyList_New(3); + if ((gst_pad_query_position(GST_PAD (self->obj), (GstFormat*) &format, &cur))) { + ret = PyList_New(2); PyList_SetItem(ret, 0, PyLong_FromLongLong(cur)); - PyList_SetItem(ret, 1, PyLong_FromLongLong(end)); PyList_SetItem(ret, 2, pyg_enum_from_gtype (GST_TYPE_FORMAT, format )); } else { Py_INCREF(Py_None); diff --git a/gst/gstquery.override b/gst/gstquery.override index 01f9acd8fb..52c8ff2e30 100644 --- a/gst/gstquery.override +++ b/gst/gstquery.override @@ -26,7 +26,7 @@ static PyObject * _wrap_gst_query_parse_position (PyGstMiniObject *self) { GstFormat format; - gint64 cur, end; + gint64 cur; PyObject *ret; if (GST_QUERY_TYPE(self->obj) != GST_QUERY_POSITION) { @@ -34,12 +34,11 @@ _wrap_gst_query_parse_position (PyGstMiniObject *self) return NULL; } - gst_query_parse_position (GST_QUERY(self->obj), &format, &cur, &end); + gst_query_parse_position (GST_QUERY(self->obj), &format, &cur); - ret = PyList_New(3); + ret = PyList_New(2); PyList_SetItem(ret, 0, pyg_enum_from_gtype(GST_TYPE_FORMAT, format)); PyList_SetItem(ret, 1, PyLong_FromLongLong(cur)); - PyList_SetItem(ret, 2, PyLong_FromLongLong(end)); return ret; } @@ -79,7 +78,6 @@ _wrap_gst_query_parse_segment (PyGstMiniObject *self) GstFormat format; gint64 start_value; gint64 stop_value; - gint64 base; if (GST_QUERY_TYPE(self->obj) != GST_QUERY_SEGMENT) { PyErr_SetString(PyExc_TypeError, "Query is not a 'Segment' query"); @@ -88,14 +86,13 @@ _wrap_gst_query_parse_segment (PyGstMiniObject *self) gst_query_parse_segment (GST_QUERY(self->obj), &rate, &format, - &start_value, &stop_value, &base); + &start_value, &stop_value); - ret = PyList_New(5); + ret = PyList_New(4); PyList_SetItem (ret, 0, PyFloat_FromDouble(rate)); PyList_SetItem (ret, 1, pyg_enum_from_gtype (GST_TYPE_FORMAT, format)); PyList_SetItem (ret, 2, PyLong_FromUnsignedLongLong(start_value)); PyList_SetItem (ret, 3, PyLong_FromUnsignedLongLong(stop_value)); - PyList_SetItem (ret, 4, PyLong_FromUnsignedLongLong(base)); return ret; } diff --git a/testsuite/test_element.py b/testsuite/test_element.py index 71b9438627..7c94dbb503 100644 --- a/testsuite/test_element.py +++ b/testsuite/test_element.py @@ -197,7 +197,6 @@ class QueryTest(TestCase): self.assertEquals(sys.getrefcount(self.element), 3) assert res assert res[0] == 0 - assert res[1] == -1 res = self.element.query_position(gst.FORMAT_TIME) assert not res self.gccollect()