gstqmlgl: build on Windows with qmake without pkgconfig; update instructions on building for Windows

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/591>
This commit is contained in:
Dmitriy Purgin 2020-05-13 11:31:38 +02:00 committed by Tim-Philipp Müller
parent 15dfc3b171
commit e695991508
2 changed files with 110 additions and 6 deletions

View file

@ -48,3 +48,52 @@ make
Copy the built plugin to your $GSTREAMER_ROOT/lib/gstreamer-1.0 or link to it Copy the built plugin to your $GSTREAMER_ROOT/lib/gstreamer-1.0 or link to it
directly if it is compiled statically 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.

View file

@ -4,12 +4,63 @@ TARGET = gstqmlgl
QT += qml quick gui QT += qml quick gui
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 QT_CONFIG -= no-pkg-config
CONFIG += link_pkgconfig debug CONFIG += link_pkgconfig debug
PKGCONFIG = \ PKGCONFIG = \
gstreamer-1.0 \ gstreamer-1.0 \
gstreamer-video-1.0 \ gstreamer-video-1.0 \
gstreamer-gl-1.0 gstreamer-gl-1.0
}
android { android {
CONFIG += static CONFIG += static
@ -30,8 +81,10 @@ SOURCES += \
gstplugin.cc \ gstplugin.cc \
gstqtglutility.cc \ gstqtglutility.cc \
gstqsgtexture.cc \ gstqsgtexture.cc \
gstqtoverlay.cc \
gstqtsink.cc \ gstqtsink.cc \
gstqtsrc.cc \ gstqtsrc.cc \
qtglrenderer.cc \
qtwindow.cc \ qtwindow.cc \
qtitem.cc qtitem.cc
@ -39,7 +92,9 @@ HEADERS += \
gstqsgtexture.h \ gstqsgtexture.h \
gstqtgl.h \ gstqtgl.h \
gstqtglutility.h \ gstqtglutility.h \
gstqtoverlay.h \
gstqtsink.h \ gstqtsink.h \
gstqtsrc.h \ gstqtsrc.h \
qtglrenderer.h \
qtwindow.h \ qtwindow.h \
qtitem.h qtitem.h