QWidget on top of gstreamer

George Kiagiadakis kiagiadakis.george at gmail.com
Fri May 31 06:06:20 PDT 2013


On Fri, May 31, 2013 at 2:39 PM, Marco Trapanese
<marcotrapanese at gmail.com> wrote:
> Hi,
>
> with this code:
>
> Widget::Widget(QWidget *parent) : QWidget(parent), ui(new Ui::Widget) {
>     ui->setupUi(this);
>     setAttribute(Qt::WA_NativeWindow, true);
>     gst_init(NULL, NULL);
>     GstElement *pipeline = gst_pipeline_new ("xvoverlay");
>     GstElement *src = gst_element_factory_make ("videotestsrc", NULL);
>     GstElement *sink = gst_element_factory_make ("ximagesink", NULL);
>     gst_bin_add_many (GST_BIN (pipeline), src, sink, NULL);
>     gst_element_link (src, sink);
>     gst_video_overlay_set_window_handle (GST_VIDEO_OVERLAY(sink),
> ui->widget->winId());
>     GstStateChangeReturn ret = gst_element_set_state (pipeline,
> GST_STATE_PLAYING);
> }
> I see the video test on a QWidget.
> Now I want to put over that other widgets with some transparencies.
> I get this effect:
>
> http://oi44.tinypic.com/2q9e4wi.jpg
>
> How to get the transparency work also for the area above the video?
> I'm working on Debian Jessie 32-bit.
>

Transparency is not going to work with XOverlay. Qt needs to be aware
of the rendered content of all its sub-surfaces in order to composite
them and with XOverlay this is not the case. You need to use
qtglvideosink or qwidgetvideosink (from qt-gstreamer) instead.


More information about the gstreamer-devel mailing list