Hi ,<br> You do not need to create a separate thread while working on Qt.<br> AFAIK the <a href="http://www.gstreamer.net/data/doc/gstreamer/head/manual/html/chapter-helloworld.html">gst helloworld </a>has a g_main_loop so that the main thread does not exit while gstreamer runs in its own thread.<br>
But we don't have this problem while working with Qt GUI apps.<br> I have attached a simple gst-launch style Qt gui app using gstreamer to demo this.<br> Hope it saves time of someone :) <br><br><br><div class="gmail_quote">
On Fri, Apr 16, 2010 at 1:01 PM, 4ernov <span dir="ltr"><<a href="mailto:4ernov@gmail.com">4ernov@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hi,<br>
<br>
I try to make whole gstreamer pipeline live in separate thread. I need<br>
it generally because I work with very slow v4l2 device driver and it<br>
takes considerable time for to change state of pipeline (init driver<br>
etc.). So I create special QThread in Qt4 app and make all the<br>
construction work (i.e. create all the elements, the pipeline itself<br>
etc.) in its run() method. I also connect to the bus of the pipeline<br>
to get some info:<br>
<br>
GstBus* bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline));<br>
gst_bus_add_watch (bus, audio_bus_call, this);<br>
gst_object_unref (bus);<br>
<br>
But I eventually found that all the message dispatching is processed<br>
in the main thread of the app. I.e. if I call thread() function which<br>
returns a pointer to a running thread in bus callback:<br>
void audio_bus_call()<br>
{<br>
qDebug()<<"thread:"<<thread();<br>
}<br>
it returns a pointer to the main thread in spite of that all the<br>
GStreamer objects are created in different thread.<br>
<br>
Is there any way to make message dispatching process run in different<br>
thread other than main? Or somehow bind GStreamer event loop to Qt's<br>
event loop of some QThread object?<br>
<br>
Thank you very much,<br>
<br>
Alexey Chernov<br>
<div class="im"><br>
------------------------------------------------------------------------------<br>
Download Intel&#174; Parallel Studio Eval<br>
Try the new software tools for yourself. Speed compiling, find bugs<br>
proactively, and fine-tune applications for parallel performance.<br>
See why Intel Parallel Studio got high marks during beta.<br>
<a href="http://p.sf.net/sfu/intel-sw-dev" target="_blank">http://p.sf.net/sfu/intel-sw-dev</a><br>
_______________________________________________<br>
</div><div><div></div><div class="h5">gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.sourceforge.net">gstreamer-devel@lists.sourceforge.net</a><br>
<a href="https://lists.sourceforge.net/lists/listinfo/gstreamer-devel" target="_blank">https://lists.sourceforge.net/lists/listinfo/gstreamer-devel</a><br>
</div></div></blockquote></div><br>