mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-13 10:55:34 +00:00
make sure that we actually get the clock-provide message
This commit is contained in:
parent
dd6bf4a4d4
commit
f99e67aa24
1 changed files with 8 additions and 3 deletions
|
@ -168,17 +168,17 @@ class TestPipeSub(gst.Pipeline):
|
||||||
def do_handle_message(self, message):
|
def do_handle_message(self, message):
|
||||||
self.debug('do_handle_message')
|
self.debug('do_handle_message')
|
||||||
gst.Pipeline.do_handle_message(self, message)
|
gst.Pipeline.do_handle_message(self, message)
|
||||||
self.message = True
|
self.type = message.type
|
||||||
gobject.type_register(TestPipeSub)
|
gobject.type_register(TestPipeSub)
|
||||||
|
|
||||||
class TestPipeSubSub(TestPipeSub):
|
class TestPipeSubSub(TestPipeSub):
|
||||||
def do_handle_message(self, message):
|
def do_handle_message(self, message):
|
||||||
self.debug('do_handle_message')
|
self.debug('do_handle_message')
|
||||||
TestPipeSub.do_handle_message(self, message)
|
TestPipeSub.do_handle_message(self, message)
|
||||||
self.message = True
|
|
||||||
gobject.type_register(TestPipeSubSub)
|
gobject.type_register(TestPipeSubSub)
|
||||||
|
|
||||||
|
|
||||||
|
# see http://bugzilla.gnome.org/show_bug.cgi?id=577735
|
||||||
class TestSubClass(TestCase):
|
class TestSubClass(TestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
self.gctrack()
|
self.gctrack()
|
||||||
|
@ -191,20 +191,25 @@ class TestSubClass(TestCase):
|
||||||
p = TestPipeSub()
|
p = TestPipeSub()
|
||||||
u = gst.element_factory_make('uridecodebin')
|
u = gst.element_factory_make('uridecodebin')
|
||||||
self.assertEquals(u.__grefcount__, 1)
|
self.assertEquals(u.__grefcount__, 1)
|
||||||
|
self.failIf(getattr(p, 'type', None))
|
||||||
# adding uridecodebin triggers a clock-provide message;
|
# adding uridecodebin triggers a clock-provide message;
|
||||||
# this message should be dropped, and thus not affect
|
# this message should be dropped, and thus not affect
|
||||||
# the refcount of u beyond the parenting.
|
# the refcount of u beyond the parenting.
|
||||||
p.add(u)
|
p.add(u)
|
||||||
self.failUnless(getattr(p, 'message'))
|
self.assertEquals(getattr(p, 'type', None), gst.MESSAGE_CLOCK_PROVIDE)
|
||||||
self.assertEquals(u.__grefcount__, 2)
|
self.assertEquals(u.__grefcount__, 2)
|
||||||
del p
|
del p
|
||||||
self.assertEquals(u.__grefcount__, 1)
|
self.assertEquals(u.__grefcount__, 1)
|
||||||
|
|
||||||
def testSubSubClass(self):
|
def testSubSubClass(self):
|
||||||
|
# Edward is worried that a subclass of a subclass will screw up
|
||||||
|
# the refcounting wrt. GST_BUS_DROP
|
||||||
p = TestPipeSubSub()
|
p = TestPipeSubSub()
|
||||||
u = gst.element_factory_make('uridecodebin')
|
u = gst.element_factory_make('uridecodebin')
|
||||||
self.assertEquals(u.__grefcount__, 1)
|
self.assertEquals(u.__grefcount__, 1)
|
||||||
|
self.failIf(getattr(p, 'type', None))
|
||||||
p.add(u)
|
p.add(u)
|
||||||
|
self.assertEquals(getattr(p, 'type', None), gst.MESSAGE_CLOCK_PROVIDE)
|
||||||
self.assertEquals(u.__grefcount__, 2)
|
self.assertEquals(u.__grefcount__, 2)
|
||||||
del p
|
del p
|
||||||
self.assertEquals(u.__grefcount__, 1)
|
self.assertEquals(u.__grefcount__, 1)
|
||||||
|
|
Loading…
Reference in a new issue