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

Stefan Kost ensonic at hora-obscura.de
Fri Apr 16 11:21:22 CEST 2010


4ernov wrote:
> Hi,
>
> I try to make whole gstreamer pipeline live in separate thread.
GStreamer already run the data processing in separate threads.

>  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.).
Are you synchronously waiting for the state change to happen? I wonder
if you just use things a bit sub optimal.

Stefan
>  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
>   





More information about the gstreamer-devel mailing list