? gst-libs
? wrap_query_duration.patch
Index: gst/gstelement.override
===================================================================
RCS file: /cvs/gstreamer/gst-python/gst/gstelement.override,v
retrieving revision 1.26
diff -u -r1.26 gstelement.override
--- gst/gstelement.override	27 Oct 2005 09:51:18 -0000	1.26
+++ gst/gstelement.override	31 Oct 2005 22:30:53 -0000
@@ -386,6 +386,34 @@
     return ret;
 }
 %%
+override gst_element_query_duration args
+static PyObject *
+_wrap_gst_element_query_duration (PyGObject *self, PyObject *args)
+{
+    gint64  cur;
+    gint    format;
+    PyObject    *pformat;
+    PyObject    *ret;
+
+    pformat = (PyObject*)PyTuple_GetItem(args, 0);
+    if (pyg_enum_get_value (GST_TYPE_FORMAT, pformat, &format)) {
+        PyErr_SetString(PyExc_TypeError, "argument should be a GstFormat");
+        return NULL;
+    }
+
+    ret = PyList_New(0);
+    if (!(gst_element_query_duration(GST_ELEMENT (self->obj), (GstFormat*) &format, &cur))) {
+    PyErr_Format(PyGstExc_QueryError,
+             "query failed");
+        return NULL;
+    }
+
+    PyList_Append(ret, PyLong_FromLongLong(cur));
+    PyList_Append(ret, pyg_enum_from_gtype (GST_TYPE_FORMAT, format ));
+
+    return ret;
+}
+%%
 override gst_element_query_convert kwargs
 static PyObject *
 _wrap_gst_element_query_convert (PyGObject *self, PyObject *args, PyObject *kwargs)
Index: gst/gstquery.override
===================================================================
RCS file: /cvs/gstreamer/gst-python/gst/gstquery.override,v
retrieving revision 1.7
diff -u -r1.7 gstquery.override
--- gst/gstquery.override	19 Oct 2005 17:32:29 -0000	1.7
+++ gst/gstquery.override	31 Oct 2005 22:30:53 -0000
@@ -43,6 +43,28 @@
 	return ret;
 }
 %%
+override gst_query_parse_duration noargs
+static PyObject *
+_wrap_gst_query_parse_duration (PyGstMiniObject *self)
+{
+    GstFormat   format;
+    gint64      cur;
+    PyObject    *ret;
+
+    if (GST_QUERY_TYPE(self->obj) != GST_QUERY_DURATION) {
+        PyErr_SetString(PyExc_TypeError, "Query is not a 'Duration' query");
+        return NULL;
+    }
+    
+    gst_query_parse_duration (GST_QUERY(self->obj), &format, &cur);
+    
+    ret = PyList_New(2);
+    PyList_SetItem(ret, 0, pyg_enum_from_gtype(GST_TYPE_FORMAT, format));
+    PyList_SetItem(ret, 1, PyLong_FromLongLong(cur));
+
+    return ret;
+}
+%%
 override gst_query_parse_convert noargs
 static PyObject *
 _wrap_gst_query_parse_convert (PyGstMiniObject *self)
