How to add a gstreamer 1.0 video element to a qt5 app
<p>I'm trying to play video in a Qt widget on linux.  </p>

<p><a href="https://stackoverflow.com/questions/1873113/how-to-implement-a-video-widget-in-qt-that-builds-upon-gstreamer">How to implement a video widget in Qt that builds upon GStreamer?</a></p>

<p>The above question is pretty close to what I want, but 6 years old. <code>QApplication::syncX();</code> no longer exists in qt5 so I dropped that. I've also changed <code>gst_x_overlay_set_xwindow_id()</code> to <code>gst_video_overlay_set_window_handle</code> for the gstreamer version change. </p>

<p>My pipeline works if I don't pass any window handle to the video sink (it just pops up a new window with the video). I'm not sure if I'm missing something to get it to render inside of Qt though. </p>

<hr>

<h2>EDIT</h2>

<p>I can set the entire app window as the overlay, but not a subsection of the main widget. Also, couldn't get the appsink working, but glimagesink seems to work.</p>

<pre><code>// QWidget* widget = QApplication::activeWindow(); // this works
QWidget* widget = new QWidget(ui-&gt;base_widget); // this doesn't work
widget-&gt;setAttribute(Qt::WA_NativeWindow, true);
widget-&gt;resize(320,240);
widget-&gt;update();
widget-&gt;setStyleSheet("background-color: red");
widget-&gt;show();
winId = widget-&gt;winId();
QApplication::sync();
gst_video_overlay_set_window_handle(GST_VIDEO_OVERLAY(sink) , winId);
</code></pre>