mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-19 20:46:22 +00:00
gst/gst.defs: Keep refcount for the message of gst_bus_post()
Original commit message from CVS: * gst/gst.defs: Keep refcount for the message of gst_bus_post() * gst/gststructure.override: Don't free a structure on dealloc (the parent does that) * testsuite/test_message.py: Proper testing of bus functionnality with a mainloop
This commit is contained in:
parent
ca54d806eb
commit
53f9716a25
4 changed files with 25 additions and 11 deletions
|
@ -1,3 +1,12 @@
|
||||||
|
2005-11-15 Edward Hervey <edward@fluendo.com>
|
||||||
|
|
||||||
|
* gst/gst.defs:
|
||||||
|
Keep refcount for the message of gst_bus_post()
|
||||||
|
* gst/gststructure.override:
|
||||||
|
Don't free a structure on dealloc (the parent does that)
|
||||||
|
* testsuite/test_message.py:
|
||||||
|
Proper testing of bus functionnality with a mainloop
|
||||||
|
|
||||||
2005-11-11 Thomas Vander Stichele <thomas at apestaart dot org>
|
2005-11-11 Thomas Vander Stichele <thomas at apestaart dot org>
|
||||||
|
|
||||||
* configure.ac: back to HEAD
|
* configure.ac: back to HEAD
|
||||||
|
|
|
@ -277,7 +277,7 @@
|
||||||
(c-name "gst_bus_post")
|
(c-name "gst_bus_post")
|
||||||
(return-type "gboolean")
|
(return-type "gboolean")
|
||||||
(parameters
|
(parameters
|
||||||
'("GstMessage*" "message")
|
'("GstMessage*" "message" (keep-refcount))
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -3727,7 +3727,7 @@
|
||||||
'("const-gchar*" "name_template")
|
'("const-gchar*" "name_template")
|
||||||
'("GstPadDirection" "direction")
|
'("GstPadDirection" "direction")
|
||||||
'("GstPadPresence" "presence")
|
'("GstPadPresence" "presence")
|
||||||
'("GstCaps*" "caps")
|
'("GstCaps*" "caps" (keep-refcount))
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -55,7 +55,6 @@ _wrap_gst_structure_new(PyGBoxed *self, PyObject *args, PyObject *kwargs)
|
||||||
PyErr_SetString(PyExc_RuntimeError, "could not create GstStructure object");
|
PyErr_SetString(PyExc_RuntimeError, "could not create GstStructure object");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
self->free_on_dealloc = TRUE;
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
%%
|
%%
|
||||||
|
|
|
@ -30,20 +30,26 @@ class NewTest(TestCase):
|
||||||
m = gst.message_new_eos(b)
|
m = gst.message_new_eos(b)
|
||||||
gst.info("got message : %s" % m)
|
gst.info("got message : %s" % m)
|
||||||
|
|
||||||
def _testApplication(self):
|
def message_application_cb(self, bus, message):
|
||||||
|
print "got message"
|
||||||
|
self.got_message = True
|
||||||
|
self.loop.quit()
|
||||||
|
|
||||||
|
def testApplication(self):
|
||||||
|
self.loop = gobject.MainLoop()
|
||||||
gst.info("creating new pipeline")
|
gst.info("creating new pipeline")
|
||||||
bin = gst.Pipeline()
|
bin = gst.Pipeline()
|
||||||
bus = bin.get_bus()
|
bus = bin.get_bus()
|
||||||
bus.add_signal_watch()
|
bus.add_signal_watch()
|
||||||
got_message = False
|
self.got_message = False
|
||||||
def message_application_cb(bus, message):
|
bus.connect('message::application', self.message_application_cb)
|
||||||
got_message = True
|
|
||||||
bus.connect('message::application', message_application_cb)
|
|
||||||
|
|
||||||
gst.info("creating new application message from that bin")
|
struc = gst.Structure("foo")
|
||||||
msg = gst.message_new_application(bin, gst.Structure('foo'))
|
msg = gst.message_new_application(bin, struc)
|
||||||
bus.post(msg)
|
bus.post(msg)
|
||||||
self.failUnless(got_message == True)
|
self.loop.run()
|
||||||
|
bus.remove_signal_watch()
|
||||||
|
self.failUnless(self.got_message == True)
|
||||||
self.gccollect()
|
self.gccollect()
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
Loading…
Reference in a new issue