mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
examples/gl/qt: silence compiler warnings
-Waggregate-return: used by some Qt clases extensively and not super useful for this example. Supress it. warning: "GL_GLEXT_VERSION" redefined: Perform the same workaround as qmlglsink by defining the old gl/GL.h header guard if the new GL/gl.h guard exists. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/752>
This commit is contained in:
parent
93cb325fa1
commit
e6823576ce
11 changed files with 48 additions and 8 deletions
36
tests/examples/gl/qt/gl-compat-defines.h
Normal file
36
tests/examples/gl/qt/gl-compat-defines.h
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
/*
|
||||||
|
* GStreamer
|
||||||
|
* Copyright (C) 2020 Matthew Waters <matthew@centricular.com>
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Library General Public
|
||||||
|
* License as published by the Free Software Foundation; either
|
||||||
|
* version 2 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Library General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Library General Public
|
||||||
|
* License along with this library; if not, write to the
|
||||||
|
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
||||||
|
* Boston, MA 02110-1301, USA.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <gst/gl/gstglconfig.h>
|
||||||
|
|
||||||
|
/* The glext.h guard was renamed in 2018, but some software which
|
||||||
|
* includes their own copy of the GL headers (such as qt) might have
|
||||||
|
* older version which use the old guard. This would result in the
|
||||||
|
* header being included again (and symbols redefined).
|
||||||
|
*
|
||||||
|
* To avoid this, we define the "old" guard if the "new" guard is
|
||||||
|
* defined.*/
|
||||||
|
#if GST_GL_HAVE_OPENGL
|
||||||
|
#ifdef __gl_glext_h_
|
||||||
|
#ifndef __glext_h_
|
||||||
|
#define __glext_h_ 1
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
#endif
|
|
@ -5,6 +5,8 @@ qt5opengl_dep = dependency('qt5', modules : ['OpenGL'], required : false)
|
||||||
# FIXME: other platforms
|
# FIXME: other platforms
|
||||||
libgl = cc.find_library ('GL', required : false)
|
libgl = cc.find_library ('GL', required : false)
|
||||||
|
|
||||||
|
qt_cxx_warn_less = cxx.get_supported_arguments(['-Wno-aggregate-return'])
|
||||||
|
|
||||||
if qt5gui_dep.found()
|
if qt5gui_dep.found()
|
||||||
subdir('videooverlay')
|
subdir('videooverlay')
|
||||||
if libgl.found()
|
if libgl.found()
|
||||||
|
|
|
@ -13,7 +13,7 @@ moc_headers = [
|
||||||
|
|
||||||
moc_files = qt5_mod.preprocess(moc_headers : moc_headers)
|
moc_files = qt5_mod.preprocess(moc_headers : moc_headers)
|
||||||
executable('mousevideoverlay', sources, moc_files,
|
executable('mousevideoverlay', sources, moc_files,
|
||||||
cpp_args : [gst_plugins_base_args],
|
cpp_args : [gst_plugins_base_args] + qt_cxx_warn_less,
|
||||||
include_directories: [configinc, libsinc],
|
include_directories: [configinc, libsinc],
|
||||||
dependencies : [qt5core_dep, qt5gui_dep, gst_dep, video_dep, gstgl_dep, libgl],
|
dependencies : [qt5core_dep, qt5gui_dep, gst_dep, video_dep, gstgl_dep, libgl],
|
||||||
install: false)
|
install: false)
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
#include <gst/video/videooverlay.h>
|
#include <gst/video/videooverlay.h>
|
||||||
#include <gst/video/video.h>
|
#include <gst/video/video.h>
|
||||||
#include <GL/gl.h>
|
#include <GL/gl.h>
|
||||||
|
#include "../gl-compat-defines.h"
|
||||||
#include "pipeline.h"
|
#include "pipeline.h"
|
||||||
|
|
||||||
#define GST_MAP_GL (GST_MAP_FLAG_LAST << 1)
|
#define GST_MAP_GL (GST_MAP_FLAG_LAST << 1)
|
||||||
|
|
|
@ -30,7 +30,7 @@ class QRenderer : public QWidget
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
QRenderer(const QString videoLocation, QWidget *parent = 0, Qt::WindowFlags flags = 0);
|
QRenderer(const QString videoLocation, QWidget *parent = nullptr, Qt::WindowFlags flags = Qt::WindowFlags());
|
||||||
~QRenderer();
|
~QRenderer();
|
||||||
void paintEvent(QPaintEvent* event);
|
void paintEvent(QPaintEvent* event);
|
||||||
void mouseMoveEvent(QMouseEvent* event);
|
void mouseMoveEvent(QMouseEvent* event);
|
||||||
|
|
|
@ -13,7 +13,7 @@ moc_headers = [
|
||||||
|
|
||||||
moc_files = qt5_mod.preprocess(moc_headers : moc_headers)
|
moc_files = qt5_mod.preprocess(moc_headers : moc_headers)
|
||||||
executable('qglwidgetvideoverlay', sources, moc_files,
|
executable('qglwidgetvideoverlay', sources, moc_files,
|
||||||
cpp_args : [gst_plugins_base_args],
|
cpp_args : [gst_plugins_base_args] + qt_cxx_warn_less,
|
||||||
include_directories: [configinc, libsinc],
|
include_directories: [configinc, libsinc],
|
||||||
dependencies : [qt5core_dep, qt5gui_dep, qt5opengl_dep, gst_dep, video_dep, gstgl_dep, libgl],
|
dependencies : [qt5core_dep, qt5gui_dep, qt5opengl_dep, gst_dep, video_dep, gstgl_dep, libgl],
|
||||||
install: false)
|
install: false)
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
#include <gst/video/videooverlay.h>
|
#include <gst/video/videooverlay.h>
|
||||||
#include <gst/video/video.h>
|
#include <gst/video/video.h>
|
||||||
#include <GL/gl.h>
|
#include <GL/gl.h>
|
||||||
|
#include "../gl-compat-defines.h"
|
||||||
#include "pipeline.h"
|
#include "pipeline.h"
|
||||||
|
|
||||||
#define GST_MAP_GL (GST_MAP_FLAG_LAST << 1)
|
#define GST_MAP_GL (GST_MAP_FLAG_LAST << 1)
|
||||||
|
|
|
@ -29,7 +29,7 @@ class QGLRenderer : public QGLWidget
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
QGLRenderer(const QString videoLocation, QWidget *parent = 0);
|
QGLRenderer(const QString videoLocation, QWidget *parent = nullptr);
|
||||||
~QGLRenderer();
|
~QGLRenderer();
|
||||||
void paintEvent(QPaintEvent* event);
|
void paintEvent(QPaintEvent* event);
|
||||||
void closeEvent (QCloseEvent* event);
|
void closeEvent (QCloseEvent* event);
|
||||||
|
|
|
@ -23,7 +23,7 @@ endif
|
||||||
|
|
||||||
moc_files = qt5_mod.preprocess(moc_headers : moc_headers)
|
moc_files = qt5_mod.preprocess(moc_headers : moc_headers)
|
||||||
executable('qglwtextureshare', sources, moc_files,
|
executable('qglwtextureshare', sources, moc_files,
|
||||||
cpp_args : [gst_plugins_base_args],
|
cpp_args : [gst_plugins_base_args] + qt_cxx_warn_less,
|
||||||
include_directories: [configinc, libsinc],
|
include_directories: [configinc, libsinc],
|
||||||
dependencies : [qt5core_dep, qt5gui_dep, qt5opengl_dep, qtwinsys_deps, gst_dep, video_dep, gstgl_dep, libgl],
|
dependencies : [qt5core_dep, qt5gui_dep, qt5opengl_dep, qtwinsys_deps, gst_dep, video_dep, gstgl_dep, libgl],
|
||||||
install: false)
|
install: false)
|
||||||
|
|
|
@ -19,9 +19,9 @@
|
||||||
* Boston, MA 02110-1301, USA.
|
* Boston, MA 02110-1301, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "pipeline.h"
|
|
||||||
#include <gst/gl/gl.h>
|
#include <gst/gl/gl.h>
|
||||||
|
#include "../gl-compat-defines.h"
|
||||||
|
#include "pipeline.h"
|
||||||
|
|
||||||
Pipeline::Pipeline (GstGLDisplay *display,
|
Pipeline::Pipeline (GstGLDisplay *display,
|
||||||
GstGLContext * context, const QString & videoLocation, QObject * parent)
|
GstGLContext * context, const QString & videoLocation, QObject * parent)
|
||||||
|
|
|
@ -34,7 +34,7 @@ class QGLRenderer : public QGLWidget
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
QGLRenderer(const QString &videoLocation, QWidget *parent = 0);
|
QGLRenderer(const QString &videoLocation, QWidget *parent = nullptr);
|
||||||
~QGLRenderer();
|
~QGLRenderer();
|
||||||
|
|
||||||
void closeEvent(QCloseEvent* event);
|
void closeEvent(QCloseEvent* event);
|
||||||
|
|
Loading…
Reference in a new issue