title: How to include a gstreamer sink in a QML VideoItem?
body: <p>I'm trying to integrate a gsrtreamer video in a QT app using QML.</p>
  
  <p>I've begun with the example <a href="https://github.com/detrout/qt-gstreamer/tree/master/examples/qmlplayer2" rel="nofollow noreferrer">qmlplayer2</a> which uses a distant video :</p>
  
  <pre><code>player-&gt;setUri(QLatin1Literal("http://download.blender.org/peach/bigbuckbunny_movies/big_buck_bunny_480p_surround-fix.avi"));
  </code></pre>
  
  <p>I've modified this example to use a pipeline to get an udpsrc :</p>
  
  <pre><code>    m_pipeline = QGst::Pipeline::create();
      QGst::ElementPtr udp = QGst::ElementFactory::make(QLatin1Literal("udpsrc"));
      udp-&gt;setProperty("address", "192.168.1.1");
      udp-&gt;setProperty("port", 3333);
      QGst::ElementPtr decodage = QGst::ElementFactory::make("jpegdec");
      QGst::ElementPtr videosink = QGst::ElementFactory::make("autovideosink");
  </code></pre>
  
  <p>Which is equivaltent to :</p>
  
  <pre><code>gst-launch-1.0 udpsrc address=192.168.1.1 port=3333 ! jpegdec ! autovideosink
  </code></pre>
  
  <p>This works, I get my video streamed and my play/pause/stop buttons working.</p>
  
  <p>But The video is in an different window <a href="https://i.stack.imgur.com/Bt0RE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Bt0RE.png" alt="Two separate windows"></a></p>
  
  <p>Whereas my <a href="https://github.com/detrout/qt-gstreamer/blob/93f5b79e50e8aaccca236431d9dde1349f7aa05d/examples/qmlplayer2/qmlplayer2.qml" rel="nofollow noreferrer">QML</a> is specifying that VideoItem is in the main window :</p>
  
  <pre><code>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
  </code></pre>
  
  <p>Every topic I found is either too old (gstreamer is native in Qt since 5.5 this year) or does not have answers</p>
  
  <p>Is there a mistake in my work ?</p>
  
  <p>Is there an other way to do what I want?</p>
  
  <p>Thanks.</p>