From e69599150844b8136c87dd5a130278d6a1f8e02c Mon Sep 17 00:00:00 2001 From: Dmitriy Purgin Date: Wed, 13 May 2020 11:31:38 +0200 Subject: [PATCH] gstqmlgl: build on Windows with qmake without pkgconfig; update instructions on building for Windows Part-of: --- ext/qt/README.md | 49 +++++++++++++++++++++++++++++++++ ext/qt/qtplugin.pro | 67 +++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 110 insertions(+), 6 deletions(-) diff --git a/ext/qt/README.md b/ext/qt/README.md index c33eb437ff..7520662709 100644 --- a/ext/qt/README.md +++ b/ext/qt/README.md @@ -48,3 +48,52 @@ make Copy the built plugin to your $GSTREAMER_ROOT/lib/gstreamer-1.0 or link to it directly if it is compiled statically + +# Building for Windows using pre-built gstreamer development package and Qt Creator + +## Step 1 + +Open `qtplugin.pro` in Qt Creator as project and configure it as usual. + +## Step 2 + +Open `qtplugin.pro` in the editor and make sure `GSTREAMER_PATH` +variable in `qmlplugin.pro` is set to the path of your gstreamer SDK installation. This directory +should contain subdirectories `bin`, `include`, `lib` etc. Pay attention to the correct choice +of x86 or x86_64 platform. + +## Step 3 + +Build the project as usual. + +## Step 3 + +Copy the built plugin to your $GSTREAMER_ROOT/lib/gstreamer-1.0 or link to it +directly if it is compiled statically. + +# Building for Windows using pre-built gstreamer development package and Qt on MinGW command line + +## Step 1 + +Launch Qt developer command line from the Start menu. + +## Step 2 + +cd to the directory of the gstqmlgl plugin and make sure `GSTREAMER_PATH` +variable in `qmlplugin.pro` is set to the path of your gstreamer SDK installation. This directory +should contain subdirectories `bin`, `include`, `lib` etc. Pay attention to the correct choice +of x86 or x86_64 platform. + +## Step 3 + +Run the following commands in the gstqmlgl plugin directory: + +``` +qmake +mingw32-make +``` + +## Step 4 + +Copy the built plugin to your $GSTREAMER_ROOT/lib/gstreamer-1.0 or link to it +directly if it is compiled statically. \ No newline at end of file diff --git a/ext/qt/qtplugin.pro b/ext/qt/qtplugin.pro index 7a9f6debca..78ac512f76 100644 --- a/ext/qt/qtplugin.pro +++ b/ext/qt/qtplugin.pro @@ -4,12 +4,63 @@ TARGET = gstqmlgl QT += qml quick gui -QT_CONFIG -= no-pkg-config -CONFIG += link_pkgconfig debug -PKGCONFIG = \ - gstreamer-1.0 \ - gstreamer-video-1.0 \ - gstreamer-gl-1.0 +win32:!defined(packagesExist, test) { + # Change this to your gstreamer SDK installation path + GSTREAMER_PATH=C:/gstreamer/1.0/x86 + + # pkgconfig dependencies: gstreamer-1.0, gstreamer-video-1.0, gstreamer-gl-1.0 + + GSTREAMER_1_0_INCLUDEPATH = $${GSTREAMER_PATH}/include/gstreamer-1.0 + win32-g++:GSTREAMER_1_0_LIBS = -L$${GSTREAMER_PATH}/lib -lgstreamer-1.0 + win32-msvc:GSTREAMER_1_0_LIBS = /LIBPATH:$${GSTREAMER_PATH}/lib gstreamer-1.0.lib + + GSTREAMER_VIDEO_1_0_INCLUDEPATH = $${GSTREAMER_PATH}/include/gstreamer-1.0 + win32-g++:GSTREAMER_VIDEO_1_0_LIBS = -L$${GSTREAMER_PATH}/lib -lgstvideo-1.0 + win32-msvc:GSTREAMER_VIDEO_1_0_LIBS = /LIBPATH:$${GSTREAMER_PATH}/lib gstvideo-1.0.lib + + GSTREAMER_GL_1_0_INCLUDEPATH = $${GSTREAMER_PATH}/include \ + $${GSTREAMER_PATH}/lib/gstreamer-1.0/include + win32-g++:GSTREAMER_GL_1_0_LIBS = -L$${GSTREAMER_PATH}/lib -lgstgl-1.0 + win32-msvc:GSTREAMER_GL_1_0_LIBS = /LIBPATH:$${GSTREAMER_PATH}/lib gstgl-1.0.lib + + # Extra dependencies: + # glib-2.0, gobject-2.0 (required by gstreamer-1.0) + # gstreamer-base-1.0 (required by gstreamer-video-1.0) + + GLIB_2_0_INCLUDEPATH = $${GSTREAMER_PATH}/include/glib-2.0 \ + $${GSTREAMER_PATH}/lib/glib-2.0/include + win32-g++:GLIB_2_0_LIBS = -L$${GSTREAMER_PATH}/lib -lglib-2.0 -lintl + win32-msvc:GLIB_2_0_LIBS = /LIBPATH:$${GSTREAMER_PATH}/lib glib-2.0.lib intl.lib + + GOBJECT_2_0_INCLUDEPATH = $${GSTREAMER_PATH}/include + win32-g++:GOBJECT_2_0_LIBS = -L$${GSTREAMER_PATH}/lib -lgobject-2.0 + win32-msvc:GOBJECT_2_0_LIBS = /LIBPATH:$${GSTREAMER_PATH}/lib gobject-2.0.lib + + GSTREAMER_BASE_1_0_INCLUDEPATH = $${GSTREAMER_PATH}/include/gstreamer-1.0 + win32-g++:GSTREAMER_BASE_1_0_LIBS = -L$${GSTREAMER_PATH}/lib -lgstbase-1.0 + win32-msvc:GSTREAMER_BASE_1_0_LIBS = /LIBPATH:$${GSTREAMER_PATH}/lib gstbase-1.0.lib + + INCLUDEPATH += $${GSTREAMER_1_0_INCLUDEPATH} \ + $${GSTREAMER_VIDEO_1_0_INCLUDEPATH} \ + $${GSTREAMER_GL_1_0_INCLUDEPATH} \ + $${GLIB_2_0_INCLUDEPATH} \ + $${GOBJECT_2_0_INCLUDEPATH} \ + $${GSTREAMER_BASE_1_0_INCLUDEPATH} + + LIBS += $${GSTREAMER_1_0_LIBS} \ + $${GSTREAMER_VIDEO_1_0_LIBS} \ + $${GSTREAMER_GL_1_0_LIBS} \ + $${GLIB_2_0_LIBS} \ + $${GOBJECT_2_0_LIBS} \ + $${GSTREAMER_BASE_1_0_LIBS} +} else { + QT_CONFIG -= no-pkg-config + CONFIG += link_pkgconfig debug + PKGCONFIG = \ + gstreamer-1.0 \ + gstreamer-video-1.0 \ + gstreamer-gl-1.0 +} android { CONFIG += static @@ -30,8 +81,10 @@ SOURCES += \ gstplugin.cc \ gstqtglutility.cc \ gstqsgtexture.cc \ + gstqtoverlay.cc \ gstqtsink.cc \ gstqtsrc.cc \ + qtglrenderer.cc \ qtwindow.cc \ qtitem.cc @@ -39,7 +92,9 @@ HEADERS += \ gstqsgtexture.h \ gstqtgl.h \ gstqtglutility.h \ + gstqtoverlay.h \ gstqtsink.h \ gstqtsrc.h \ + qtglrenderer.h \ qtwindow.h \ qtitem.h