mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
configure.ac: need at least 2.6.3, because that contains the code that converts signal closure arguments to the corre...
Original commit message from CVS: * configure.ac: need at least 2.6.3, because that contains the code that converts signal closure arguments to the correct Gst types * gst/gstpad.override: log name of probe handlers we call * testsuite/test_pad.py: fix up tests; use TestCase base class methods
This commit is contained in:
parent
f4d65bd143
commit
ca1cb51d1a
4 changed files with 38 additions and 38 deletions
11
ChangeLog
11
ChangeLog
|
@ -1,3 +1,14 @@
|
||||||
|
2005-10-06 Thomas Vander Stichele <thomas at apestaart dot org>
|
||||||
|
|
||||||
|
* configure.ac:
|
||||||
|
need at least 2.6.3, because that contains the code that
|
||||||
|
converts signal closure arguments to the correct Gst
|
||||||
|
types
|
||||||
|
* gst/gstpad.override:
|
||||||
|
log name of probe handlers we call
|
||||||
|
* testsuite/test_pad.py:
|
||||||
|
fix up tests; use TestCase base class methods
|
||||||
|
|
||||||
2005-10-06 Edward Hervey <edward@fluendo.com>
|
2005-10-06 Edward Hervey <edward@fluendo.com>
|
||||||
|
|
||||||
* gst/pygstminiobject.c:
|
* gst/pygstminiobject.c:
|
||||||
|
|
|
@ -24,7 +24,7 @@ dnl Add parameters for aclocal
|
||||||
ACLOCAL="$ACLOCAL -I common/m4 $ACLOCAL_FLAGS"
|
ACLOCAL="$ACLOCAL -I common/m4 $ACLOCAL_FLAGS"
|
||||||
|
|
||||||
dnl required versions of other packages
|
dnl required versions of other packages
|
||||||
AC_SUBST(PYGTK_REQ, 2.6.1)
|
AC_SUBST(PYGTK_REQ, 2.6.3)
|
||||||
AC_SUBST(GLIB_REQ, 2.6.0)
|
AC_SUBST(GLIB_REQ, 2.6.0)
|
||||||
AC_SUBST(GTK_REQ, 2.6.0)
|
AC_SUBST(GTK_REQ, 2.6.0)
|
||||||
AC_SUBST(GST_REQ, 0.9.0)
|
AC_SUBST(GST_REQ, 0.9.0)
|
||||||
|
|
|
@ -115,11 +115,14 @@ probe_handler_marshal(GstPad *pad, GstMiniObject *data, gpointer user_data)
|
||||||
PyObject *ret;
|
PyObject *ret;
|
||||||
PyObject *py_data;
|
PyObject *py_data;
|
||||||
PyObject *py_user_data;
|
PyObject *py_user_data;
|
||||||
|
PyObject *repr;
|
||||||
gboolean res;
|
gboolean res;
|
||||||
gint len, i;
|
gint len, i;
|
||||||
|
|
||||||
g_return_val_if_fail(user_data != NULL, FALSE);
|
g_return_val_if_fail(user_data != NULL, FALSE);
|
||||||
|
|
||||||
|
GST_LOG_OBJECT (pad, "marshalling probe handler for object %"
|
||||||
|
GST_PTR_FORMAT, data);
|
||||||
state = pyg_gil_state_ensure();
|
state = pyg_gil_state_ensure();
|
||||||
|
|
||||||
py_user_data = (PyObject *) user_data;
|
py_user_data = (PyObject *) user_data;
|
||||||
|
@ -137,6 +140,9 @@ probe_handler_marshal(GstPad *pad, GstMiniObject *data, gpointer user_data)
|
||||||
args = PySequence_Concat(tuple, PyTuple_GetItem(py_user_data, i));
|
args = PySequence_Concat(tuple, PyTuple_GetItem(py_user_data, i));
|
||||||
Py_DECREF(tuple);
|
Py_DECREF(tuple);
|
||||||
}
|
}
|
||||||
|
repr = PyObject_Repr (callback);
|
||||||
|
GST_LOG_OBJECT (pad, "calling callback %s", PyString_AsString (repr));
|
||||||
|
Py_DECREF (repr);
|
||||||
ret = PyObject_CallObject(callback, args);
|
ret = PyObject_CallObject(callback, args);
|
||||||
|
|
||||||
if (!ret) {
|
if (!ret) {
|
||||||
|
|
|
@ -25,13 +25,6 @@ import sys
|
||||||
import gc
|
import gc
|
||||||
|
|
||||||
class PadTemplateTest(TestCase):
|
class PadTemplateTest(TestCase):
|
||||||
def setUp(self):
|
|
||||||
self.gctrack()
|
|
||||||
|
|
||||||
def tearDown(self):
|
|
||||||
self.gccollect()
|
|
||||||
self.gcverify()
|
|
||||||
|
|
||||||
def testConstructor(self):
|
def testConstructor(self):
|
||||||
template = gst.PadTemplate("template", gst.PAD_SINK,
|
template = gst.PadTemplate("template", gst.PAD_SINK,
|
||||||
gst.PAD_ALWAYS, gst.caps_from_string("audio/x-raw-int"))
|
gst.PAD_ALWAYS, gst.caps_from_string("audio/x-raw-int"))
|
||||||
|
@ -41,7 +34,7 @@ class PadTemplateTest(TestCase):
|
||||||
|
|
||||||
class PadPushUnlinkedTest(TestCase):
|
class PadPushUnlinkedTest(TestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
self.gctrack()
|
TestCase.setUp(self)
|
||||||
self.src = gst.Pad("src", gst.PAD_SRC)
|
self.src = gst.Pad("src", gst.PAD_SRC)
|
||||||
self.sink = gst.Pad("sink", gst.PAD_SINK)
|
self.sink = gst.Pad("sink", gst.PAD_SINK)
|
||||||
|
|
||||||
|
@ -52,8 +45,7 @@ class PadPushUnlinkedTest(TestCase):
|
||||||
self.assertEquals(sys.getrefcount(self.sink), 3)
|
self.assertEquals(sys.getrefcount(self.sink), 3)
|
||||||
self.assertEquals(self.sink.__gstrefcount__, 1)
|
self.assertEquals(self.sink.__gstrefcount__, 1)
|
||||||
del self.sink
|
del self.sink
|
||||||
self.gccollect()
|
TestCase.tearDown(self)
|
||||||
self.gcverify()
|
|
||||||
|
|
||||||
def testNoProbe(self):
|
def testNoProbe(self):
|
||||||
self.buffer = gst.Buffer()
|
self.buffer = gst.Buffer()
|
||||||
|
@ -84,7 +76,7 @@ class PadPushUnlinkedTest(TestCase):
|
||||||
|
|
||||||
class PadPushLinkedTest(TestCase):
|
class PadPushLinkedTest(TestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
self.gctrack()
|
TestCase.setUp(self)
|
||||||
self.src = gst.Pad("src", gst.PAD_SRC)
|
self.src = gst.Pad("src", gst.PAD_SRC)
|
||||||
self.sink = gst.Pad("sink", gst.PAD_SINK)
|
self.sink = gst.Pad("sink", gst.PAD_SINK)
|
||||||
caps = gst.caps_from_string("foo/bar")
|
caps = gst.caps_from_string("foo/bar")
|
||||||
|
@ -101,8 +93,7 @@ class PadPushLinkedTest(TestCase):
|
||||||
self.assertEquals(sys.getrefcount(self.sink), 3)
|
self.assertEquals(sys.getrefcount(self.sink), 3)
|
||||||
self.assertEquals(self.sink.__gstrefcount__, 1)
|
self.assertEquals(self.sink.__gstrefcount__, 1)
|
||||||
del self.sink
|
del self.sink
|
||||||
self.gccollect()
|
TestCase.tearDown(self)
|
||||||
self.gcverify()
|
|
||||||
|
|
||||||
def _chain_func(self, pad, buffer):
|
def _chain_func(self, pad, buffer):
|
||||||
self.buffers.append(buffer)
|
self.buffers.append(buffer)
|
||||||
|
@ -145,7 +136,7 @@ class PadPushLinkedTest(TestCase):
|
||||||
|
|
||||||
class PadPushProbeLinkTest(TestCase):
|
class PadPushProbeLinkTest(TestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
self.gctrack()
|
TestCase.setUp(self)
|
||||||
self.src = gst.Pad("src", gst.PAD_SRC)
|
self.src = gst.Pad("src", gst.PAD_SRC)
|
||||||
self.sink = gst.Pad("sink", gst.PAD_SINK)
|
self.sink = gst.Pad("sink", gst.PAD_SINK)
|
||||||
caps = gst.caps_from_string("foo/bar")
|
caps = gst.caps_from_string("foo/bar")
|
||||||
|
@ -161,8 +152,7 @@ class PadPushProbeLinkTest(TestCase):
|
||||||
self.assertEquals(sys.getrefcount(self.sink), 3)
|
self.assertEquals(sys.getrefcount(self.sink), 3)
|
||||||
self.assertEquals(self.sink.__gstrefcount__, 1)
|
self.assertEquals(self.sink.__gstrefcount__, 1)
|
||||||
del self.sink
|
del self.sink
|
||||||
self.gccollect()
|
TestCase.tearDown(self)
|
||||||
self.gcverify()
|
|
||||||
|
|
||||||
def _chain_func(self, pad, buffer):
|
def _chain_func(self, pad, buffer):
|
||||||
self.buffers.append(buffer)
|
self.buffers.append(buffer)
|
||||||
|
@ -187,13 +177,6 @@ class PadPushProbeLinkTest(TestCase):
|
||||||
|
|
||||||
|
|
||||||
class PadTest(TestCase):
|
class PadTest(TestCase):
|
||||||
def setUp(self):
|
|
||||||
self.gctrack()
|
|
||||||
|
|
||||||
def tearDown(self):
|
|
||||||
self.gccollect()
|
|
||||||
self.gcverify()
|
|
||||||
|
|
||||||
def testConstructor(self):
|
def testConstructor(self):
|
||||||
# first style uses gst_pad_new
|
# first style uses gst_pad_new
|
||||||
gst.debug('creating pad with name src')
|
gst.debug('creating pad with name src')
|
||||||
|
@ -213,17 +196,15 @@ class PadTest(TestCase):
|
||||||
|
|
||||||
class PadPipelineTest(TestCase):
|
class PadPipelineTest(TestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
|
TestCase.setUp(self)
|
||||||
self.pipeline = gst.parse_launch('fakesrc name=source ! fakesink')
|
self.pipeline = gst.parse_launch('fakesrc name=source ! fakesink')
|
||||||
src = self.pipeline.get_by_name('source')
|
src = self.pipeline.get_by_name('source')
|
||||||
self.srcpad = src.get_pad('src')
|
self.srcpad = src.get_pad('src')
|
||||||
self.gctrack()
|
|
||||||
|
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
del self.pipeline
|
del self.pipeline
|
||||||
del self.srcpad
|
del self.srcpad
|
||||||
self.gccollect()
|
TestCase.tearDown(self)
|
||||||
self.gcverify()
|
|
||||||
|
|
||||||
|
|
||||||
# FIXME: now that GstQuery is a miniobject with various _new_ factory
|
# FIXME: now that GstQuery is a miniobject with various _new_ factory
|
||||||
# functions, we need to figure out a way to deal with them in python
|
# functions, we need to figure out a way to deal with them in python
|
||||||
|
@ -235,7 +216,7 @@ class PadPipelineTest(TestCase):
|
||||||
|
|
||||||
class PadProbePipeTest(TestCase):
|
class PadProbePipeTest(TestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
self.gctrack()
|
TestCase.setUp(self)
|
||||||
self.pipeline = gst.Pipeline()
|
self.pipeline = gst.Pipeline()
|
||||||
self.assertEquals(self.pipeline.__gstrefcount__, 1)
|
self.assertEquals(self.pipeline.__gstrefcount__, 1)
|
||||||
self.assertEquals(sys.getrefcount(self.pipeline), 3)
|
self.assertEquals(sys.getrefcount(self.pipeline), 3)
|
||||||
|
@ -282,7 +263,7 @@ class PadProbePipeTest(TestCase):
|
||||||
del self.fakesink
|
del self.fakesink
|
||||||
self.gccollect()
|
self.gccollect()
|
||||||
|
|
||||||
self.gcverify()
|
TestCase.tearDown(self)
|
||||||
|
|
||||||
def testFakeSrcProbeOnceKeep(self):
|
def testFakeSrcProbeOnceKeep(self):
|
||||||
self.fakesrc.set_property('num-buffers', 1)
|
self.fakesrc.set_property('num-buffers', 1)
|
||||||
|
@ -296,8 +277,10 @@ class PadProbePipeTest(TestCase):
|
||||||
self._got_fakesink_buffer = 0
|
self._got_fakesink_buffer = 0
|
||||||
self.pipeline.set_state(gst.STATE_PLAYING)
|
self.pipeline.set_state(gst.STATE_PLAYING)
|
||||||
while not self._got_fakesrc_buffer:
|
while not self._got_fakesrc_buffer:
|
||||||
|
gst.debug('waiting for fakesrc buffer')
|
||||||
pass
|
pass
|
||||||
while not self._got_fakesink_buffer:
|
while not self._got_fakesink_buffer:
|
||||||
|
gst.debug('waiting for fakesink buffer')
|
||||||
pass
|
pass
|
||||||
|
|
||||||
self.assertEquals(self._got_fakesink_buffer, 1)
|
self.assertEquals(self._got_fakesink_buffer, 1)
|
||||||
|
@ -313,7 +296,10 @@ class PadProbePipeTest(TestCase):
|
||||||
self._got_fakesrc_buffer = 0
|
self._got_fakesrc_buffer = 0
|
||||||
self.pipeline.set_state(gst.STATE_PLAYING)
|
self.pipeline.set_state(gst.STATE_PLAYING)
|
||||||
while not self._got_fakesrc_buffer == 1000:
|
while not self._got_fakesrc_buffer == 1000:
|
||||||
pass
|
import time
|
||||||
|
# allow for context switching; a busy loop here locks up the
|
||||||
|
# streaming thread too much
|
||||||
|
time.sleep(.0001)
|
||||||
pad.remove_buffer_probe(id)
|
pad.remove_buffer_probe(id)
|
||||||
|
|
||||||
self.pipeline.set_state(gst.STATE_NULL)
|
self.pipeline.set_state(gst.STATE_NULL)
|
||||||
|
@ -322,12 +308,16 @@ class PadProbePipeTest(TestCase):
|
||||||
self.failUnless(isinstance(pad, gst.Pad))
|
self.failUnless(isinstance(pad, gst.Pad))
|
||||||
self.failUnless(isinstance(buffer, gst.Buffer))
|
self.failUnless(isinstance(buffer, gst.Buffer))
|
||||||
self._got_fakesrc_buffer += 1
|
self._got_fakesrc_buffer += 1
|
||||||
|
gst.debug('fakesrc sent buffer %r, %d total sent' % (
|
||||||
|
buffer, self._got_fakesrc_buffer))
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def _handoff_callback_fakesink(self, sink, buffer, pad):
|
def _handoff_callback_fakesink(self, sink, buffer, pad):
|
||||||
self.failUnless(isinstance(buffer, gst.Buffer))
|
self.failUnless(isinstance(buffer, gst.Buffer))
|
||||||
self.failUnless(isinstance(pad, gst.Pad))
|
self.failUnless(isinstance(pad, gst.Pad))
|
||||||
self._got_fakesink_buffer += 1
|
self._got_fakesink_buffer += 1
|
||||||
|
gst.debug('fakesink got buffer %r, %d total received' % (
|
||||||
|
buffer, self._got_fakesrc_buffer))
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def testRemovingProbe(self):
|
def testRemovingProbe(self):
|
||||||
|
@ -354,13 +344,6 @@ class PadProbePipeTest(TestCase):
|
||||||
self.gccollect()
|
self.gccollect()
|
||||||
|
|
||||||
class PadRefCountTest(TestCase):
|
class PadRefCountTest(TestCase):
|
||||||
def setUp(self):
|
|
||||||
self.gctrack()
|
|
||||||
|
|
||||||
def tearDown(self):
|
|
||||||
self.gccollect()
|
|
||||||
self.gcverify()
|
|
||||||
|
|
||||||
def testAddPad(self):
|
def testAddPad(self):
|
||||||
# add a pad to an element
|
# add a pad to an element
|
||||||
e = gst.element_factory_make('fakesrc')
|
e = gst.element_factory_make('fakesrc')
|
||||||
|
|
Loading…
Reference in a new issue