4ernov
2010-04-16 07:31:30 UTC
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
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