Gstreamer with multithread app (Qt)

Matias Hernandez Arellano msdark at archlinux.cl
Fri Apr 8 10:46:45 PDT 2011


> Have you considered writing a simple source element that captures and
> processes the frame directly in a GStreamer pipeline?

I can't do that... the processing process it's very complex and it's different for every ambient where the application works, but i can try...

> Why would this not be possible? Have you tried it and run into problems?
> 
> GStreamer does (almost) all of its processing in dedicated threads of
> its own ("streaming threads"). You should be able to push buffers into
> appsrc from any application thread (they will get queued internally in
> appsrc and then processed in the GStreamer streaming thread).

Well i try... in the StreamTread .. i read data from the Buffer that i create (this buffer contains processing's frames)... 
I use QGst for this.

I use the QGst::Init in the StreamThread constructor ... and configure the pipeline ...
But when i run the app .. i get this:
QObject::startTimer: QTimer can only be used with threads started with QThread

and nothing happen (the app don't crash but neither capture/process/stream) .. so i think maybe i can't use the init method of the gsreamer in the thread maybe i need to do in the main thread... but this doesn't work ...

So if there is any example of how to do that or guideline i would very appreciate (using QGst, the C or C++ interface of Gstreamer)...

Thanks a lot

El 08-04-2011, a las 4:34, Tim-Philipp Müller escribió:

> On Thu, 2011-04-07 at 18:20 -0400, Matias Hernandez Arellano wrote:
> 
>> It's possible to use gstreamer in a multithread app?
> 
> Yes.
> 
>> I have an Producer/Consumer application where i have two groups 1 with
>> 1 Producer and 1 Cosumer (Capture Video with Opencv/Process Image) and
>> other group equal ... Take de Process Frame  / Stream the frames...
> 
> Have you considered writing a simple source element that captures and
> processes the frame directly in a GStreamer pipeline?
> 
>> The communication between threads works good, but know i need to add
>> the stream part .. I have another app where i test the functionality of
>> AppSrc and works!!! .. So i need to add this (Read from the Buffer
>> where i have images, push into AppSrc and Stream over network) in a
>> thread.
>> 
>> is this possible??
> 
> Why would this not be possible? Have you tried it and run into problems?
> 
> GStreamer does (almost) all of its processing in dedicated threads of
> its own ("streaming threads"). You should be able to push buffers into
> appsrc from any application thread (they will get queued internally in
> appsrc and then processed in the GStreamer streaming thread).
> 
> Cheers
> -Tim
> 
> 
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

Matías Hernandez Arellano
Ingeniero de Software/Proyectos en VisionLabs S.A
CDA Archlinux-CL
www.msdark.archlinux.cl






More information about the gstreamer-devel mailing list