can I use g_mail_loop_run() inside a while loop?

Sebastian Dröge sebastian at centricular.com
Fri Sep 9 07:25:35 UTC 2016


On Thu, 2016-09-08 at 10:18 -0700, ge_keep wrote:
> Thank you Sebastian. Your answer really helps me to understand better. 
> You mentioned:
> 
> "...you can use other parts of the GstBus API for getting GstMessages,.."
> 
> Do you mean that in case I still want to keep my own events loop (with the
> while(event)) and use the GstBus API, I DO NOT need to call
> g_main_loop_run()?
> It looks to me that GstBus API helps to report on events happening in
> gstreamer pipelines back to the top level application.

It does, but GstBus is not limited to be used with GMainLoop. Check its
docs, you can also e.g. poll the bus or get (synchronously) notified
when some new message is there. I did something here for getting it
integrated somehow into the Qt event loop for example:
https://github.com/sdroege/gst-snippets/blob/master/qt5-eventloop/gst-qt-example.cc

-- 
Sebastian Dröge, Centricular Ltd · http://www.centricular.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 931 bytes
Desc: This is a digitally signed message part
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20160909/e5b7b673/attachment.sig>


More information about the gstreamer-devel mailing list