Commit 5153a30a authored by Andrew Voznytsa's avatar Andrew Voznytsa

Switch to statically linked qmlglsink if system does not have preinstalled one

parent 2ed4a27f
......@@ -331,6 +331,13 @@ contains (DEFINES, QGC_DISABLE_PAIRING) {
DEFINES += QGC_ENABLE_PAIRING
}
#
# Add qmlglsink (libs/gst-plugins-good/ext/qt)
#
include(qmlglsink.pri)
#
# External library configuration
#
......
LinuxBuild {
DEFINES += HAVE_QT_X11 HAVE_QT_EGLFS HAVE_QT_WAYLAND
} else:MacBuild {
DEFINES += HAVE_QT_MAC
} else:iOSBuild {
DEFINES += HAVE_QT_IOS
} else:WindowsBuild {
DEFINES += HAVE_QT_WIN32
LIBS += opengl32.lib
} else:AndroidBuild {
DEFINES += HAVE_QT_ANDROID
}
SOURCES += \
libs/gst-plugins-good/ext/qt/gstplugin.cc \
libs/gst-plugins-good/ext/qt/gstqtglutility.cc \
libs/gst-plugins-good/ext/qt/gstqsgtexture.cc \
libs/gst-plugins-good/ext/qt/gstqtsink.cc \
libs/gst-plugins-good/ext/qt/gstqtsrc.cc \
libs/gst-plugins-good/ext/qt/qtwindow.cc \
libs/gst-plugins-good/ext/qt/qtitem.cc
HEADERS += \
libs/gst-plugins-good/ext/qt/gstqsgtexture.h \
libs/gst-plugins-good/ext/qt/gstqtgl.h \
libs/gst-plugins-good/ext/qt/gstqtglutility.h \
libs/gst-plugins-good/ext/qt/gstqtsink.h \
libs/gst-plugins-good/ext/qt/gstqtsrc.h \
libs/gst-plugins-good/ext/qt/qtwindow.h \
libs/gst-plugins-good/ext/qt/qtitem.h
......@@ -43,10 +43,12 @@
GST_PLUGIN_STATIC_DECLARE(rtpmanager);
GST_PLUGIN_STATIC_DECLARE(isomp4);
GST_PLUGIN_STATIC_DECLARE(matroska);
GST_PLUGIN_STATIC_DECLARE(opengl);
#endif
#if defined(__android__)
GST_PLUGIN_STATIC_DECLARE(androidmedia);
#endif
GST_PLUGIN_STATIC_DECLARE(qmlgl);
G_END_DECLS
#endif
......@@ -158,21 +160,32 @@ void initializeVideoStreaming(int &argc, char* argv[], char* logpath, char* debu
GST_PLUGIN_STATIC_REGISTER(matroska);
GST_PLUGIN_STATIC_REGISTER(androidmedia);
#endif
#else
Q_UNUSED(argc);
Q_UNUSED(argv);
Q_UNUSED(logpath);
Q_UNUSED(debuglevel);
#if defined(__mobile__)
GST_PLUGIN_STATIC_REGISTER(opengl);
#endif
/* the plugin must be loaded before loading the qml file to register the
* GstGLVideoItem qml item
* FIXME Add a QQmlExtensionPlugin into qmlglsink to register GstGLVideoItem
* with the QML engine, then remove this */
GstElement *sink = gst_element_factory_make ("qmlglsink", NULL);
if (sink != NULL) {
GstElement *sink = gst_element_factory_make("qmlglsink", nullptr);
if (sink == nullptr) {
GST_PLUGIN_STATIC_REGISTER(qmlgl);
sink = gst_element_factory_make("qmlglsink", nullptr);
}
if (sink != nullptr) {
gst_object_unref(sink);
sink = NULL;
sink = nullptr;
} else {
qCritical() << "unable to find qmlglsink - you need to build it yourself and add to GST_PLUGIN_PATH";
}
#else
Q_UNUSED(argc);
Q_UNUSED(argv);
Q_UNUSED(logpath);
Q_UNUSED(debuglevel);
#endif
}
......@@ -12,9 +12,10 @@
#
LinuxBuild {
QT += x11extras waylandclient
CONFIG += link_pkgconfig
packagesExist(gstreamer-1.0) {
PKGCONFIG += gstreamer-1.0 gstreamer-video-1.0
PKGCONFIG += gstreamer-1.0 gstreamer-video-1.0 gstreamer-gl-1.0
CONFIG += VideoEnabled
}
} else:MacBuild {
......@@ -39,10 +40,11 @@ LinuxBuild {
exists($$GST_ROOT) {
CONFIG += VideoEnabled
LIBS += -L$$GST_ROOT/lib -lgstreamer-1.0 -lgstvideo-1.0 -lgstbase-1.0
LIBS += -L$$GST_ROOT/lib -lgstreamer-1.0 -lgstgl-1.0 -lgstvideo-1.0 -lgstbase-1.0
LIBS += -lglib-2.0 -lintl -lgobject-2.0
INCLUDEPATH += \
$$GST_ROOT/include \
$$GST_ROOT/include/gstreamer-1.0 \
$$GST_ROOT/include/glib-2.0 \
$$GST_ROOT/lib/gstreamer-1.0/include \
......@@ -86,10 +88,12 @@ LinuxBuild {
-lgstrtpmanager \
-lgstisomp4 \
-lgstmatroska \
-lgstandroidmedia
-lgstandroidmedia \
-lgstopengl
# Rest of GStreamer dependencies
LIBS += -L$$GST_ROOT/lib \
-lgraphene-1.0 -ljpeg -lpng16 \
-lgstfft-1.0 -lm \
-lgstnet-1.0 -lgio-2.0 \
-lgstphotography-1.0 -lgstgl-1.0 -lEGL \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment