gst/: update for latest API changes
authorThomas Vander Stichele <thomas@apestaart.org>
Wed, 19 Oct 2005 11:45:34 +0000 (11:45 +0000)
committerThomas Vander Stichele <thomas@apestaart.org>
Wed, 19 Oct 2005 11:45:34 +0000 (11:45 +0000)
Original commit message from CVS:
* 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

ChangeLog
gst/gst.defs
gst/gstelement.override
gst/gstmessage.override
testsuite/test_pad.py

index 5b656e3..69dfd76 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+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.
index 2c29cb3..d78adf5 100644 (file)
   (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")
   )
 )
 
index b46b1b0..8cda4e1 100644 (file)
@@ -82,15 +82,9 @@ _wrap_gst_element_get_state(PyGObject *self, PyObject *args, PyObject *kwargs)
     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)) {
@@ -102,17 +96,12 @@ _wrap_gst_element_get_state(PyGObject *self, PyObject *args, PyObject *kwargs)
       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;
index 71290e0..132746d 100644 (file)
@@ -76,7 +76,8 @@ override gst_message_parse_segment_start noargs
 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 */
@@ -84,31 +85,40 @@ _wrap_gst_message_parse_segment_start (PyGstMiniObject *self)
          PyErr_SetString(PyExc_TypeError, "Message is not a segment start message");
          return NULL;
   }
-  gst_message_parse_segment_start (GST_MESSAGE(self->obj), &timestart);
+  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), &timestart);
+  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 *
index b110db8..10c65c6 100644 (file)
@@ -283,6 +283,7 @@ class PadProbePipeTest(TestCase):
             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)
 
@@ -318,6 +319,8 @@ class PadProbePipeTest(TestCase):
         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):