Search code examples
cqtqt5gstreamer

Gstreamer. Undefined reference to `gst_video_overlay_set_window_handle'


I am trying to use gstreamer and Qt5 together. Just the simple app with src->sink - for displaying something on the screen.

Here is an example of source code:

#include <glib.h>
#include <gst/gst.h>
#include <gst/video/videooverlay.h>    

...

WId xwinid = window.winId();
gst_video_overlay_set_window_handle( (GST_VIDEO_OVERLAY (sink)), xwinid);

And here I have got the next errors:

/.../gst_qt/main.cpp:33: error: undefined reference to `gst_video_overlay_set_window_handle'
/.../gst_qt/main.cpp:33: error: undefined reference to `gst_video_overlay_get_type'

I found the both .c and .h "videooverlay" files in my environment, but it looks weird, that header cannot call the sources.

In my .pro file I have included gstreamer:

# files needed for gstreamer
INCLUDEPATH += /.../usr/include/gstreamer-1.0
INCLUDEPATH += /.../usr/include/glib-2.0
INCLUDEPATH += /.../usr/lib/glib-2.0/include
INCLUDEPATH += /.../usr/lib/gstreamer-1.0

# external libraries
CONFIG += link_pkgconfig
PKGCONFIG += gstreamer-1.0
PKGCONFIG += gobject-2.0
PKGCONFIG += glib-2.0

Does anyone know what is going wrong here?


Solution

  • You will have to add the video library portion of GStreamer since you use symbols that are only defined in there:

    PKGCONFIG += gstreamer-video-1.0
    

    EDIT: credits go to @JarMan, he was faster.. just made a comment instead of an answer for some reason :)