[gst-devel] how to make gstreamer run in separate thread

vineeth nvineeth at gmail.com
Tue May 11 18:08:56 CEST 2010


Hi ,
  You do not need to create a separate thread while working on Qt.
  AFAIK the gst helloworld
<http://www.gstreamer.net/data/doc/gstreamer/head/manual/html/chapter-helloworld.html>has
a g_main_loop so that the main thread does not exit while gstreamer runs in
its own thread.
  But we don't have this problem while working with Qt GUI apps.
  I have attached a simple gst-launch style Qt gui app using gstreamer to
demo this.
  Hope it saves time of someone :)


On Fri, Apr 16, 2010 at 1:01 PM, 4ernov <4ernov at gmail.com> wrote:

> Hi,
>
> I try to make whole gstreamer pipeline live in separate thread. I need
> it generally because I work with very slow v4l2 device driver and it
> takes considerable time for to change state of pipeline (init driver
> etc.). So I create special QThread in Qt4 app and make all the
> construction work (i.e. create all the elements, the pipeline itself
> etc.) in its run() method. I also connect to the bus of the pipeline
> to get some info:
>
>        GstBus* bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline));
>        gst_bus_add_watch (bus, audio_bus_call, this);
>        gst_object_unref (bus);
>
> But I eventually found that all the message dispatching is processed
> in the main thread of the app. I.e. if I call thread() function which
> returns a pointer to a running thread in bus callback:
> void audio_bus_call()
> {
>        qDebug()<<"thread:"<<thread();
> }
> it returns a pointer to the main thread in spite of that all the
> GStreamer objects are created in different thread.
>
> Is there any way to make message dispatching process run in different
> thread other than main? Or somehow bind GStreamer event loop to Qt's
> event loop of some QThread object?
>
> Thank you very much,
>
> Alexey Chernov
>
>
> ------------------------------------------------------------------------------
> Download Intel&#174; Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20100511/0929b62a/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.tar.bz2
Type: application/x-bzip2
Size: 4057 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20100511/0929b62a/attachment.bin>


More information about the gstreamer-devel mailing list