From 28f97a94ec5566877c0dd0dc5820349606a0ffa3 Mon Sep 17 00:00:00 2001 From: Yoann Lopes Date: Mon, 21 Nov 2016 20:20:11 +0200 Subject: Fix building the WMF plugin 9df63fd6 made it possible to build only the audio decoder service from the WMF plugin. When that change was merged to 5.8 it was not ported to the new configuration system. Added a new '-mediaplayer-backend' configure option to select the media player backend to use on Windows. '-wmf-backend' is kept for backward compatibility. Change-Id: I902b2e4147f9a05b92118152020afc2638bf41e1 Reviewed-by: Oswald Buddenhagen --- config_help.txt | 3 ++- src/multimedia/configure.json | 34 +++++++++++++++++++++++++++------- src/plugins/directshow/directshow.pro | 2 +- src/plugins/plugins.pro | 2 +- src/plugins/wmf/wmf.pro | 2 +- 5 files changed, 32 insertions(+), 11 deletions(-) diff --git a/config_help.txt b/config_help.txt index 78c75acbd..7dd6b772f 100644 --- a/config_help.txt +++ b/config_help.txt @@ -5,4 +5,5 @@ Multimedia options: -no-gstreamer ........ Disable support for GStreamer -gstreamer [version] . Enable GStreamer support [auto] With no parameter, 1.0 is tried first, then 0.10. - -wmf-backend ......... Enable WMF support [no] (Windows only) + -mediaplayer-backend ... Select media player backend (Windows only) + Supported backends: directshow (default), wmf diff --git a/src/multimedia/configure.json b/src/multimedia/configure.json index 19812d19b..d26f6f45e 100644 --- a/src/multimedia/configure.json +++ b/src/multimedia/configure.json @@ -10,7 +10,8 @@ "alsa": "boolean", "gstreamer": { "type": "optionalString", "values": [ "no", "yes", "0.10", "1.0" ] }, "pulseaudio": "boolean", - "wmf-backend": "boolean" + "mediaplayer-backend": { "type": "string", "values": [ "directshow", "wmf" ] }, + "wmf-backend": { "type": "void", "name": "mediaplayer-backend", "value": "wmf" } } }, @@ -192,6 +193,13 @@ "condition": "config.win32 && libs.directshow", "output": [ "feature", "privateFeature" ] }, + "directshow-player": { + "label": "DirectShow", + "enable": "input.mediaplayer-backend == 'directshow'", + "disable": "input.mediaplayer-backend == 'wmf'", + "condition": "features.directshow && !features.wmf-player", + "output": [ "privateFeature" ] + }, "evr": { "label": "evr.h", "condition": "config.win32 && tests.evr", @@ -281,11 +289,16 @@ "condition": "config.win32 && features.directshow && tests.wshellitem", "output": [ "feature", "privateFeature" ] }, - "wmf-backend": { - "label": "Windows Media Foundation backend for Qt Multimedia", - "emitIf": "config.win32", - "autoDetect": false, - "condition": "libraries.wmf", + "wmf": { + "label": "Windows Media Foundation", + "condition": "config.win32 && libs.wmf", + "output": [ "privateFeature" ] + }, + "wmf-player": { + "label": "Windows Media Foundation", + "enable": "input.mediaplayer-backend == 'wmf'", + "disable": "input.mediaplayer-backend != 'wmf'", + "condition": "features.wmf", "output": [ "privateFeature" ] } }, @@ -307,7 +320,14 @@ "mmrenderer", "avfoundation", "directshow", - "wmf-backend" + "wmf", + { + "message": "Media player backend", + "type": "firstAvailableFeature", + "args": "directshow-player wmf-player", + "condition": "config.win32" + } + ] } ] diff --git a/src/plugins/directshow/directshow.pro b/src/plugins/directshow/directshow.pro index 5eb4fbc96..7fe02e662 100644 --- a/src/plugins/directshow/directshow.pro +++ b/src/plugins/directshow/directshow.pro @@ -13,7 +13,7 @@ SOURCES += dsserviceplugin.cpp mingw: DEFINES += NO_DSHOW_STRSAFE include(helpers/helpers.pri) -!qtConfig(wmf-backend): include(player/player.pri) +qtConfig(directshow-player): include(player/player.pri) include(camera/camera.pri) OTHER_FILES += \ diff --git a/src/plugins/plugins.pro b/src/plugins/plugins.pro index 099e472da..98a1bf242 100644 --- a/src/plugins/plugins.pro +++ b/src/plugins/plugins.pro @@ -35,7 +35,7 @@ win32:!winrt { windowsaudio qtConfig(directshow): SUBDIRS += directshow - qtConfig(wmf-backend): SUBDIRS += wmf + qtConfig(wmf): SUBDIRS += wmf } diff --git a/src/plugins/wmf/wmf.pro b/src/plugins/wmf/wmf.pro index c75efe28c..b202ff2a1 100644 --- a/src/plugins/wmf/wmf.pro +++ b/src/plugins/wmf/wmf.pro @@ -17,7 +17,7 @@ SOURCES += \ mfstream.cpp \ sourceresolver.cpp -contains(QT_CONFIG, wmf-backend): include (player/player.pri) +qtConfig(wmf-player): include (player/player.pri) include (decoder/decoder.pri) OTHER_FILES += \ -- cgit v1.2.3 From 544a8a4251ff9694780e563ddb6e4af1325e0115 Mon Sep 17 00:00:00 2001 From: Yoann Lopes Date: Mon, 12 Dec 2016 17:26:10 +0200 Subject: Add changes file for 5.8.0 Change-Id: Icfa096c0792d0733ae2f366ac34d1840f7dfe482 Reviewed-by: Christian Stromme --- dist/changes-5.8.0 | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 dist/changes-5.8.0 diff --git a/dist/changes-5.8.0 b/dist/changes-5.8.0 new file mode 100644 index 000000000..06b0ad118 --- /dev/null +++ b/dist/changes-5.8.0 @@ -0,0 +1,70 @@ +Qt 5.8 introduces many new features and improvements as well as bugfixes +over the 5.7.x series. For more details, refer to the online documentation +included in this distribution. The documentation is also available online: + + http://doc.qt.io/qt-5/index.html + +The Qt version 5.8 series is binary compatible with the 5.7.x series. +Applications compiled for 5.7 will continue to run with 5.8. + +Some of the changes listed in this file include issue tracking numbers +corresponding to tasks in the Qt Bug Tracker: + + https://bugreports.qt.io/ + +Each of these identifiers can be entered in the bug tracker to obtain more +information about a particular change. + +**************************************************************************** +* Library * +**************************************************************************** + +QtMultimedia +------------ + + - Added QAudio::convertVolume() function. + + - QtMultimedia global object (QML): + * Added convertVolume() function. + + - VideoOutput (QML): + * Can now render frames having the YUV 4:2:2 8-bit (UYVY/YUYV) pixel + format. + +**************************************************************************** +* Platform Specific Changes * +**************************************************************************** + +Android +------- + + - Audio volumes passed to a media player are now correctly interpreted + as a linear factor. + +Linux +----- + + - Metadata containing a date information is now correctly returned as a + QDate or QDateTime. + - Added support for QMediaMetaData::CoverArtImage metadata key. + - QVideoProbe is now supported when used with a QCamera. + +OS X +---- + + - Cameras can now support the YUV 4:2:2 8-bit (UYVY/YUYV) pixel format. + +Windows +------- + + - DirectShow: + * Audio volumes passed to a media player are now correctly interpreted + as a linear factor. + +WinRT +----- + + - Cameras can now support the YUV 4:2:2 8-bit (UYVY/YUYV) pixel format. + - [QTBUG-48539] Fixed Camera (QML) focus mode and focus point mode not + being synced with the actual value. + - [QTBUG-48541] Camera flash is now supported. -- cgit v1.2.3 From e5ee1e036eaecb91797cbe85ac7f8929145f3d65 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 16 Dec 2016 15:06:49 -0800 Subject: Suppress the -Wfloat-equal warning qcamera.h:261:36: error: comparing floating point with == or != is unsafe [-Werror=float-equal] Task-number: QTBUG-57649 Change-Id: I15b62e0f9cec482fbb40fffd1490df20dda23c46 Reviewed-by: Yoann Lopes --- src/multimedia/camera/qcamera.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/multimedia/camera/qcamera.h b/src/multimedia/camera/qcamera.h index 7d7063650..180760728 100644 --- a/src/multimedia/camera/qcamera.h +++ b/src/multimedia/camera/qcamera.h @@ -257,9 +257,15 @@ private: Q_DECLARE_OPERATORS_FOR_FLAGS(QCamera::LockTypes) +QT_WARNING_PUSH +QT_WARNING_DISABLE_CLANG("-Wfloat-equal") +QT_WARNING_DISABLE_GCC("-Wfloat-equal") + Q_DECL_CONSTEXPR Q_INLINE_TEMPLATE bool operator==(const QCamera::FrameRateRange &r1, const QCamera::FrameRateRange &r2) Q_DECL_NOTHROW { return r1.minimumFrameRate == r2.minimumFrameRate && r1.maximumFrameRate == r2.maximumFrameRate; } +QT_WARNING_POP + Q_DECL_CONSTEXPR Q_INLINE_TEMPLATE bool operator!=(const QCamera::FrameRateRange &r1, const QCamera::FrameRateRange &r2) Q_DECL_NOTHROW { return !(r1 == r2); } -- cgit v1.2.3 From dd4c9cbd405730b360cb6aed572006078d88cecb Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 31 Jan 2017 14:37:11 +0100 Subject: actually delete obsolete qmultimediadefs.h defining a deprecated forwarding header leads to all kinds of "interesting" effects when the header is actually still there. amends 24a1c04b. Task-number: QTBUG-58432 Change-Id: I4a32bd55fe7bd14e1aff2f3a6ca46439ce1510de Reviewed-by: Lars Knoll --- src/multimedia/qtmultimediadefs.h | 71 --------------------------------------- 1 file changed, 71 deletions(-) delete mode 100644 src/multimedia/qtmultimediadefs.h diff --git a/src/multimedia/qtmultimediadefs.h b/src/multimedia/qtmultimediadefs.h deleted file mode 100644 index f0042faf6..000000000 --- a/src/multimedia/qtmultimediadefs.h +++ /dev/null @@ -1,71 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#ifndef QTMULTIMEDIA_P_H -#define QTMULTIMEDIA_P_H - -#include - -QT_BEGIN_NAMESPACE - -#ifndef QT_STATIC -# if defined(QT_BUILD_MULTIMEDIA_LIB) -# define Q_MULTIMEDIA_EXPORT Q_DECL_EXPORT -# else -# define Q_MULTIMEDIA_EXPORT Q_DECL_IMPORT -# endif -#else -# define Q_MULTIMEDIA_EXPORT -#endif - -QT_END_NAMESPACE - -#endif // QMULTIMEDIA_P_H - -- cgit v1.2.3 From 7c787f11dd2348e0fd2cecc231f15a0acde7481a Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 13 Dec 2016 13:56:49 +0100 Subject: DirectShow: Port to new configure system (evr, wmsdk) Replace old legacy defines by QT_CONFIG. Fixes warnings when using MinGW: qtmultimedia/src/multimedia/qtmultimedia-config.h:4:0: warning: "QT_NO_WMSDK" redefined Change-Id: Ifbfc2cea3bf5bfd06d94fd70e6ea4afb6d6fbb4b Reviewed-by: Lars Knoll --- src/plugins/directshow/camera/camera.pri | 2 -- src/plugins/directshow/directshow.pro | 2 -- .../directshow/player/directshowmetadatacontrol.cpp | 8 +++++--- .../directshow/player/directshowplayerservice.cpp | 16 +++++++++------- .../directshow/player/directshowvideorenderercontrol.cpp | 10 +++++----- .../directshow/player/directshowvideorenderercontrol.h | 6 ++++-- src/plugins/directshow/player/player.pri | 2 -- 7 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/plugins/directshow/camera/camera.pri b/src/plugins/directshow/camera/camera.pri index fb7fbd3f5..afe77fc56 100644 --- a/src/plugins/directshow/camera/camera.pri +++ b/src/plugins/directshow/camera/camera.pri @@ -2,8 +2,6 @@ INCLUDEPATH += $$PWD DEFINES += QMEDIA_DIRECTSHOW_CAMERA -mingw: DEFINES += QT_NO_WMSDK - win32: DEFINES += _CRT_SECURE_NO_WARNINGS HEADERS += \ diff --git a/src/plugins/directshow/directshow.pro b/src/plugins/directshow/directshow.pro index 7fe02e662..8e31527da 100644 --- a/src/plugins/directshow/directshow.pro +++ b/src/plugins/directshow/directshow.pro @@ -8,8 +8,6 @@ win32:!qtHaveModule(opengl)|qtConfig(dynamicgl) { HEADERS += dsserviceplugin.h SOURCES += dsserviceplugin.cpp -!qtConfig(wmsdk): DEFINES += QT_NO_WMSDK - mingw: DEFINES += NO_DSHOW_STRSAFE include(helpers/helpers.pri) diff --git a/src/plugins/directshow/player/directshowmetadatacontrol.cpp b/src/plugins/directshow/player/directshowmetadatacontrol.cpp index 6a88d76a9..ccd408a8a 100644 --- a/src/plugins/directshow/player/directshowmetadatacontrol.cpp +++ b/src/plugins/directshow/player/directshowmetadatacontrol.cpp @@ -57,7 +57,9 @@ #include "directshowmetadatacontrol.h" #include "directshowplayerservice.h" -#ifndef QT_NO_WMSDK +#include + +#if QT_CONFIG(wmsdk) #include #endif @@ -108,7 +110,7 @@ typedef HRESULT (WINAPI *q_SHCreateItemFromParsingName)(PCWSTR, IBindCtx *, cons static q_SHCreateItemFromParsingName sHCreateItemFromParsingName = 0; #endif -#ifndef QT_NO_WMSDK +#if QT_CONFIG(wmsdk) namespace { @@ -513,7 +515,7 @@ void DirectShowMetaDataControl::updateMetadata(IFilterGraph2 *graph, IBaseFilter goto send_event; #endif -#ifndef QT_NO_WMSDK +#if QT_CONFIG(wmsdk) IWMHeaderInfo *info = com_cast(source, IID_IWMHeaderInfo); if (info) { diff --git a/src/plugins/directshow/player/directshowplayerservice.cpp b/src/plugins/directshow/player/directshowplayerservice.cpp index 1502c6df3..1554d194d 100644 --- a/src/plugins/directshow/player/directshowplayerservice.cpp +++ b/src/plugins/directshow/player/directshowplayerservice.cpp @@ -55,22 +55,24 @@ #include "directshowvideorenderercontrol.h" -#ifdef HAVE_EVR +#if QT_CONFIG(evr) #include "directshowevrvideowindowcontrol.h" #endif -#ifndef QT_NO_WMSDK -#include -#endif - #include "qmediacontent.h" +#include + #include #include #include #include #include +#if QT_CONFIG(wmsdk) +# include +#endif + #ifndef Q_CC_MINGW # include #endif @@ -197,7 +199,7 @@ QMediaControl *DirectShowPlayerService::requestControl(const char *name) if (!m_videoRendererControl && !m_videoWindowControl) { IBaseFilter *filter; -#ifdef HAVE_EVR +#if QT_CONFIG(evr) DirectShowEvrVideoWindowControl *evrControl = new DirectShowEvrVideoWindowControl; if ((filter = evrControl->filter())) m_videoWindowControl = evrControl; @@ -980,7 +982,7 @@ void DirectShowPlayerService::doSeek(QMutexLocker *locker) int DirectShowPlayerService::bufferStatus() const { -#ifndef QT_NO_WMSDK +#if QT_CONFIG(wmsdk) QMutexLocker locker(const_cast(&m_mutex)); if (IWMReaderAdvanced2 *reader = com_cast( diff --git a/src/plugins/directshow/player/directshowvideorenderercontrol.cpp b/src/plugins/directshow/player/directshowvideorenderercontrol.cpp index b86125df9..b726040b3 100644 --- a/src/plugins/directshow/player/directshowvideorenderercontrol.cpp +++ b/src/plugins/directshow/player/directshowvideorenderercontrol.cpp @@ -41,7 +41,7 @@ #include "videosurfacefilter.h" -#ifdef HAVE_EVR +#if QT_CONFIG(evr) #include "evrcustompresenter.h" #endif @@ -52,7 +52,7 @@ DirectShowVideoRendererControl::DirectShowVideoRendererControl(DirectShowEventLo , m_loop(loop) , m_surface(0) , m_filter(0) -#ifdef HAVE_EVR +#if QT_CONFIG(evr) , m_evrPresenter(0) #endif { @@ -60,7 +60,7 @@ DirectShowVideoRendererControl::DirectShowVideoRendererControl(DirectShowEventLo DirectShowVideoRendererControl::~DirectShowVideoRendererControl() { -#ifdef HAVE_EVR +#if QT_CONFIG(evr) if (m_evrPresenter) { m_evrPresenter->setSurface(Q_NULLPTR); m_evrPresenter->Release(); @@ -80,7 +80,7 @@ void DirectShowVideoRendererControl::setSurface(QAbstractVideoSurface *surface) if (m_surface == surface) return; -#ifdef HAVE_EVR +#if QT_CONFIG(evr) if (m_evrPresenter) { m_evrPresenter->setSurface(Q_NULLPTR); m_evrPresenter->Release(); @@ -96,7 +96,7 @@ void DirectShowVideoRendererControl::setSurface(QAbstractVideoSurface *surface) m_surface = surface; if (m_surface) { -#ifdef HAVE_EVR +#if QT_CONFIG(evr) m_filter = com_new(clsid_EnhancedVideoRenderer); m_evrPresenter = new EVRCustomPresenter(m_surface); if (!m_evrPresenter->isValid() || !qt_evr_setCustomPresenter(m_filter, m_evrPresenter)) { diff --git a/src/plugins/directshow/player/directshowvideorenderercontrol.h b/src/plugins/directshow/player/directshowvideorenderercontrol.h index 9d1a23933..1df5d6864 100644 --- a/src/plugins/directshow/player/directshowvideorenderercontrol.h +++ b/src/plugins/directshow/player/directshowvideorenderercontrol.h @@ -44,8 +44,10 @@ #include "qvideorenderercontrol.h" +#include + class DirectShowEventLoop; -#ifdef HAVE_EVR +#if QT_CONFIG(evr) class EVRCustomPresenter; #endif @@ -70,7 +72,7 @@ private: DirectShowEventLoop *m_loop; QAbstractVideoSurface *m_surface; IBaseFilter *m_filter; -#ifdef HAVE_EVR +#if QT_CONFIG(evr) EVRCustomPresenter *m_evrPresenter; #endif }; diff --git a/src/plugins/directshow/player/player.pri b/src/plugins/directshow/player/player.pri index 7391ec7f0..18817b879 100644 --- a/src/plugins/directshow/player/player.pri +++ b/src/plugins/directshow/player/player.pri @@ -30,8 +30,6 @@ SOURCES += \ $$PWD/vmr9videowindowcontrol.cpp qtConfig(evr) { - DEFINES += HAVE_EVR - include($$PWD/../../common/evr.pri) HEADERS += \ -- cgit v1.2.3 From cf267527ca9acfe8a18fea25747efad7fef9a5f9 Mon Sep 17 00:00:00 2001 From: Alexander Volkov Date: Fri, 3 Feb 2017 14:19:51 +0300 Subject: Make pulseaudio dependency private Otherwise projects that depend on multimedia module fail to build. Change-Id: I44a614fd3b2bea934149f8bf55eaeb17069258d5 Reviewed-by: Oswald Buddenhagen --- src/multimedia/audio/audio.pri | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/multimedia/audio/audio.pri b/src/multimedia/audio/audio.pri index d6d74a316..202d8b110 100644 --- a/src/multimedia/audio/audio.pri +++ b/src/multimedia/audio/audio.pri @@ -41,7 +41,7 @@ SOURCES += \ audio/qaudiohelpers.cpp qtConfig(pulseaudio) { - QMAKE_USE += pulseaudio + QMAKE_USE_FOR_PRIVATE += pulseaudio DEFINES += QT_MULTIMEDIA_PULSEAUDIO PRIVATE_HEADERS += audio/qsoundeffect_pulse_p.h -- cgit v1.2.3 From 8d0e08e96ffd8cd78fbb4a01f250dfb46117c636 Mon Sep 17 00:00:00 2001 From: Hannah von Reth Date: Wed, 1 Feb 2017 13:03:26 +0100 Subject: WMF plugin: Prevent detaching of QMediaResourceList Change-Id: I2bf0fa346a166bdb20ce76b1fd4d7227680810dd Reviewed-by: Friedemann Kleint Reviewed-by: Yoann Lopes --- src/plugins/wmf/sourceresolver.cpp | 6 +++--- src/plugins/wmf/sourceresolver.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugins/wmf/sourceresolver.cpp b/src/plugins/wmf/sourceresolver.cpp index f10f68c42..83949c976 100644 --- a/src/plugins/wmf/sourceresolver.cpp +++ b/src/plugins/wmf/sourceresolver.cpp @@ -158,7 +158,7 @@ HRESULT STDMETHODCALLTYPE SourceResolver::GetParameters(DWORD*, DWORD*) return E_NOTIMPL; } -void SourceResolver::load(QMediaResourceList& resources, QIODevice* stream) +void SourceResolver::load(const QMediaResourceList &resources, QIODevice* stream) { QMutexLocker locker(&m_mutex); HRESULT hr = S_OK; @@ -176,7 +176,7 @@ void SourceResolver::load(QMediaResourceList& resources, QIODevice* stream) } else if (stream) { QString url; if (!resources.isEmpty()) - url = resources.takeFirst().url().toString(); + url = resources.constFirst().url().toString(); m_stream = new MFStream(stream, false); hr = m_sourceResolver->BeginCreateObjectFromByteStream( m_stream, url.isEmpty() ? 0 : reinterpret_cast(url.utf16()), @@ -187,7 +187,7 @@ void SourceResolver::load(QMediaResourceList& resources, QIODevice* stream) emit error(hr); } } else { - QMediaResource resource = resources.takeFirst(); + QMediaResource resource = resources.constFirst(); QUrl url = resource.url(); #ifdef DEBUG_MEDIAFOUNDATION qDebug() << "loading :" << url; diff --git a/src/plugins/wmf/sourceresolver.h b/src/plugins/wmf/sourceresolver.h index e36d79f5c..387f59739 100644 --- a/src/plugins/wmf/sourceresolver.h +++ b/src/plugins/wmf/sourceresolver.h @@ -59,7 +59,7 @@ public: HRESULT STDMETHODCALLTYPE GetParameters(DWORD*, DWORD*); - void load(QMediaResourceList& resources, QIODevice* stream); + void load(const QMediaResourceList &resources, QIODevice* stream); void cancel(); -- cgit v1.2.3 From 95de9e6154d75688e81a3b79007dfe6c56d3b65b Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Mon, 21 Nov 2016 10:44:47 +0100 Subject: Use QT_CONFIG macro to check for features And remove many custom defines. Change-Id: I658cc8430d1d99ed3c0aafe03a77adce76621a29 Reviewed-by: Yoann Lopes --- src/gsttools/gsttools.pro | 11 +---- src/gsttools/qgstreameraudioinputselector.cpp | 5 ++- src/gsttools/qgstutils.cpp | 7 +-- src/multimedia/audio/audio.pri | 3 -- src/multimedia/audio/qsoundeffect.cpp | 5 ++- src/multimedia/configure.json | 2 +- src/plugins/avfoundation/camera/camera.pro | 2 - .../avfoundation/mediaplayer/mediaplayer.pro | 2 - src/plugins/directshow/camera/camera.pri | 2 - src/plugins/directshow/dsserviceplugin.cpp | 20 ++------- src/plugins/directshow/dsserviceplugin.h | 3 +- .../player/directshowmetadatacontrol.cpp | 6 +-- .../player/directshowvideorenderercontrol.cpp | 1 + .../player/directshowvideorenderercontrol.h | 1 + src/plugins/directshow/player/player.pri | 7 +-- .../audiodecoder/qgstreameraudiodecodersession.cpp | 12 ++--- .../audiodecoder/qgstreameraudiodecodersession.h | 7 +-- src/plugins/gstreamer/camerabin/camerabin.pro | 8 ---- .../gstreamer/camerabin/camerabinaudioencoder.cpp | 9 ++-- .../gstreamer/camerabin/camerabinaudioencoder.h | 7 +-- .../gstreamer/camerabin/camerabincontainer.cpp | 13 +++--- .../gstreamer/camerabin/camerabincontainer.h | 7 +-- .../gstreamer/camerabin/camerabincontrol.cpp | 1 + .../camerabin/camerabinimageprocessing.cpp | 51 +++++++++++----------- .../gstreamer/camerabin/camerabinimageprocessing.h | 11 ++--- .../gstreamer/camerabin/camerabinrecorder.cpp | 4 +- .../gstreamer/camerabin/camerabinrecorder.h | 5 ++- .../camerabin/camerabinresourcepolicy.cpp | 18 ++++---- .../gstreamer/camerabin/camerabinservice.cpp | 5 ++- .../gstreamer/camerabin/camerabinsession.cpp | 14 +++--- src/plugins/gstreamer/camerabin/camerabinsession.h | 9 ++-- .../gstreamer/camerabin/camerabinvideoencoder.cpp | 9 ++-- .../gstreamer/camerabin/camerabinvideoencoder.h | 7 +-- src/plugins/gstreamer/common.pri | 8 +--- .../mediaplayer/qgstreamerplayercontrol.cpp | 4 +- .../mediaplayer/qgstreamerplayerserviceplugin.cpp | 3 +- .../mediaplayer/qgstreamerplayersession.cpp | 10 ++--- .../mediaplayer/qgstreamerplayersession.h | 7 +-- src/plugins/wmf/player/player.pri | 2 - src/plugins/wmf/wmfserviceplugin.cpp | 6 +-- src/plugins/wmf/wmfserviceplugin.h | 3 +- 41 files changed, 146 insertions(+), 171 deletions(-) diff --git a/src/gsttools/gsttools.pro b/src/gsttools/gsttools.pro index e84454980..edbf603e3 100644 --- a/src/gsttools/gsttools.pro +++ b/src/gsttools/gsttools.pro @@ -8,17 +8,13 @@ QT = core-private multimedia-private gui-private !static:DEFINES += QT_MAKEDLL DEFINES += GLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_26 -qtConfig(alsa) { - DEFINES += HAVE_ALSA +qtConfig(alsa): \ QMAKE_USE += alsa -} QMAKE_USE += gstreamer -qtConfig(resourcepolicy) { - DEFINES += HAVE_RESOURCE_POLICY +qtConfig(resourcepolicy): \ QMAKE_USE += libresourceqt5 -} # Header files must go inside source directory of a module # to be installed by syncqt. @@ -101,11 +97,8 @@ qtConfig(gstreamer_app) { QMAKE_USE += gstreamer_app PRIVATE_HEADERS += qgstappsrc_p.h SOURCES += qgstappsrc.cpp - DEFINES += HAVE_GST_APPSRC } -qtConfig(linux_v4l): DEFINES += USE_V4L - HEADERS += $$PRIVATE_HEADERS DESTDIR = $$QT.multimedia.libs diff --git a/src/gsttools/qgstreameraudioinputselector.cpp b/src/gsttools/qgstreameraudioinputselector.cpp index 668347f5c..6d74feb1b 100644 --- a/src/gsttools/qgstreameraudioinputselector.cpp +++ b/src/gsttools/qgstreameraudioinputselector.cpp @@ -37,6 +37,7 @@ ** ****************************************************************************/ +#include #include "qgstreameraudioinputselector_p.h" #include @@ -44,7 +45,7 @@ #include -#ifdef HAVE_ALSA +#if QT_CONFIG(alsa) #include #endif @@ -115,7 +116,7 @@ void QGstreamerAudioInputSelector::update() void QGstreamerAudioInputSelector::updateAlsaDevices() { -#ifdef HAVE_ALSA +#if QT_CONFIG(alsa) void **hints, **n; if (snd_device_name_hint(-1, "pcm", &hints) < 0) { qWarning()<<"no alsa devices available"; diff --git a/src/gsttools/qgstutils.cpp b/src/gsttools/qgstutils.cpp index a2b35073c..2f8a39d67 100644 --- a/src/gsttools/qgstutils.cpp +++ b/src/gsttools/qgstutils.cpp @@ -37,6 +37,7 @@ ** ****************************************************************************/ +#include #include "qgstutils_p.h" #include @@ -58,7 +59,7 @@ template static int lengthOf(const T (&)[N]) { return N; } -#ifdef USE_V4L +#if QT_CONFIG(linux_v4l) # include # include #endif @@ -620,7 +621,7 @@ QVector QGstUtils::enumerateCameras(GstElementFactory *fa } } -#ifdef USE_V4L +#if QT_CONFIG(linux_v4l) QDir devDir(QStringLiteral("/dev")); devDir.setFilter(QDir::System); @@ -675,7 +676,7 @@ QVector QGstUtils::enumerateCameras(GstElementFactory *fa qt_safe_close(fd); } camerasCacheAgeTimer.restart(); -#endif // USE_V4L +#endif // linux_v4l return devices; } diff --git a/src/multimedia/audio/audio.pri b/src/multimedia/audio/audio.pri index 202d8b110..388124205 100644 --- a/src/multimedia/audio/audio.pri +++ b/src/multimedia/audio/audio.pri @@ -42,12 +42,9 @@ SOURCES += \ qtConfig(pulseaudio) { QMAKE_USE_FOR_PRIVATE += pulseaudio - - DEFINES += QT_MULTIMEDIA_PULSEAUDIO PRIVATE_HEADERS += audio/qsoundeffect_pulse_p.h SOURCES += audio/qsoundeffect_pulse_p.cpp } else { - DEFINES += QT_MULTIMEDIA_QAUDIO PRIVATE_HEADERS += audio/qsoundeffect_qaudio_p.h SOURCES += audio/qsoundeffect_qaudio_p.cpp } diff --git a/src/multimedia/audio/qsoundeffect.cpp b/src/multimedia/audio/qsoundeffect.cpp index f8b8d7b18..556ba1193 100644 --- a/src/multimedia/audio/qsoundeffect.cpp +++ b/src/multimedia/audio/qsoundeffect.cpp @@ -37,11 +37,12 @@ ** ****************************************************************************/ +#include #include "qsoundeffect.h" -#if defined(QT_MULTIMEDIA_PULSEAUDIO) +#if QT_CONFIG(pulseaudio) #include "qsoundeffect_pulse_p.h" -#elif(QT_MULTIMEDIA_QAUDIO) +#else #include "qsoundeffect_qaudio_p.h" #endif diff --git a/src/multimedia/configure.json b/src/multimedia/configure.json index d26f6f45e..e7758f0c8 100644 --- a/src/multimedia/configure.json +++ b/src/multimedia/configure.json @@ -282,7 +282,7 @@ "wmsdk": { "label": "wmsdk.h", "condition": "config.win32 && tests.wmsdk", - "output": [ "feature", "privateFeature" ] + "output": [ "privateFeature" ] }, "wshellitem": { "label": "WShellItem", diff --git a/src/plugins/avfoundation/camera/camera.pro b/src/plugins/avfoundation/camera/camera.pro index ab70c25c3..9d2f07656 100644 --- a/src/plugins/avfoundation/camera/camera.pro +++ b/src/plugins/avfoundation/camera/camera.pro @@ -17,8 +17,6 @@ QMAKE_USE += avfoundation OTHER_FILES += avfcamera.json -DEFINES += QMEDIA_AVF_CAMERA - HEADERS += \ avfcameradebug.h \ avfcameraserviceplugin.h \ diff --git a/src/plugins/avfoundation/mediaplayer/mediaplayer.pro b/src/plugins/avfoundation/mediaplayer/mediaplayer.pro index f9a086b33..b60b276e9 100644 --- a/src/plugins/avfoundation/mediaplayer/mediaplayer.pro +++ b/src/plugins/avfoundation/mediaplayer/mediaplayer.pro @@ -10,8 +10,6 @@ LIBS += -framework CoreMedia -framework CoreVideo -framework QuartzCore QMAKE_USE += avfoundation -DEFINES += QMEDIA_AVF_MEDIAPLAYER - HEADERS += \ avfmediaplayercontrol.h \ avfmediaplayermetadatacontrol.h \ diff --git a/src/plugins/directshow/camera/camera.pri b/src/plugins/directshow/camera/camera.pri index afe77fc56..d8ee59aa9 100644 --- a/src/plugins/directshow/camera/camera.pri +++ b/src/plugins/directshow/camera/camera.pri @@ -1,7 +1,5 @@ INCLUDEPATH += $$PWD -DEFINES += QMEDIA_DIRECTSHOW_CAMERA - win32: DEFINES += _CRT_SECURE_NO_WARNINGS HEADERS += \ diff --git a/src/plugins/directshow/dsserviceplugin.cpp b/src/plugins/directshow/dsserviceplugin.cpp index 6f31ce7e2..6d8f97f52 100644 --- a/src/plugins/directshow/dsserviceplugin.cpp +++ b/src/plugins/directshow/dsserviceplugin.cpp @@ -37,6 +37,7 @@ ** ****************************************************************************/ +#include #include #include @@ -45,21 +46,16 @@ #include "dsserviceplugin.h" -#ifdef QMEDIA_DIRECTSHOW_CAMERA #include "dsvideodevicecontrol.h" #include #include "dscameraservice.h" -#endif -#ifdef QMEDIA_DIRECTSHOW_PLAYER +#if QT_CONFIG(directshow_player) #include "directshowplayerservice.h" #endif #include - -#ifdef QMEDIA_DIRECTSHOW_CAMERA - extern const CLSID CLSID_VideoInputDeviceCategory; @@ -75,7 +71,6 @@ extern const CLSID CLSID_VideoInputDeviceCategory; #endif // Q_CC_MSVC #include #include -#endif QT_USE_NAMESPACE @@ -94,13 +89,11 @@ void releaseRefCount() QMediaService* DSServicePlugin::create(QString const& key) { -#ifdef QMEDIA_DIRECTSHOW_CAMERA if (key == QLatin1String(Q_MEDIASERVICE_CAMERA)) { addRefCount(); return new DSCameraService; } -#endif -#ifdef QMEDIA_DIRECTSHOW_PLAYER +#if QT_CONFIG(directshow_player) if (key == QLatin1String(Q_MEDIASERVICE_MEDIAPLAYER)) { addRefCount(); return new DirectShowPlayerService; @@ -127,14 +120,11 @@ QMediaServiceProviderHint::Features DSServicePlugin::supportedFeatures( QByteArray DSServicePlugin::defaultDevice(const QByteArray &service) const { -#ifdef QMEDIA_DIRECTSHOW_CAMERA if (service == Q_MEDIASERVICE_CAMERA) { const QList &devs = DSVideoDeviceControl::availableDevices(); if (!devs.isEmpty()) return devs.first().first; } -#endif - return QByteArray(); } @@ -142,20 +132,17 @@ QList DSServicePlugin::devices(const QByteArray &service) const { QList result; -#ifdef QMEDIA_DIRECTSHOW_CAMERA if (service == Q_MEDIASERVICE_CAMERA) { const QList &devs = DSVideoDeviceControl::availableDevices(); for (const DSVideoDeviceInfo &info : devs) result.append(info.first); } -#endif return result; } QString DSServicePlugin::deviceDescription(const QByteArray &service, const QByteArray &device) { -#ifdef QMEDIA_DIRECTSHOW_CAMERA if (service == Q_MEDIASERVICE_CAMERA) { const QList &devs = DSVideoDeviceControl::availableDevices(); for (const DSVideoDeviceInfo &info : devs) { @@ -163,6 +150,5 @@ QString DSServicePlugin::deviceDescription(const QByteArray &service, const QByt return info.second; } } -#endif return QString(); } diff --git a/src/plugins/directshow/dsserviceplugin.h b/src/plugins/directshow/dsserviceplugin.h index 8470fc3b5..b7ac6a86e 100644 --- a/src/plugins/directshow/dsserviceplugin.h +++ b/src/plugins/directshow/dsserviceplugin.h @@ -40,6 +40,7 @@ #ifndef DSSERVICEPLUGIN_H #define DSSERVICEPLUGIN_H +#include #include "qmediaserviceproviderplugin.h" QT_USE_NAMESPACE @@ -56,7 +57,7 @@ class DSServicePlugin Q_INTERFACES(QMediaServiceFeaturesInterface) // The player service provided by the WMF-plugin should preferably be used. // DirectShow should then only provide the camera (see QTBUG-29172, QTBUG-29175). -#ifdef QMEDIA_DIRECTSHOW_PLAYER +#if QT_CONFIG(directshow_player) Q_PLUGIN_METADATA(IID "org.qt-project.qt.mediaserviceproviderfactory/5.0" FILE "directshow.json") #else Q_PLUGIN_METADATA(IID "org.qt-project.qt.mediaserviceproviderfactory/5.0" FILE "directshow_camera.json") diff --git a/src/plugins/directshow/player/directshowmetadatacontrol.cpp b/src/plugins/directshow/player/directshowmetadatacontrol.cpp index ccd408a8a..45d3a958b 100644 --- a/src/plugins/directshow/player/directshowmetadatacontrol.cpp +++ b/src/plugins/directshow/player/directshowmetadatacontrol.cpp @@ -63,7 +63,7 @@ #include #endif -#ifndef QT_NO_SHELLITEM +#if QT_CONFIG(wshellitem) #include #include #include @@ -292,7 +292,7 @@ static QVariant getValue(IWMHeaderInfo *header, const wchar_t *key) } #endif -#ifndef QT_NO_SHELLITEM +#if QT_CONFIG(wshellitem) static QVariant convertValue(const PROPVARIANT& var) { QVariant value; @@ -392,7 +392,7 @@ void DirectShowMetaDataControl::updateMetadata(IFilterGraph2 *graph, IBaseFilter { m_metadata.clear(); -#ifndef QT_NO_SHELLITEM +#if QT_CONFIG(wshellitem) if (!sHCreateItemFromParsingName) { QSystemLibrary lib(QStringLiteral("shell32")); sHCreateItemFromParsingName = (q_SHCreateItemFromParsingName)(lib.resolve("SHCreateItemFromParsingName")); diff --git a/src/plugins/directshow/player/directshowvideorenderercontrol.cpp b/src/plugins/directshow/player/directshowvideorenderercontrol.cpp index b726040b3..40f77e899 100644 --- a/src/plugins/directshow/player/directshowvideorenderercontrol.cpp +++ b/src/plugins/directshow/player/directshowvideorenderercontrol.cpp @@ -37,6 +37,7 @@ ** ****************************************************************************/ +#include #include "directshowvideorenderercontrol.h" #include "videosurfacefilter.h" diff --git a/src/plugins/directshow/player/directshowvideorenderercontrol.h b/src/plugins/directshow/player/directshowvideorenderercontrol.h index 1df5d6864..36c5b2248 100644 --- a/src/plugins/directshow/player/directshowvideorenderercontrol.h +++ b/src/plugins/directshow/player/directshowvideorenderercontrol.h @@ -40,6 +40,7 @@ #ifndef DIRECTSHOWVIDEORENDERERCONTROL_H #define DIRECTSHOWVIDEORENDERERCONTROL_H +#include #include #include "qvideorenderercontrol.h" diff --git a/src/plugins/directshow/player/player.pri b/src/plugins/directshow/player/player.pri index 18817b879..59ac5a330 100644 --- a/src/plugins/directshow/player/player.pri +++ b/src/plugins/directshow/player/player.pri @@ -5,8 +5,6 @@ LIBS += -lgdi32 qtHaveModule(widgets): QT += widgets -DEFINES += QMEDIA_DIRECTSHOW_PLAYER - HEADERS += \ $$PWD/directshowioreader.h \ $$PWD/directshowiosource.h \ @@ -39,8 +37,5 @@ qtConfig(evr) { $$PWD/directshowevrvideowindowcontrol.cpp } -qtConfig(wshellitem) { +qtConfig(wshellitem): \ QT += core-private -} else { - DEFINES += QT_NO_SHELLITEM -} diff --git a/src/plugins/gstreamer/audiodecoder/qgstreameraudiodecodersession.cpp b/src/plugins/gstreamer/audiodecoder/qgstreameraudiodecodersession.cpp index 5e00dab6f..779978e70 100644 --- a/src/plugins/gstreamer/audiodecoder/qgstreameraudiodecodersession.cpp +++ b/src/plugins/gstreamer/audiodecoder/qgstreameraudiodecodersession.cpp @@ -81,7 +81,7 @@ QGstreamerAudioDecoderSession::QGstreamerAudioDecoderSession(QObject *parent) m_outputBin(0), m_audioConvert(0), m_appSink(0), -#if defined(HAVE_GST_APPSRC) +#if QT_CONFIG(gstreamer_app) m_appSrc(0), #endif mDevice(0), @@ -114,7 +114,7 @@ QGstreamerAudioDecoderSession::QGstreamerAudioDecoderSession(QObject *parent) gst_object_unref(GST_OBJECT(pad)); g_object_set(G_OBJECT(m_playbin), "audio-sink", m_outputBin, NULL); -#if defined(HAVE_GST_APPSRC) +#if QT_CONFIG(gstreamer_app) g_signal_connect(G_OBJECT(m_playbin), "deep-notify::source", (GCallback) &QGstreamerAudioDecoderSession::configureAppSrcElement, (gpointer)this); #endif @@ -130,7 +130,7 @@ QGstreamerAudioDecoderSession::~QGstreamerAudioDecoderSession() stop(); delete m_busHelper; -#if defined(HAVE_GST_APPSRC) +#if QT_CONFIG(gstreamer_app) delete m_appSrc; #endif gst_object_unref(GST_OBJECT(m_bus)); @@ -138,7 +138,7 @@ QGstreamerAudioDecoderSession::~QGstreamerAudioDecoderSession() } } -#if defined(HAVE_GST_APPSRC) +#if QT_CONFIG(gstreamer_app) void QGstreamerAudioDecoderSession::configureAppSrcElement(GObject* object, GObject *orig, GParamSpec *pspec, QGstreamerAudioDecoderSession* self) { Q_UNUSED(object); @@ -307,7 +307,7 @@ void QGstreamerAudioDecoderSession::setSourceFilename(const QString &fileName) { stop(); mDevice = 0; -#if defined(HAVE_GST_APPSRC) +#if QT_CONFIG(gstreamer_app) if (m_appSrc) m_appSrc->deleteLater(); m_appSrc = 0; @@ -346,7 +346,7 @@ void QGstreamerAudioDecoderSession::start() if (!mSource.isEmpty()) { g_object_set(G_OBJECT(m_playbin), "uri", QUrl::fromLocalFile(mSource).toEncoded().constData(), NULL); } else if (mDevice) { -#if defined(HAVE_GST_APPSRC) +#if QT_CONFIG(gstreamer_app) // make sure we can read from device if (!mDevice->isOpen() || !mDevice->isReadable()) { processInvalidMedia(QAudioDecoder::AccessDeniedError, "Unable to read from specified device"); diff --git a/src/plugins/gstreamer/audiodecoder/qgstreameraudiodecodersession.h b/src/plugins/gstreamer/audiodecoder/qgstreameraudiodecodersession.h index 991ac0043..3d0e9a2b0 100644 --- a/src/plugins/gstreamer/audiodecoder/qgstreameraudiodecodersession.h +++ b/src/plugins/gstreamer/audiodecoder/qgstreameraudiodecodersession.h @@ -40,13 +40,14 @@ #ifndef QGSTREAMERPLAYERSESSION_H #define QGSTREAMERPLAYERSESSION_H +#include #include #include #include "qgstreameraudiodecodercontrol.h" #include #include "qaudiodecoder.h" -#if defined(HAVE_GST_APPSRC) +#if QT_CONFIG(gstreamer_app) #include #endif @@ -75,7 +76,7 @@ public: bool processBusMessage(const QGstreamerMessage &message); -#if defined(HAVE_GST_APPSRC) +#if QT_CONFIG(gstreamer_app) QGstAppSrc *appsrc() const { return m_appSrc; } static void configureAppSrcElement(GObject*, GObject*, GParamSpec*,QGstreamerAudioDecoderSession* _this); #endif @@ -134,7 +135,7 @@ private: GstElement *m_audioConvert; GstAppSink *m_appSink; -#if defined(HAVE_GST_APPSRC) +#if QT_CONFIG(gstreamer_app) QGstAppSrc *m_appSrc; #endif diff --git a/src/plugins/gstreamer/camerabin/camerabin.pro b/src/plugins/gstreamer/camerabin/camerabin.pro index d214d61c6..183ddf2d4 100644 --- a/src/plugins/gstreamer/camerabin/camerabin.pro +++ b/src/plugins/gstreamer/camerabin/camerabin.pro @@ -53,8 +53,6 @@ SOURCES += \ $$PWD/camerabininfocontrol.cpp qtConfig(gstreamer_photography) { - DEFINES += HAVE_GST_PHOTOGRAPHY - HEADERS += \ $$PWD/camerabinfocus.h \ $$PWD/camerabinexposure.h \ @@ -71,13 +69,7 @@ qtConfig(gstreamer_photography) { DEFINES += GST_USE_UNSTABLE_API #prevents warnings because of unstable photography API } -qtConfig(gstreamer_encodingprofiles) { - DEFINES += HAVE_GST_ENCODING_PROFILES -} - qtConfig(linux_v4l) { - DEFINES += USE_V4L - HEADERS += \ $$PWD/camerabinv4limageprocessing.h diff --git a/src/plugins/gstreamer/camerabin/camerabinaudioencoder.cpp b/src/plugins/gstreamer/camerabin/camerabinaudioencoder.cpp index c638e087f..79c915aad 100644 --- a/src/plugins/gstreamer/camerabin/camerabinaudioencoder.cpp +++ b/src/plugins/gstreamer/camerabin/camerabinaudioencoder.cpp @@ -37,6 +37,7 @@ ** ****************************************************************************/ +#include #include "camerabinaudioencoder.h" #include "camerabincontainer.h" #include @@ -47,7 +48,7 @@ QT_BEGIN_NAMESPACE CameraBinAudioEncoder::CameraBinAudioEncoder(QObject *parent) :QAudioEncoderSettingsControl(parent) -#ifdef HAVE_GST_ENCODING_PROFILES +#if QT_CONFIG(gstreamer_encodingprofiles) , m_codecs(QGstCodecsInfo::AudioEncoder) #endif { @@ -59,7 +60,7 @@ CameraBinAudioEncoder::~CameraBinAudioEncoder() QStringList CameraBinAudioEncoder::supportedAudioCodecs() const { -#ifdef HAVE_GST_ENCODING_PROFILES +#if QT_CONFIG(gstreamer_encodingprofiles) return m_codecs.supportedCodecs(); #else return QStringList(); @@ -68,7 +69,7 @@ QStringList CameraBinAudioEncoder::supportedAudioCodecs() const QString CameraBinAudioEncoder::codecDescription(const QString &codecName) const { -#ifdef HAVE_GST_ENCODING_PROFILES +#if QT_CONFIG(gstreamer_encodingprofiles) return m_codecs.codecDescription(codecName); #else Q_UNUSED(codecName) @@ -112,7 +113,7 @@ void CameraBinAudioEncoder::resetActualSettings() m_actualAudioSettings = m_audioSettings; } -#ifdef HAVE_GST_ENCODING_PROFILES +#if QT_CONFIG(gstreamer_encodingprofiles) GstEncodingProfile *CameraBinAudioEncoder::createProfile() { diff --git a/src/plugins/gstreamer/camerabin/camerabinaudioencoder.h b/src/plugins/gstreamer/camerabin/camerabinaudioencoder.h index cb3d895c7..943ef19b0 100644 --- a/src/plugins/gstreamer/camerabin/camerabinaudioencoder.h +++ b/src/plugins/gstreamer/camerabin/camerabinaudioencoder.h @@ -40,6 +40,7 @@ #ifndef CAMERABINAUDIOENCODE_H #define CAMERABINAUDIOENCODE_H +#include #include #include @@ -49,7 +50,7 @@ #include #include -#ifdef HAVE_GST_ENCODING_PROFILES +#if QT_CONFIG(gstreamer_encodingprofiles) #include #include #endif @@ -85,7 +86,7 @@ public: void setActualAudioSettings(const QAudioEncoderSettings&); void resetActualSettings(); -#ifdef HAVE_GST_ENCODING_PROFILES +#if QT_CONFIG(gstreamer_encodingprofiles) GstEncodingProfile *createProfile(); #endif @@ -95,7 +96,7 @@ Q_SIGNALS: void settingsChanged(); private: -#ifdef HAVE_GST_ENCODING_PROFILES +#if QT_CONFIG(gstreamer_encodingprofiles) QGstCodecsInfo m_codecs; #endif diff --git a/src/plugins/gstreamer/camerabin/camerabincontainer.cpp b/src/plugins/gstreamer/camerabin/camerabincontainer.cpp index e72bf0e3c..1479b4ba6 100644 --- a/src/plugins/gstreamer/camerabin/camerabincontainer.cpp +++ b/src/plugins/gstreamer/camerabin/camerabincontainer.cpp @@ -37,6 +37,7 @@ ** ****************************************************************************/ +#include #include "camerabincontainer.h" #include @@ -46,7 +47,7 @@ QT_BEGIN_NAMESPACE CameraBinContainer::CameraBinContainer(QObject *parent) :QMediaContainerControl(parent) -#ifdef HAVE_GST_ENCODING_PROFILES +#if QT_CONFIG(gstreamer_encodingprofiles) , m_supportedContainers(QGstCodecsInfo::Muxer) #endif { @@ -62,7 +63,7 @@ CameraBinContainer::CameraBinContainer(QObject *parent) QStringList CameraBinContainer::supportedContainers() const { -#ifdef HAVE_GST_ENCODING_PROFILES +#if QT_CONFIG(gstreamer_encodingprofiles) return m_supportedContainers.supportedCodecs(); #else return QStringList(); @@ -71,7 +72,7 @@ QStringList CameraBinContainer::supportedContainers() const QString CameraBinContainer::containerDescription(const QString &formatMimeType) const { -#ifdef HAVE_GST_ENCODING_PROFILES +#if QT_CONFIG(gstreamer_encodingprofiles) return m_supportedContainers.codecDescription(formatMimeType); #else Q_UNUSED(formatMimeType) @@ -86,7 +87,7 @@ QString CameraBinContainer::containerFormat() const void CameraBinContainer::setContainerFormat(const QString &format) { -#ifdef HAVE_GST_ENCODING_PROFILES +#if QT_CONFIG(gstreamer_encodingprofiles) if (m_format != format) { m_format = format; m_actualFormat = format; @@ -102,7 +103,7 @@ QString CameraBinContainer::actualContainerFormat() const void CameraBinContainer::setActualContainerFormat(const QString &containerFormat) { -#ifdef HAVE_GST_ENCODING_PROFILES +#if QT_CONFIG(gstreamer_encodingprofiles) m_actualFormat = containerFormat; #endif } @@ -112,7 +113,7 @@ void CameraBinContainer::resetActualContainerFormat() m_actualFormat = m_format; } -#ifdef HAVE_GST_ENCODING_PROFILES +#if QT_CONFIG(gstreamer_encodingprofiles) GstEncodingContainerProfile *CameraBinContainer::createProfile() { diff --git a/src/plugins/gstreamer/camerabin/camerabincontainer.h b/src/plugins/gstreamer/camerabin/camerabincontainer.h index 8e9f21eaf..25de50095 100644 --- a/src/plugins/gstreamer/camerabin/camerabincontainer.h +++ b/src/plugins/gstreamer/camerabin/camerabincontainer.h @@ -41,6 +41,7 @@ #ifndef CAMERABINMEDIACONTAINERCONTROL_H #define CAMERABINMEDIACONTAINERCONTROL_H +#include #include #include #include @@ -48,7 +49,7 @@ #include #include -#ifdef HAVE_GST_ENCODING_PROFILES +#if QT_CONFIG(gstreamer_encodingprofiles) #include #include #endif @@ -74,7 +75,7 @@ public: QString suggestedFileExtension(const QString &containerFormat) const; -#ifdef HAVE_GST_ENCODING_PROFILES +#if QT_CONFIG(gstreamer_encodingprofiles) GstEncodingContainerProfile *createProfile(); #endif @@ -86,7 +87,7 @@ private: QString m_actualFormat; QMap m_fileExtensions; -#ifdef HAVE_GST_ENCODING_PROFILES +#if QT_CONFIG(gstreamer_encodingprofiles) QGstCodecsInfo m_supportedContainers; #endif }; diff --git a/src/plugins/gstreamer/camerabin/camerabincontrol.cpp b/src/plugins/gstreamer/camerabin/camerabincontrol.cpp index 48642d51b..a34315b8a 100644 --- a/src/plugins/gstreamer/camerabin/camerabincontrol.cpp +++ b/src/plugins/gstreamer/camerabin/camerabincontrol.cpp @@ -37,6 +37,7 @@ ** ****************************************************************************/ +#include #include "camerabincontrol.h" #include "camerabincontainer.h" #include "camerabinaudioencoder.h" diff --git a/src/plugins/gstreamer/camerabin/camerabinimageprocessing.cpp b/src/plugins/gstreamer/camerabin/camerabinimageprocessing.cpp index e30441f86..f819c9f24 100644 --- a/src/plugins/gstreamer/camerabin/camerabinimageprocessing.cpp +++ b/src/plugins/gstreamer/camerabin/camerabinimageprocessing.cpp @@ -37,10 +37,11 @@ ** ****************************************************************************/ +#include #include "camerabinimageprocessing.h" #include "camerabinsession.h" -#ifdef USE_V4L +#if QT_CONFIG(linux_v4l) #include "camerabinv4limageprocessing.h" #endif @@ -56,11 +57,11 @@ CameraBinImageProcessing::CameraBinImageProcessing(CameraBinSession *session) : QCameraImageProcessingControl(session) , m_session(session) , m_whiteBalanceMode(QCameraImageProcessing::WhiteBalanceAuto) -#ifdef USE_V4L +#if QT_CONFIG(linux_v4l) , m_v4lImageControl(Q_NULLPTR) #endif { -#ifdef HAVE_GST_PHOTOGRAPHY +#if QT_CONFIG(gstreamer_photography) if (m_session->photography()) { m_mappedWbValues[GST_PHOTOGRAPHY_WB_MODE_AUTO] = QCameraImageProcessing::WhiteBalanceAuto; m_mappedWbValues[GST_PHOTOGRAPHY_WB_MODE_DAYLIGHT] = QCameraImageProcessing::WhiteBalanceSunlight; @@ -96,7 +97,7 @@ CameraBinImageProcessing::CameraBinImageProcessing(CameraBinSession *session) #endif #endif -#ifdef USE_V4L +#if QT_CONFIG(linux_v4l) m_v4lImageControl = new CameraBinV4LImageProcessing(m_session); connect(m_session, &CameraBinSession::statusChanged, m_v4lImageControl, &CameraBinV4LImageProcessing::updateParametersInfo); @@ -181,7 +182,7 @@ QCameraImageProcessing::WhiteBalanceMode CameraBinImageProcessing::whiteBalanceM bool CameraBinImageProcessing::setWhiteBalanceMode(QCameraImageProcessing::WhiteBalanceMode mode) { -#ifdef HAVE_GST_PHOTOGRAPHY +#if QT_CONFIG(gstreamer_photography) if (isWhiteBalanceModeSupported(mode)) { m_whiteBalanceMode = mode; #if GST_CHECK_VERSION(1, 2, 0) @@ -202,7 +203,7 @@ bool CameraBinImageProcessing::setWhiteBalanceMode(QCameraImageProcessing::White bool CameraBinImageProcessing::isWhiteBalanceModeSupported(QCameraImageProcessing::WhiteBalanceMode mode) const { -#ifdef HAVE_GST_PHOTOGRAPHY +#if QT_CONFIG(gstreamer_photography) return m_mappedWbValues.values().contains(mode); #else Q_UNUSED(mode); @@ -212,7 +213,7 @@ bool CameraBinImageProcessing::isWhiteBalanceModeSupported(QCameraImageProcessin bool CameraBinImageProcessing::isParameterSupported(QCameraImageProcessingControl::ProcessingParameter parameter) const { -#ifdef HAVE_GST_PHOTOGRAPHY +#if QT_CONFIG(gstreamer_photography) if (parameter == QCameraImageProcessingControl::WhiteBalancePreset || parameter == QCameraImageProcessingControl::ColorFilter) { if (m_session->photography()) @@ -227,7 +228,7 @@ bool CameraBinImageProcessing::isParameterSupported(QCameraImageProcessingContro return true; } -#ifdef USE_V4L +#if QT_CONFIG(linux_v4l) if (m_v4lImageControl->isParameterSupported(parameter)) return true; #endif @@ -243,14 +244,14 @@ bool CameraBinImageProcessing::isParameterValueSupported(QCameraImageProcessingC case SaturationAdjustment: { const bool isGstColorBalanceValueSupported = GST_IS_COLOR_BALANCE(m_session->cameraBin()) && qAbs(value.toReal()) <= 1.0; -#ifdef USE_V4L +#if QT_CONFIG(linux_v4l) if (!isGstColorBalanceValueSupported) return m_v4lImageControl->isParameterValueSupported(parameter, value); #endif return isGstColorBalanceValueSupported; } case SharpeningAdjustment: { -#ifdef USE_V4L +#if QT_CONFIG(linux_v4l) return m_v4lImageControl->isParameterValueSupported(parameter, value); #else return false; @@ -260,14 +261,14 @@ bool CameraBinImageProcessing::isParameterValueSupported(QCameraImageProcessingC const QCameraImageProcessing::WhiteBalanceMode mode = value.value(); const bool isPhotographyWhiteBalanceSupported = isWhiteBalanceModeSupported(mode); -#ifdef USE_V4L +#if QT_CONFIG(linux_v4l) if (!isPhotographyWhiteBalanceSupported) return m_v4lImageControl->isParameterValueSupported(parameter, value); #endif return isPhotographyWhiteBalanceSupported; } case ColorTemperature: { -#ifdef USE_V4L +#if QT_CONFIG(linux_v4l) return m_v4lImageControl->isParameterValueSupported(parameter, value); #else return false; @@ -275,7 +276,7 @@ bool CameraBinImageProcessing::isParameterValueSupported(QCameraImageProcessingC } case ColorFilter: { const QCameraImageProcessing::ColorFilter filter = value.value(); -#ifdef HAVE_GST_PHOTOGRAPHY +#if QT_CONFIG(gstreamer_photography) return m_filterMap.contains(filter); #else return filter == QCameraImageProcessing::ColorFilterNone; @@ -294,7 +295,7 @@ QVariant CameraBinImageProcessing::parameter( switch (parameter) { case QCameraImageProcessingControl::WhiteBalancePreset: { const QCameraImageProcessing::WhiteBalanceMode mode = whiteBalanceMode(); -#ifdef USE_V4L +#if QT_CONFIG(linux_v4l) if (mode == QCameraImageProcessing::WhiteBalanceAuto || mode == QCameraImageProcessing::WhiteBalanceManual) { return m_v4lImageControl->parameter(parameter); @@ -303,14 +304,14 @@ QVariant CameraBinImageProcessing::parameter( return QVariant::fromValue(mode); } case QCameraImageProcessingControl::ColorTemperature: { -#ifdef USE_V4L +#if QT_CONFIG(linux_v4l) return m_v4lImageControl->parameter(parameter); #else return QVariant(); #endif } case QCameraImageProcessingControl::ColorFilter: -#ifdef HAVE_GST_PHOTOGRAPHY +#if QT_CONFIG(gstreamer_photography) if (GstPhotography *photography = m_session->photography()) { #if GST_CHECK_VERSION(1, 0, 0) GstPhotographyColorToneMode mode = GST_PHOTOGRAPHY_COLOR_TONE_MODE_NORMAL; @@ -325,7 +326,7 @@ QVariant CameraBinImageProcessing::parameter( return QVariant::fromValue(QCameraImageProcessing::ColorFilterNone); default: { const bool isGstParameterSupported = m_values.contains(parameter); -#ifdef USE_V4L +#if QT_CONFIG(linux_v4l) if (!isGstParameterSupported) { if (parameter == QCameraImageProcessingControl::BrightnessAdjustment || parameter == QCameraImageProcessingControl::ContrastAdjustment @@ -348,7 +349,7 @@ void CameraBinImageProcessing::setParameter(QCameraImageProcessingControl::Proce switch (parameter) { case ContrastAdjustment: { if (!setColorBalanceValue("contrast", value.toReal())) { -#ifdef USE_V4L +#if QT_CONFIG(linux_v4l) m_v4lImageControl->setParameter(parameter, value); #endif } @@ -356,7 +357,7 @@ void CameraBinImageProcessing::setParameter(QCameraImageProcessingControl::Proce break; case BrightnessAdjustment: { if (!setColorBalanceValue("brightness", value.toReal())) { -#ifdef USE_V4L +#if QT_CONFIG(linux_v4l) m_v4lImageControl->setParameter(parameter, value); #endif } @@ -364,21 +365,21 @@ void CameraBinImageProcessing::setParameter(QCameraImageProcessingControl::Proce break; case SaturationAdjustment: { if (!setColorBalanceValue("saturation", value.toReal())) { -#ifdef USE_V4L +#if QT_CONFIG(linux_v4l) m_v4lImageControl->setParameter(parameter, value); #endif } } break; case SharpeningAdjustment: { -#ifdef USE_V4L +#if QT_CONFIG(linux_v4l) m_v4lImageControl->setParameter(parameter, value); #endif } break; case WhiteBalancePreset: { if (!setWhiteBalanceMode(value.value())) { -#ifdef USE_V4L +#if QT_CONFIG(linux_v4l) const QCameraImageProcessing::WhiteBalanceMode mode = value.value(); if (mode == QCameraImageProcessing::WhiteBalanceAuto @@ -391,13 +392,13 @@ void CameraBinImageProcessing::setParameter(QCameraImageProcessingControl::Proce } break; case QCameraImageProcessingControl::ColorTemperature: { -#ifdef USE_V4L +#if QT_CONFIG(linux_v4l) m_v4lImageControl->setParameter(parameter, value); #endif break; } case QCameraImageProcessingControl::ColorFilter: -#ifdef HAVE_GST_PHOTOGRAPHY +#if QT_CONFIG(gstreamer_photography) if (GstPhotography *photography = m_session->photography()) { #if GST_CHECK_VERSION(1, 0, 0) gst_photography_set_color_tone_mode(photography, m_filterMap.value( @@ -418,7 +419,7 @@ void CameraBinImageProcessing::setParameter(QCameraImageProcessingControl::Proce updateColorBalanceValues(); } -#ifdef HAVE_GST_PHOTOGRAPHY +#if QT_CONFIG(gstreamer_photography) void CameraBinImageProcessing::lockWhiteBalance() { #if GST_CHECK_VERSION(1, 2, 0) diff --git a/src/plugins/gstreamer/camerabin/camerabinimageprocessing.h b/src/plugins/gstreamer/camerabin/camerabinimageprocessing.h index 82c6e1678..b09c8d52b 100644 --- a/src/plugins/gstreamer/camerabin/camerabinimageprocessing.h +++ b/src/plugins/gstreamer/camerabin/camerabinimageprocessing.h @@ -40,13 +40,14 @@ #ifndef CAMERABINIMAGEPROCESSINGCONTROL_H #define CAMERABINIMAGEPROCESSINGCONTROL_H +#include #include #include #include #include -#ifdef HAVE_GST_PHOTOGRAPHY +#if QT_CONFIG(gstreamer_photography) # include # if !GST_CHECK_VERSION(1,0,0) typedef GstWhiteBalanceMode GstPhotographyWhiteBalanceMode; @@ -56,7 +57,7 @@ typedef GstColourToneMode GstPhotographyColorToneMode; QT_BEGIN_NAMESPACE -#ifdef USE_V4L +#if QT_CONFIG(linux_v4l) class CameraBinV4LImageProcessing; #endif @@ -79,7 +80,7 @@ public: QVariant parameter(ProcessingParameter parameter) const; void setParameter(ProcessingParameter parameter, const QVariant &value); -#ifdef HAVE_GST_PHOTOGRAPHY +#if QT_CONFIG(gstreamer_photography) void lockWhiteBalance(); void unlockWhiteBalance(); #endif @@ -91,13 +92,13 @@ private: private: CameraBinSession *m_session; QMap m_values; -#ifdef HAVE_GST_PHOTOGRAPHY +#if QT_CONFIG(gstreamer_photography) QMap m_mappedWbValues; QMap m_filterMap; #endif QCameraImageProcessing::WhiteBalanceMode m_whiteBalanceMode; -#ifdef USE_V4L +#if QT_CONFIG(linux_v4l) CameraBinV4LImageProcessing *m_v4lImageControl; #endif }; diff --git a/src/plugins/gstreamer/camerabin/camerabinrecorder.cpp b/src/plugins/gstreamer/camerabin/camerabinrecorder.cpp index 548752a16..e9e8e0f71 100644 --- a/src/plugins/gstreamer/camerabin/camerabinrecorder.cpp +++ b/src/plugins/gstreamer/camerabin/camerabinrecorder.cpp @@ -136,7 +136,7 @@ qint64 CameraBinRecorder::duration() const void CameraBinRecorder::applySettings() { -#ifdef HAVE_GST_ENCODING_PROFILES +#if QT_CONFIG(gstreamer_encodingprofiles) CameraBinContainer *containerControl = m_session->mediaContainerControl(); CameraBinAudioEncoder *audioEncoderControl = m_session->audioEncodeControl(); CameraBinVideoEncoder *videoEncoderControl = m_session->videoEncodeControl(); @@ -181,7 +181,7 @@ void CameraBinRecorder::applySettings() #endif } -#ifdef HAVE_GST_ENCODING_PROFILES +#if QT_CONFIG(gstreamer_encodingprofiles) GstEncodingContainerProfile *CameraBinRecorder::videoProfile() { diff --git a/src/plugins/gstreamer/camerabin/camerabinrecorder.h b/src/plugins/gstreamer/camerabin/camerabinrecorder.h index c5280ebd7..86aa2fb94 100644 --- a/src/plugins/gstreamer/camerabin/camerabinrecorder.h +++ b/src/plugins/gstreamer/camerabin/camerabinrecorder.h @@ -41,10 +41,11 @@ #ifndef CAMERABINRECORDERCONTROL_H #define CAMERABINRECORDERCONTROL_H +#include #include #include "camerabinsession.h" -#ifdef HAVE_GST_ENCODING_PROFILES +#if QT_CONFIG(gstreamer_encodingprofiles) #include #endif @@ -71,7 +72,7 @@ public: void applySettings(); -#ifdef HAVE_GST_ENCODING_PROFILES +#if QT_CONFIG(gstreamer_encodingprofiles) GstEncodingContainerProfile *videoProfile(); #endif diff --git a/src/plugins/gstreamer/camerabin/camerabinresourcepolicy.cpp b/src/plugins/gstreamer/camerabin/camerabinresourcepolicy.cpp index 3f14ffcc5..6da86e569 100644 --- a/src/plugins/gstreamer/camerabin/camerabinresourcepolicy.cpp +++ b/src/plugins/gstreamer/camerabin/camerabinresourcepolicy.cpp @@ -37,13 +37,13 @@ ** ****************************************************************************/ +#include "QtMultimedia/private/qtmultimediaglobal_p.h" #include "camerabinresourcepolicy.h" - //#define DEBUG_RESOURCE_POLICY #include #include -#ifdef HAVE_RESOURCE_POLICY +#if QT_CONFIG(resourcepolicy) #include #include #include @@ -57,7 +57,7 @@ CamerabinResourcePolicy::CamerabinResourcePolicy(QObject *parent) : m_releasingResources(false), m_canCapture(false) { -#ifdef HAVE_RESOURCE_POLICY +#if QT_CONFIG(resourcepolicy) //loaded resource set is also kept requested for image and video capture sets m_resource = new ResourcePolicy::ResourceSet("camera"); m_resource->setAlwaysReply(); @@ -76,7 +76,7 @@ CamerabinResourcePolicy::CamerabinResourcePolicy(QObject *parent) : CamerabinResourcePolicy::~CamerabinResourcePolicy() { -#ifdef HAVE_RESOURCE_POLICY +#if QT_CONFIG(resourcepolicy) //ensure the resources are released if (m_resourceSet != NoResources) setResourceSet(NoResources); @@ -106,7 +106,7 @@ void CamerabinResourcePolicy::setResourceSet(CamerabinResourcePolicy::ResourceSe qDebug() << Q_FUNC_INFO << set; #endif -#ifdef HAVE_RESOURCE_POLICY +#if QT_CONFIG(resourcepolicy) QSet requestedTypes; switch (set) { @@ -178,7 +178,7 @@ void CamerabinResourcePolicy::setResourceSet(CamerabinResourcePolicy::ResourceSe bool CamerabinResourcePolicy::isResourcesGranted() const { -#ifdef HAVE_RESOURCE_POLICY +#if QT_CONFIG(resourcepolicy) const auto resources = m_resource->resources(); for (ResourcePolicy::Resource *resource : resources) if (!resource->isOptional() && !resource->isGranted()) @@ -201,7 +201,7 @@ void CamerabinResourcePolicy::handleResourcesGranted() void CamerabinResourcePolicy::handleResourcesReleased() { -#ifdef HAVE_RESOURCE_POLICY +#if QT_CONFIG(resourcepolicy) #ifdef DEBUG_RESOURCE_POLICY qDebug() << Q_FUNC_INFO; #endif @@ -212,7 +212,7 @@ void CamerabinResourcePolicy::handleResourcesReleased() void CamerabinResourcePolicy::resourcesAvailable() { -#ifdef HAVE_RESOURCE_POLICY +#if QT_CONFIG(resourcepolicy) if (m_resourceSet != NoResources) { m_resource->acquire(); } @@ -228,7 +228,7 @@ void CamerabinResourcePolicy::updateCanCapture() { const bool wasAbleToRecord = m_canCapture; m_canCapture = (m_resourceSet == VideoCaptureResources) || (m_resourceSet == ImageCaptureResources); -#ifdef HAVE_RESOURCE_POLICY +#if QT_CONFIG(resourcepolicy) const auto resources = m_resource->resources(); for (ResourcePolicy::Resource *resource : resources) { if (resource->type() != ResourcePolicy::LensCoverType) diff --git a/src/plugins/gstreamer/camerabin/camerabinservice.cpp b/src/plugins/gstreamer/camerabin/camerabinservice.cpp index 3fbd1a60e..f11cfea6d 100644 --- a/src/plugins/gstreamer/camerabin/camerabinservice.cpp +++ b/src/plugins/gstreamer/camerabin/camerabinservice.cpp @@ -37,6 +37,7 @@ ** ****************************************************************************/ +#include #include "camerabinservice.h" #include "camerabinsession.h" #include "camerabinrecorder.h" @@ -48,7 +49,7 @@ #include "camerabinmetadata.h" #include "camerabininfocontrol.h" -#ifdef HAVE_GST_PHOTOGRAPHY +#if QT_CONFIG(gstreamer_photography) #include "camerabinexposure.h" #include "camerabinflash.h" #include "camerabinfocus.h" @@ -202,7 +203,7 @@ QMediaControl *CameraBinService::requestControl(const char *name) if (qstrcmp(name, QCameraImageCaptureControl_iid) == 0) return m_imageCaptureControl; -#ifdef HAVE_GST_PHOTOGRAPHY +#if QT_CONFIG(gstreamer_photography) if (qstrcmp(name, QCameraExposureControl_iid) == 0) return m_captureSession->cameraExposureControl(); diff --git a/src/plugins/gstreamer/camerabin/camerabinsession.cpp b/src/plugins/gstreamer/camerabin/camerabinsession.cpp index 64c8780d3..b0a11bb44 100644 --- a/src/plugins/gstreamer/camerabin/camerabinsession.cpp +++ b/src/plugins/gstreamer/camerabin/camerabinsession.cpp @@ -36,6 +36,8 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ + +#include #include "camerabinsession.h" #include "camerabincontrol.h" #include "camerabinrecorder.h" @@ -44,7 +46,7 @@ #include "camerabinvideoencoder.h" #include "camerabinimageencoder.h" -#ifdef HAVE_GST_PHOTOGRAPHY +#if QT_CONFIG(gstreamer_photography) #include "camerabinexposure.h" #include "camerabinflash.h" #include "camerabinfocus.h" @@ -63,7 +65,7 @@ #include #include -#ifdef HAVE_GST_PHOTOGRAPHY +#if QT_CONFIG(gstreamer_photography) #include #endif @@ -127,7 +129,7 @@ CameraBinSession::CameraBinSession(GstElementFactory *sourceFactory, QObject *pa m_videoInputFactory(0), m_viewfinder(0), m_viewfinderInterface(0), -#ifdef HAVE_GST_PHOTOGRAPHY +#if QT_CONFIG(gstreamer_photography) m_cameraExposureControl(0), m_cameraFlashControl(0), m_cameraFocusControl(0), @@ -212,7 +214,7 @@ CameraBinSession::~CameraBinSession() gst_object_unref(GST_OBJECT(m_sourceFactory)); } -#ifdef HAVE_GST_PHOTOGRAPHY +#if QT_CONFIG(gstreamer_photography) GstPhotography *CameraBinSession::photography() { if (GST_IS_PHOTOGRAPHY(m_camerabin)) { @@ -807,7 +809,7 @@ void CameraBinSession::start() m_recorderControl->applySettings(); -#ifdef HAVE_GST_ENCODING_PROFILES +#if QT_CONFIG(gstreamer_encodingprofiles) GstEncodingContainerProfile *profile = m_recorderControl->videoProfile(); g_object_set (G_OBJECT(m_camerabin), "video-profile", @@ -952,7 +954,7 @@ bool CameraBinSession::processSyncMessage(const QGstreamerMessage &message) } return true; } -#ifdef HAVE_GST_PHOTOGRAPHY +#if QT_CONFIG(gstreamer_photography) if (gst_structure_has_name(st, GST_PHOTOGRAPHY_AUTOFOCUS_DONE)) m_cameraFocusControl->handleFocusMessage(gm); #endif diff --git a/src/plugins/gstreamer/camerabin/camerabinsession.h b/src/plugins/gstreamer/camerabin/camerabinsession.h index ca0b22761..8966a2ece 100644 --- a/src/plugins/gstreamer/camerabin/camerabinsession.h +++ b/src/plugins/gstreamer/camerabin/camerabinsession.h @@ -40,13 +40,14 @@ #ifndef CAMERABINCAPTURESESSION_H #define CAMERABINCAPTURESESSION_H +#include #include #include #include #include -#ifdef HAVE_GST_PHOTOGRAPHY +#if QT_CONFIG(gstreamer_photography) #include #endif @@ -93,7 +94,7 @@ public: CameraBinSession(GstElementFactory *sourceFactory, QObject *parent); ~CameraBinSession(); -#ifdef HAVE_GST_PHOTOGRAPHY +#if QT_CONFIG(gstreamer_photography) GstPhotography *photography(); #endif GstElement *cameraBin() { return m_camerabin; } @@ -117,7 +118,7 @@ public: CameraBinVideoEncoder *videoEncodeControl() const { return m_videoEncodeControl; } CameraBinImageEncoder *imageEncodeControl() const { return m_imageEncodeControl; } -#ifdef HAVE_GST_PHOTOGRAPHY +#if QT_CONFIG(gstreamer_photography) CameraBinExposure *cameraExposureControl(); CameraBinFlash *cameraFlashControl(); CameraBinFocus *cameraFocusControl(); @@ -238,7 +239,7 @@ private: CameraBinImageEncoder *m_imageEncodeControl; CameraBinRecorder *m_recorderControl; CameraBinContainer *m_mediaContainerControl; -#ifdef HAVE_GST_PHOTOGRAPHY +#if QT_CONFIG(gstreamer_photography) CameraBinExposure *m_cameraExposureControl; CameraBinFlash *m_cameraFlashControl; CameraBinFocus *m_cameraFocusControl; diff --git a/src/plugins/gstreamer/camerabin/camerabinvideoencoder.cpp b/src/plugins/gstreamer/camerabin/camerabinvideoencoder.cpp index 7eb8644b4..86585da9e 100644 --- a/src/plugins/gstreamer/camerabin/camerabinvideoencoder.cpp +++ b/src/plugins/gstreamer/camerabin/camerabinvideoencoder.cpp @@ -37,6 +37,7 @@ ** ****************************************************************************/ +#include #include "camerabinvideoencoder.h" #include "camerabinsession.h" #include "camerabincontainer.h" @@ -49,7 +50,7 @@ QT_BEGIN_NAMESPACE CameraBinVideoEncoder::CameraBinVideoEncoder(CameraBinSession *session) :QVideoEncoderSettingsControl(session) , m_session(session) -#ifdef HAVE_GST_ENCODING_PROFILES +#if QT_CONFIG(gstreamer_encodingprofiles) , m_codecs(QGstCodecsInfo::VideoEncoder) #endif { @@ -89,7 +90,7 @@ QList< qreal > CameraBinVideoEncoder::supportedFrameRates(const QVideoEncoderSet QStringList CameraBinVideoEncoder::supportedVideoCodecs() const { -#ifdef HAVE_GST_ENCODING_PROFILES +#if QT_CONFIG(gstreamer_encodingprofiles) return m_codecs.supportedCodecs(); #else return QStringList(); @@ -98,7 +99,7 @@ QStringList CameraBinVideoEncoder::supportedVideoCodecs() const QString CameraBinVideoEncoder::videoCodecDescription(const QString &codecName) const { -#ifdef HAVE_GST_ENCODING_PROFILES +#if QT_CONFIG(gstreamer_encodingprofiles) return m_codecs.codecDescription(codecName); #else Q_UNUSED(codecName) @@ -167,7 +168,7 @@ QPair CameraBinVideoEncoder::rateAsRational(qreal frameRate) const return QPair(); } -#ifdef HAVE_GST_ENCODING_PROFILES +#if QT_CONFIG(gstreamer_encodingprofiles) GstEncodingProfile *CameraBinVideoEncoder::createProfile() { diff --git a/src/plugins/gstreamer/camerabin/camerabinvideoencoder.h b/src/plugins/gstreamer/camerabin/camerabinvideoencoder.h index 7abcd66d5..922b6f464 100644 --- a/src/plugins/gstreamer/camerabin/camerabinvideoencoder.h +++ b/src/plugins/gstreamer/camerabin/camerabinvideoencoder.h @@ -40,6 +40,7 @@ #ifndef CAMERABINVIDEOENCODE_H #define CAMERABINVIDEOENCODE_H +#include #include #include @@ -49,7 +50,7 @@ #include #include -#ifdef HAVE_GST_ENCODING_PROFILES +#if QT_CONFIG(gstreamer_encodingprofiles) #include #include #endif @@ -83,7 +84,7 @@ public: void setActualVideoSettings(const QVideoEncoderSettings&); void resetActualSettings(); -#ifdef HAVE_GST_ENCODING_PROFILES +#if QT_CONFIG(gstreamer_encodingprofiles) GstEncodingProfile *createProfile(); #endif @@ -95,7 +96,7 @@ Q_SIGNALS: private: CameraBinSession *m_session; -#ifdef HAVE_GST_ENCODING_PROFILES +#if QT_CONFIG(gstreamer_encodingprofiles) QGstCodecsInfo m_codecs; #endif diff --git a/src/plugins/gstreamer/common.pri b/src/plugins/gstreamer/common.pri index 110bc8549..cbe87be4f 100644 --- a/src/plugins/gstreamer/common.pri +++ b/src/plugins/gstreamer/common.pri @@ -9,13 +9,9 @@ LIBS += -lqgsttools_p QMAKE_USE += gstreamer -qtConfig(resourcepolicy) { +qtConfig(resourcepolicy): \ QMAKE_USE += libresourceqt5 - DEFINES += HAVE_RESOURCE_POLICY -} -qtConfig(gstreamer_app) { +qtConfig(gstreamer_app): \ QMAKE_USE += gstreamer_app - DEFINES += HAVE_GST_APPSRC -} diff --git a/src/plugins/gstreamer/mediaplayer/qgstreamerplayercontrol.cpp b/src/plugins/gstreamer/mediaplayer/qgstreamerplayercontrol.cpp index 3e7286e51..54b31627e 100644 --- a/src/plugins/gstreamer/mediaplayer/qgstreamerplayercontrol.cpp +++ b/src/plugins/gstreamer/mediaplayer/qgstreamerplayercontrol.cpp @@ -379,7 +379,7 @@ void QGstreamerPlayerControl::setMedia(const QMediaContent &content, QIODevice * request = content.canonicalRequest(); } -#if !defined(HAVE_GST_APPSRC) +#if !QT_CONFIG(gstreamer_app) m_session->loadFromUri(request); #else if (m_stream) { @@ -397,7 +397,7 @@ void QGstreamerPlayerControl::setMedia(const QMediaContent &content, QIODevice * m_session->loadFromUri(request); #endif -#if defined(HAVE_GST_APPSRC) +#if QT_CONFIG(gstreamer_app) if (!request.url().isEmpty() || userStreamValid) { #else if (!request.url().isEmpty()) { diff --git a/src/plugins/gstreamer/mediaplayer/qgstreamerplayerserviceplugin.cpp b/src/plugins/gstreamer/mediaplayer/qgstreamerplayerserviceplugin.cpp index d7798b1b7..db266a10e 100644 --- a/src/plugins/gstreamer/mediaplayer/qgstreamerplayerserviceplugin.cpp +++ b/src/plugins/gstreamer/mediaplayer/qgstreamerplayerserviceplugin.cpp @@ -37,6 +37,7 @@ ** ****************************************************************************/ +#include #include #include #include @@ -70,7 +71,7 @@ QMediaServiceProviderHint::Features QGstreamerPlayerServicePlugin::supportedFeat { if (service == Q_MEDIASERVICE_MEDIAPLAYER) return -#ifdef HAVE_GST_APPSRC +#if QT_CONFIG(gstreamer_app) QMediaServiceProviderHint::StreamPlayback | #endif QMediaServiceProviderHint::VideoSurface; diff --git a/src/plugins/gstreamer/mediaplayer/qgstreamerplayersession.cpp b/src/plugins/gstreamer/mediaplayer/qgstreamerplayersession.cpp index 76a56aca7..94e818f94 100644 --- a/src/plugins/gstreamer/mediaplayer/qgstreamerplayersession.cpp +++ b/src/plugins/gstreamer/mediaplayer/qgstreamerplayersession.cpp @@ -174,7 +174,7 @@ QGstreamerPlayerSession::QGstreamerPlayerSession(QObject *parent) m_bus(0), m_videoOutput(0), m_renderer(0), -#if defined(HAVE_GST_APPSRC) +#if QT_CONFIG(gstreamer_app) m_appSrc(0), #endif m_videoProbe(0), @@ -287,7 +287,7 @@ QGstreamerPlayerSession::QGstreamerPlayerSession(QObject *parent) g_signal_connect(G_OBJECT(m_playbin), "audio-changed", G_CALLBACK(handleStreamsChange), this); g_signal_connect(G_OBJECT(m_playbin), "text-changed", G_CALLBACK(handleStreamsChange), this); -#if defined(HAVE_GST_APPSRC) +#if QT_CONFIG(gstreamer_app) g_signal_connect(G_OBJECT(m_playbin), "deep-notify::source", G_CALLBACK(configureAppSrcElement), this); #endif } @@ -319,7 +319,7 @@ GstElement *QGstreamerPlayerSession::playbin() const return m_playbin; } -#if defined(HAVE_GST_APPSRC) +#if QT_CONFIG(gstreamer_app) void QGstreamerPlayerSession::configureAppSrcElement(GObject* object, GObject *orig, GParamSpec *pspec, QGstreamerPlayerSession* self) { Q_UNUSED(object); @@ -340,7 +340,7 @@ void QGstreamerPlayerSession::configureAppSrcElement(GObject* object, GObject *o void QGstreamerPlayerSession::loadFromStream(const QNetworkRequest &request, QIODevice *appSrcStream) { -#if defined(HAVE_GST_APPSRC) +#if QT_CONFIG(gstreamer_app) #ifdef DEBUG_PLAYBIN qDebug() << Q_FUNC_INFO; #endif @@ -379,7 +379,7 @@ void QGstreamerPlayerSession::loadFromUri(const QNetworkRequest &request) m_lastPosition = 0; m_isPlaylist = false; -#if defined(HAVE_GST_APPSRC) +#if QT_CONFIG(gstreamer_app) if (m_appSrc) { m_appSrc->deleteLater(); m_appSrc = 0; diff --git a/src/plugins/gstreamer/mediaplayer/qgstreamerplayersession.h b/src/plugins/gstreamer/mediaplayer/qgstreamerplayersession.h index fdfb416bd..90ec60bc9 100644 --- a/src/plugins/gstreamer/mediaplayer/qgstreamerplayersession.h +++ b/src/plugins/gstreamer/mediaplayer/qgstreamerplayersession.h @@ -40,6 +40,7 @@ #ifndef QGSTREAMERPLAYERSESSION_H #define QGSTREAMERPLAYERSESSION_H +#include #include #include #include @@ -49,7 +50,7 @@ #include #include -#if defined(HAVE_GST_APPSRC) +#if QT_CONFIG(gstreamer_app) #include #endif @@ -116,7 +117,7 @@ public: bool processBusMessage(const QGstreamerMessage &message); -#if defined(HAVE_GST_APPSRC) +#if QT_CONFIG(gstreamer_app) QGstAppSrc *appsrc() const { return m_appSrc; } static void configureAppSrcElement(GObject*, GObject*, GParamSpec*,QGstreamerPlayerSession* _this); #endif @@ -218,7 +219,7 @@ private: QObject *m_videoOutput; QGstreamerVideoRendererInterface *m_renderer; -#if defined(HAVE_GST_APPSRC) +#if QT_CONFIG(gstreamer_app) QGstAppSrc *m_appSrc; #endif diff --git a/src/plugins/wmf/player/player.pri b/src/plugins/wmf/player/player.pri index 38ccb82a6..af2f7458b 100644 --- a/src/plugins/wmf/player/player.pri +++ b/src/plugins/wmf/player/player.pri @@ -3,8 +3,6 @@ INCLUDEPATH += $$PWD LIBS += -lgdi32 -luser32 QMAKE_USE += wmf -DEFINES += QMEDIA_MEDIAFOUNDATION_PLAYER - HEADERS += \ $$PWD/mfplayerservice.h \ $$PWD/mfplayersession.h \ diff --git a/src/plugins/wmf/wmfserviceplugin.cpp b/src/plugins/wmf/wmfserviceplugin.cpp index e19154aee..1eeb22428 100644 --- a/src/plugins/wmf/wmfserviceplugin.cpp +++ b/src/plugins/wmf/wmfserviceplugin.cpp @@ -42,7 +42,7 @@ #include #include "wmfserviceplugin.h" -#ifdef QMEDIA_MEDIAFOUNDATION_PLAYER +#if QT_CONFIG(wmf_player) #include "mfplayerservice.h" #endif #include "mfdecoderservice.h" @@ -74,7 +74,7 @@ void releaseRefCount() QMediaService* WMFServicePlugin::create(QString const& key) { -#ifdef QMEDIA_MEDIAFOUNDATION_PLAYER +#if QT_CONFIG(wmf_player) if (key == QLatin1String(Q_MEDIASERVICE_MEDIAPLAYER)) { addRefCount(); return new MFPlayerService; @@ -97,7 +97,7 @@ void WMFServicePlugin::release(QMediaService *service) QMediaServiceProviderHint::Features WMFServicePlugin::supportedFeatures( const QByteArray &service) const { -#ifdef QMEDIA_MEDIAFOUNDATION_PLAYER +#if QT_CONFIG(wmf_player) if (service == Q_MEDIASERVICE_MEDIAPLAYER) return QMediaServiceProviderHint::StreamPlayback; else diff --git a/src/plugins/wmf/wmfserviceplugin.h b/src/plugins/wmf/wmfserviceplugin.h index 39b7b86d9..826ca1d26 100644 --- a/src/plugins/wmf/wmfserviceplugin.h +++ b/src/plugins/wmf/wmfserviceplugin.h @@ -40,6 +40,7 @@ #ifndef WMFSERVICEPLUGIN_H #define WMFSERVICEPLUGIN_H +#include #include "qmediaserviceproviderplugin.h" QT_USE_NAMESPACE @@ -54,7 +55,7 @@ class WMFServicePlugin Q_INTERFACES(QMediaServiceSupportedDevicesInterface) Q_INTERFACES(QMediaServiceDefaultDeviceInterface) Q_INTERFACES(QMediaServiceFeaturesInterface) -#ifdef QMEDIA_MEDIAFOUNDATION_PLAYER +#if QT_CONFIG(wmf_player) Q_PLUGIN_METADATA(IID "org.qt-project.qt.mediaserviceproviderfactory/5.0" FILE "wmf.json") #else Q_PLUGIN_METADATA(IID "org.qt-project.qt.mediaserviceproviderfactory/5.0" FILE "wmf_audiodecode.json") -- cgit v1.2.3 From 0999794030eb61c469f183f7ceb5d51ce579c42e Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Thu, 2 Mar 2017 11:58:53 +0100 Subject: Drop unused QProcess include Change-Id: I2edc0a1a41d63a456ef2e87bdd1d0872dff0aee1 Reviewed-by: Yoann Lopes --- src/plugins/gstreamer/camerabin/camerabinservice.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/plugins/gstreamer/camerabin/camerabinservice.cpp b/src/plugins/gstreamer/camerabin/camerabinservice.cpp index f11cfea6d..a68ecfdbe 100644 --- a/src/plugins/gstreamer/camerabin/camerabinservice.cpp +++ b/src/plugins/gstreamer/camerabin/camerabinservice.cpp @@ -77,7 +77,6 @@ #include #include -#include QT_BEGIN_NAMESPACE -- cgit v1.2.3 From 79787d53e2b5d5781e46addef9f14dddb6e67237 Mon Sep 17 00:00:00 2001 From: Jason Erb Date: Fri, 10 Feb 2017 12:34:38 -0500 Subject: Clean up some strange GL defines in windowgrabber.h Change-Id: I1d332537b80e165fa794e433fb205f86ed24b209 Reviewed-by: Fabian Bumberger Reviewed-by: Dan Cape Reviewed-by: James McDonnell --- src/plugins/qnx/common/windowgrabber.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/qnx/common/windowgrabber.h b/src/plugins/qnx/common/windowgrabber.h index b2d43a27b..4278f2e3a 100644 --- a/src/plugins/qnx/common/windowgrabber.h +++ b/src/plugins/qnx/common/windowgrabber.h @@ -39,8 +39,8 @@ #ifndef WINDOWGRABBER_H #define WINDOWGRABBER_H -#define EGL_EGLEXT_PROTOTYPES = 1 -#define GL_GLEXT_PROTOTYPES = 1 +#define EGL_EGLEXT_PROTOTYPES +#define GL_GLEXT_PROTOTYPES #include #include #include -- cgit v1.2.3 From 6f7192a048432e4792330244b74a2a39ccd8d515 Mon Sep 17 00:00:00 2001 From: Daiwei Li Date: Wed, 9 Jul 2014 14:51:34 -0700 Subject: Fix test build when bearer management is disabled Task-number: QTBUG-59263 Change-Id: I282c9eadf7ad0f8e49eb6f37ba3359ad511e595d Reviewed-by: Daiwei Li Reviewed-by: Yoann Lopes --- tests/auto/unit/qmediaplayer/tst_qmediaplayer.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/auto/unit/qmediaplayer/tst_qmediaplayer.cpp b/tests/auto/unit/qmediaplayer/tst_qmediaplayer.cpp index 3f13c4267..a529517d3 100644 --- a/tests/auto/unit/qmediaplayer/tst_qmediaplayer.cpp +++ b/tests/auto/unit/qmediaplayer/tst_qmediaplayer.cpp @@ -118,7 +118,9 @@ private slots: void testMediaStatus_data(); void testMediaStatus(); void testPlaylist(); +#ifndef QT_NO_BEARERMANAGEMENT void testNetworkAccess(); +#endif void testSetVideoOutput(); void testSetVideoOutputNoService(); void testSetVideoOutputNoControl(); @@ -1063,6 +1065,7 @@ void tst_QMediaPlayer::testDestructor() mockProvider->deleteServiceOnRelease = false; } +#ifndef QT_NO_BEARERMANAGEMENT void tst_QMediaPlayer::testNetworkAccess() { QNetworkConfigurationManager manager; @@ -1090,6 +1093,7 @@ void tst_QMediaPlayer::testNetworkAccess() QVERIFY(config.isValid() == false); QVERIFY(player->currentNetworkConfiguration().isValid() == false); } +#endif void tst_QMediaPlayer::testSetVideoOutput() { -- cgit v1.2.3