I'm trying to integrate a gsrtreamer video in a QT app using QML.
I've begun with the example qmlplayer2 which uses a distant video :
player->setUri(QLatin1Literal("http://download.blender.org/peach/bigbuckbunny_movies/big_buck_bunny_480p_surround-fix.avi"));
I've modified this example to use a pipeline to get an udpsrc :
m_pipeline = QGst::Pipeline::create(); QGst::ElementPtr udp = QGst::ElementFactory::make(QLatin1Literal("udpsrc")); udp->setProperty("address", "192.168.1.1"); udp->setProperty("port", 3333); QGst::ElementPtr decodage = QGst::ElementFactory::make("jpegdec"); QGst::ElementPtr videosink = QGst::ElementFactory::make("autovideosink");
Which is equivaltent to :
gst-launch-1.0 udpsrc address=192.168.1.1 port=3333 ! jpegdec ! autovideosink
This works, I get my video streamed and my play/pause/stop buttons working.
But The video is in an different window
Whereas my QML is specifying that VideoItem is in the main window :
Rectangle { id: window width: 600 height: 300 Column { width: 600 height: 544 y : 10; VideoItem { id: video y : 10; width: window.width height: 260 surface: videoSurface1 //bound on the context from main() } // Other buttons
Every topic I found is either too old (gstreamer is native in Qt since 5.5 this year) or does not have answers
Is there a mistake in my work ?
Is there an other way to do what I want?
Thanks.