+2005-10-19 Thomas Vander Stichele <thomas at apestaart dot org>
+
+ * gst/gst.defs:
+ * gst/gstmessage.override:
+ update for latest API changes
+ * gst/gstelement.override:
+ use GstClockTime for get_state
+ * testsuite/test_pad.py:
+ add logging
+
2005-10-18 Andy Wingo <wingo@pobox.com>
* examples/pipeline-tester: Fix for state change changes.
(caller-owns-return #t)
(parameters
'("GstObject*" "src")
- '("GstClockTime" "timestamp")
+ '("GstFormat" "format")
+ '("gint64" "position")
)
)
(caller-owns-return #t)
(parameters
'("GstObject*" "src")
- '("GstClockTime" "timestamp")
+ '("GstFormat" "format")
+ '("gint64" "position")
)
)
GstState pending;
GstStateChangeReturn ret;
PyObject *timeout = NULL;
- gdouble timeoutd;
GstClockTime timeout64 = GST_CLOCK_TIME_NONE;
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)) {
timeout64 = GST_CLOCK_TIME_NONE;
}
else {
- if (timeout == NULL) {
- timeoutd = 0.0;
- } else {
- if (!PyFloat_Check (timeout)) {
- PyErr_SetString(PyExc_TypeError, "Timeout not specified as double");
+ if (!PyLong_Check (timeout)) {
+ PyErr_SetString(PyExc_TypeError, "timeout not specified as a long");
return NULL;
}
- timeoutd = PyFloat_AsDouble (timeout);
- }
+ timeout64 = PyLong_AsLong (timeout);
- timeout64 = timeoutd * GST_SECOND;
}
pyg_begin_allow_threads;
static PyObject *
_wrap_gst_message_parse_segment_start (PyGstMiniObject *self)
{
- GstClockTime timestart;
+ gint64 position;
+ GstFormat format;
PyObject *ret;
/* Should raise an exception if it's not a segment start message */
PyErr_SetString(PyExc_TypeError, "Message is not a segment start message");
return NULL;
}
- gst_message_parse_segment_start (GST_MESSAGE(self->obj), ×tart);
+ gst_message_parse_segment_start (GST_MESSAGE(self->obj), &format, &position);
+
/* Return this as a tuple */
- ret = PyLong_FromUnsignedLongLong(timestart);
+ ret = PyList_New(2);
+ PyList_SET_ITEM(ret, 0, pyg_enum_from_gtype(GST_TYPE_FORMAT, format));
+ PyList_SET_ITEM(ret, 1, PyLong_FromLongLong(position));
return ret;
}
+
%%
override gst_message_parse_segment_done noargs
static PyObject *
_wrap_gst_message_parse_segment_done (PyGstMiniObject *self)
{
- GstClockTime timestart;
+ gint64 position;
+ GstFormat format;
PyObject *ret;
- /* Should raise an exception if it's not a segment start message */
+ /* Should raise an exception if it's not a segment done message */
if (GST_MESSAGE(self->obj)->type != GST_MESSAGE_SEGMENT_DONE) {
PyErr_SetString(PyExc_TypeError, "Message is not a segment done message");
return NULL;
}
- gst_message_parse_segment_done (GST_MESSAGE(self->obj), ×tart);
+ gst_message_parse_segment_done (GST_MESSAGE(self->obj), &format, &position);
+
/* Return this as a tuple */
- ret = PyLong_FromUnsignedLongLong(timestart);
+ ret = PyList_New(2);
+ PyList_SET_ITEM(ret, 0, pyg_enum_from_gtype(GST_TYPE_FORMAT, format));
+ PyList_SET_ITEM(ret, 1, PyLong_FromLongLong(position));
return ret;
}
+
%%
override gst_message_parse_error noargs
static PyObject *
gst.debug('waiting for fakesink buffer')
pass
+ gst.debug('got buffers from fakesrc and fakesink')
self.assertEquals(self._got_fakesink_buffer, 1)
pad.remove_buffer_probe(id)
self._got_fakesink_buffer += 1
gst.debug('fakesink got buffer %r, %d total received' % (
buffer, self._got_fakesrc_buffer))
+ gst.debug('pad %r, py refcount %d, go rc %d, gst rc %d' % (
+ pad, sys.getrefcount(pad), pad.__grefcount__, pad.__gstrefcount__))
return True
def testRemovingProbe(self):