[gst-devel] gtk and threads

alberto colombo albx79 at gmail.com
Tue Aug 29 17:47:52 CEST 2006


thank you for your reply

> With GStreamer-0.10, the easiest way to marshal information into the
> main thread is by using the pipeline's GstBus. This is the standard
> mechanism for plugins to send information (like errors or tags) to the
> application in a thread-safe manner. Your element can post custom
> messages with arbitrary data (via the message's GstStructure) on the bus
> and your application can then catch that custom message in its bus watch
> callback. Since you will already have a bus watch to catch errors, tags
> and to recognise the end of the stream, adding support for your custom
> message should be fairly easy. 

As it's often the case, the right solution is the simplest one, and the
last one I think of :-) Done, it works, and it it THE ONE WAY of doing

> Btw, for your specific case (showing the current processing position) it
> might be sufficient to just set up a timeout with g_timeout_add() and
> query the pipeline for the current position in TIME format (if you're
> lucky DEFAULT format will work too and give you the frame number).

I am not lucky :-( and I don't like to rely on luck... anyway, this
specific case was just to solve the gst<->gtk communication problem in
general, not really for counting frames. My plugin will evolve in
something more elaborate, and may have something high level to tell the

Thanks a lot

> Hope this helps.
>  Cheers
>   -Tim
> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
ICQ#: 319420338

More information about the gstreamer-devel mailing list