summaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2017-03-10 10:27:27 +0100
committerLiang Qi <liang.qi@qt.io>2017-03-10 10:51:09 +0100
commite964e89331f2cfef99a3f63172a127b6c02a9727 (patch)
tree4c7d78573d17e523e4278027cee8fa88494366c8 /src/plugins
parentf09d36708fdab70ad51af374a65ddded64525f67 (diff)
parent6f7192a048432e4792330244b74a2a39ccd8d515 (diff)
downloadqtmultimedia-e964e89331f2cfef99a3f63172a127b6c02a9727.tar.gz
Merge remote-tracking branch 'origin/5.8' into 5.9
Conflicts: src/plugins/gstreamer/camerabin/camerabincontainer.h Change-Id: I4942d41d69112335fe0c994002f1b32ef3aad051
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/avfoundation/camera/camera.pro2
-rw-r--r--src/plugins/avfoundation/mediaplayer/mediaplayer.pro2
-rw-r--r--src/plugins/directshow/camera/camera.pri4
-rw-r--r--src/plugins/directshow/directshow.pro4
-rw-r--r--src/plugins/directshow/dsserviceplugin.cpp20
-rw-r--r--src/plugins/directshow/dsserviceplugin.h3
-rw-r--r--src/plugins/directshow/player/directshowmetadatacontrol.cpp14
-rw-r--r--src/plugins/directshow/player/directshowplayerservice.cpp16
-rw-r--r--src/plugins/directshow/player/directshowvideorenderercontrol.cpp11
-rw-r--r--src/plugins/directshow/player/directshowvideorenderercontrol.h7
-rw-r--r--src/plugins/directshow/player/player.pri9
-rw-r--r--src/plugins/gstreamer/audiodecoder/qgstreameraudiodecodersession.cpp12
-rw-r--r--src/plugins/gstreamer/audiodecoder/qgstreameraudiodecodersession.h7
-rw-r--r--src/plugins/gstreamer/camerabin/camerabin.pro8
-rw-r--r--src/plugins/gstreamer/camerabin/camerabinaudioencoder.cpp9
-rw-r--r--src/plugins/gstreamer/camerabin/camerabinaudioencoder.h7
-rw-r--r--src/plugins/gstreamer/camerabin/camerabincontainer.cpp13
-rw-r--r--src/plugins/gstreamer/camerabin/camerabincontainer.h7
-rw-r--r--src/plugins/gstreamer/camerabin/camerabincontrol.cpp1
-rw-r--r--src/plugins/gstreamer/camerabin/camerabinimageprocessing.cpp51
-rw-r--r--src/plugins/gstreamer/camerabin/camerabinimageprocessing.h11
-rw-r--r--src/plugins/gstreamer/camerabin/camerabinrecorder.cpp4
-rw-r--r--src/plugins/gstreamer/camerabin/camerabinrecorder.h5
-rw-r--r--src/plugins/gstreamer/camerabin/camerabinresourcepolicy.cpp18
-rw-r--r--src/plugins/gstreamer/camerabin/camerabinservice.cpp6
-rw-r--r--src/plugins/gstreamer/camerabin/camerabinsession.cpp14
-rw-r--r--src/plugins/gstreamer/camerabin/camerabinsession.h9
-rw-r--r--src/plugins/gstreamer/camerabin/camerabinvideoencoder.cpp9
-rw-r--r--src/plugins/gstreamer/camerabin/camerabinvideoencoder.h7
-rw-r--r--src/plugins/gstreamer/common.pri8
-rw-r--r--src/plugins/gstreamer/mediaplayer/qgstreamerplayercontrol.cpp4
-rw-r--r--src/plugins/gstreamer/mediaplayer/qgstreamerplayerserviceplugin.cpp3
-rw-r--r--src/plugins/gstreamer/mediaplayer/qgstreamerplayersession.cpp10
-rw-r--r--src/plugins/gstreamer/mediaplayer/qgstreamerplayersession.h7
-rw-r--r--src/plugins/plugins.pro2
-rw-r--r--src/plugins/qnx/common/windowgrabber.h4
-rw-r--r--src/plugins/wmf/player/player.pri2
-rw-r--r--src/plugins/wmf/sourceresolver.cpp6
-rw-r--r--src/plugins/wmf/sourceresolver.h2
-rw-r--r--src/plugins/wmf/wmf.pro2
-rw-r--r--src/plugins/wmf/wmfserviceplugin.cpp6
-rw-r--r--src/plugins/wmf/wmfserviceplugin.h3
42 files changed, 165 insertions, 184 deletions
diff --git a/src/plugins/avfoundation/camera/camera.pro b/src/plugins/avfoundation/camera/camera.pro
index bd7b1fc97..4b960ed5a 100644
--- a/src/plugins/avfoundation/camera/camera.pro
+++ b/src/plugins/avfoundation/camera/camera.pro
@@ -20,8 +20,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 fb7fbd3f5..d8ee59aa9 100644
--- a/src/plugins/directshow/camera/camera.pri
+++ b/src/plugins/directshow/camera/camera.pri
@@ -1,9 +1,5 @@
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 cbf82afb3..35301474f 100644
--- a/src/plugins/directshow/directshow.pro
+++ b/src/plugins/directshow/directshow.pro
@@ -8,13 +8,11 @@ win32:!qtHaveModule(opengl)|qtConfig(dynamicgl) {
HEADERS += dsserviceplugin.h
SOURCES += dsserviceplugin.cpp
-!qtConfig(wmsdk): DEFINES += QT_NO_WMSDK
-
mingw: DEFINES += NO_DSHOW_STRSAFE
include(common/common.pri)
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/directshow/dsserviceplugin.cpp b/src/plugins/directshow/dsserviceplugin.cpp
index 4b84841bd..9060bac7c 100644
--- a/src/plugins/directshow/dsserviceplugin.cpp
+++ b/src/plugins/directshow/dsserviceplugin.cpp
@@ -37,6 +37,7 @@
**
****************************************************************************/
+#include <QtMultimedia/private/qtmultimediaglobal_p.h>
#include <dshow.h>
#include <QtCore/qstring.h>
@@ -46,21 +47,16 @@
#include "directshowglobal.h"
#include "dsserviceplugin.h"
-#ifdef QMEDIA_DIRECTSHOW_CAMERA
#include "dsvideodevicecontrol.h"
#include <dshow.h>
#include "dscameraservice.h"
-#endif
-#ifdef QMEDIA_DIRECTSHOW_PLAYER
+#if QT_CONFIG(directshow_player)
#include "directshowplayerservice.h"
#endif
#include <qmediaserviceproviderplugin.h>
-
-#ifdef QMEDIA_DIRECTSHOW_CAMERA
-
extern const CLSID CLSID_VideoInputDeviceCategory;
@@ -76,7 +72,6 @@ extern const CLSID CLSID_VideoInputDeviceCategory;
#endif // Q_CC_MSVC
#include <windows.h>
#include <ocidl.h>
-#endif
QT_BEGIN_NAMESPACE
Q_LOGGING_CATEGORY(qtDirectShowPlugin, "qt.multimedia.plugins.directshow")
@@ -99,13 +94,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;
@@ -132,14 +125,11 @@ QMediaServiceProviderHint::Features DSServicePlugin::supportedFeatures(
QByteArray DSServicePlugin::defaultDevice(const QByteArray &service) const
{
-#ifdef QMEDIA_DIRECTSHOW_CAMERA
if (service == Q_MEDIASERVICE_CAMERA) {
const QList<DSVideoDeviceInfo> &devs = DSVideoDeviceControl::availableDevices();
if (!devs.isEmpty())
return devs.first().first;
}
-#endif
-
return QByteArray();
}
@@ -147,20 +137,17 @@ QList<QByteArray> DSServicePlugin::devices(const QByteArray &service) const
{
QList<QByteArray> result;
-#ifdef QMEDIA_DIRECTSHOW_CAMERA
if (service == Q_MEDIASERVICE_CAMERA) {
const QList<DSVideoDeviceInfo> &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<DSVideoDeviceInfo> &devs = DSVideoDeviceControl::availableDevices();
for (const DSVideoDeviceInfo &info : devs) {
@@ -168,6 +155,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 <QtMultimedia/private/qtmultimediaglobal_p.h>
#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 6a88d76a9..45d3a958b 100644
--- a/src/plugins/directshow/player/directshowmetadatacontrol.cpp
+++ b/src/plugins/directshow/player/directshowmetadatacontrol.cpp
@@ -57,11 +57,13 @@
#include "directshowmetadatacontrol.h"
#include "directshowplayerservice.h"
-#ifndef QT_NO_WMSDK
+#include <QtMultimedia/private/qtmultimedia-config_p.h>
+
+#if QT_CONFIG(wmsdk)
#include <wmsdk.h>
#endif
-#ifndef QT_NO_SHELLITEM
+#if QT_CONFIG(wshellitem)
#include <ShlObj.h>
#include <propkeydef.h>
#include <private/qsystemlibrary_p.h>
@@ -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
{
@@ -290,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;
@@ -390,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"));
@@ -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<IWMHeaderInfo>(source, IID_IWMHeaderInfo);
if (info) {
diff --git a/src/plugins/directshow/player/directshowplayerservice.cpp b/src/plugins/directshow/player/directshowplayerservice.cpp
index 0b88496af..5fbb6ef05 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 <wmsdk.h>
-#endif
-
#include "qmediacontent.h"
+#include <QtMultimedia/private/qtmultimedia-config_p.h>
+
#include <QtCore/qcoreapplication.h>
#include <QtCore/qdatetime.h>
#include <QtCore/qdir.h>
#include <QtCore/qthread.h>
#include <QtCore/qvarlengtharray.h>
+#if QT_CONFIG(wmsdk)
+# include <wmsdk.h>
+#endif
+
#ifndef Q_CC_MINGW
# include <comdef.h>
#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<QMutex *>(&m_mutex));
if (IWMReaderAdvanced2 *reader = com_cast<IWMReaderAdvanced2>(
diff --git a/src/plugins/directshow/player/directshowvideorenderercontrol.cpp b/src/plugins/directshow/player/directshowvideorenderercontrol.cpp
index b86125df9..40f77e899 100644
--- a/src/plugins/directshow/player/directshowvideorenderercontrol.cpp
+++ b/src/plugins/directshow/player/directshowvideorenderercontrol.cpp
@@ -37,11 +37,12 @@
**
****************************************************************************/
+#include <QtMultimedia/private/qtmultimediaglobal_p.h>
#include "directshowvideorenderercontrol.h"
#include "videosurfacefilter.h"
-#ifdef HAVE_EVR
+#if QT_CONFIG(evr)
#include "evrcustompresenter.h"
#endif
@@ -52,7 +53,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 +61,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 +81,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 +97,7 @@ void DirectShowVideoRendererControl::setSurface(QAbstractVideoSurface *surface)
m_surface = surface;
if (m_surface) {
-#ifdef HAVE_EVR
+#if QT_CONFIG(evr)
m_filter = com_new<IBaseFilter>(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..36c5b2248 100644
--- a/src/plugins/directshow/player/directshowvideorenderercontrol.h
+++ b/src/plugins/directshow/player/directshowvideorenderercontrol.h
@@ -40,12 +40,15 @@
#ifndef DIRECTSHOWVIDEORENDERERCONTROL_H
#define DIRECTSHOWVIDEORENDERERCONTROL_H
+#include <QtMultimedia/private/qtmultimediaglobal_p.h>
#include <dshow.h>
#include "qvideorenderercontrol.h"
+#include <QtMultimedia/private/qtmultimedia-config_p.h>
+
class DirectShowEventLoop;
-#ifdef HAVE_EVR
+#if QT_CONFIG(evr)
class EVRCustomPresenter;
#endif
@@ -70,7 +73,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..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 \
@@ -30,8 +28,6 @@ SOURCES += \
$$PWD/vmr9videowindowcontrol.cpp
qtConfig(evr) {
- DEFINES += HAVE_EVR
-
include($$PWD/../../common/evr.pri)
HEADERS += \
@@ -41,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 8038d6a25..385908cbd 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 <QtMultimedia/private/qtmultimediaglobal_p.h>
#include <QObject>
#include <QtCore/qmutex.h>
#include "qgstreameraudiodecodercontrol.h"
#include <private/qgstreamerbushelper_p.h>
#include "qaudiodecoder.h"
-#if defined(HAVE_GST_APPSRC)
+#if QT_CONFIG(gstreamer_app)
#include <private/qgstappsrc_p.h>
#endif
@@ -75,7 +76,7 @@ public:
bool processBusMessage(const QGstreamerMessage &message) override;
-#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 <QtMultimedia/private/qtmultimediaglobal_p.h>
#include "camerabinaudioencoder.h"
#include "camerabincontainer.h"
#include <private/qgstutils_p.h>
@@ -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 7178a6b09..b8091c8ca 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 <QtMultimedia/private/qtmultimediaglobal_p.h>
#include <qaudioencodersettingscontrol.h>
#include <QtCore/qstringlist.h>
@@ -49,7 +50,7 @@
#include <gst/gst.h>
#include <gst/pbutils/pbutils.h>
-#ifdef HAVE_GST_ENCODING_PROFILES
+#if QT_CONFIG(gstreamer_encodingprofiles)
#include <gst/pbutils/encoding-profile.h>
#include <private/qgstcodecsinfo_p.h>
#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 e424f92a1..0fc51611e 100644
--- a/src/plugins/gstreamer/camerabin/camerabincontainer.cpp
+++ b/src/plugins/gstreamer/camerabin/camerabincontainer.cpp
@@ -37,6 +37,7 @@
**
****************************************************************************/
+#include <QtMultimedia/private/qtmultimediaglobal_p.h>
#include "camerabincontainer.h"
#include <QtCore/qregexp.h>
#include <private/qgstutils_p.h>
@@ -47,7 +48,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
{
@@ -55,7 +56,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();
@@ -64,7 +65,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)
@@ -79,7 +80,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;
@@ -95,7 +96,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
}
@@ -105,7 +106,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 b9b7f1214..738e55e2a 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 <QtMultimedia/private/qtmultimediaglobal_p.h>
#include <qmediacontainercontrol.h>
#include <QtCore/qstringlist.h>
#include <QtCore/qset.h>
@@ -48,7 +49,7 @@
#include <gst/gst.h>
#include <gst/pbutils/pbutils.h>
-#ifdef HAVE_GST_ENCODING_PROFILES
+#if QT_CONFIG(gstreamer_encodingprofiles)
#include <gst/pbutils/encoding-profile.h>
#include <private/qgstcodecsinfo_p.h>
#endif
@@ -72,7 +73,7 @@ public:
void setActualContainerFormat(const QString &containerFormat);
void resetActualContainerFormat();
-#ifdef HAVE_GST_ENCODING_PROFILES
+#if QT_CONFIG(gstreamer_encodingprofiles)
GstEncodingContainerProfile *createProfile();
#endif
@@ -83,7 +84,7 @@ private:
QString m_format;
QString m_actualFormat;
-#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 <QtMultimedia/private/qtmultimediaglobal_p.h>
#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 <QtMultimedia/private/qtmultimediaglobal_p.h>
#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<QCameraImageProcessing::WhiteBalanceMode>();
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<QCameraImageProcessing::ColorFilter>();
-#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<QCameraImageProcessing::WhiteBalanceMode>(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<QCameraImageProcessing::WhiteBalanceMode>())) {
-#ifdef USE_V4L
+#if QT_CONFIG(linux_v4l)
const QCameraImageProcessing::WhiteBalanceMode mode =
value.value<QCameraImageProcessing::WhiteBalanceMode>();
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 3021f6e9f..259138e91 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 <QtMultimedia/private/qtmultimediaglobal_p.h>
#include <qcamera.h>
#include <qcameraimageprocessingcontrol.h>
#include <gst/gst.h>
#include <glib.h>
-#ifdef HAVE_GST_PHOTOGRAPHY
+#if QT_CONFIG(gstreamer_photography)
# include <gst/interfaces/photography.h>
# 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 override;
void setParameter(ProcessingParameter parameter, const QVariant &value) override;
-#ifdef HAVE_GST_PHOTOGRAPHY
+#if QT_CONFIG(gstreamer_photography)
void lockWhiteBalance();
void unlockWhiteBalance();
#endif
@@ -91,13 +92,13 @@ private:
private:
CameraBinSession *m_session;
QMap<QCameraImageProcessingControl::ProcessingParameter, int> m_values;
-#ifdef HAVE_GST_PHOTOGRAPHY
+#if QT_CONFIG(gstreamer_photography)
QMap<GstPhotographyWhiteBalanceMode, QCameraImageProcessing::WhiteBalanceMode> m_mappedWbValues;
QMap<QCameraImageProcessing::ColorFilter, GstPhotographyColorToneMode> 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 9392f69a5..8bd922fb8 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 <QtMultimedia/private/qtmultimediaglobal_p.h>
#include <qmediarecordercontrol.h>
#include "camerabinsession.h"
-#ifdef HAVE_GST_ENCODING_PROFILES
+#if QT_CONFIG(gstreamer_encodingprofiles)
#include <gst/pbutils/encoding-profile.h>
#endif
@@ -71,7 +72,7 @@ public:
void applySettings() override;
-#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 <QtCore/qdebug.h>
#include <QtCore/qset.h>
-#ifdef HAVE_RESOURCE_POLICY
+#if QT_CONFIG(resourcepolicy)
#include <policy/resource.h>
#include <policy/resources.h>
#include <policy/resource-set.h>
@@ -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<ResourcePolicy::ResourceType> 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..a68ecfdbe 100644
--- a/src/plugins/gstreamer/camerabin/camerabinservice.cpp
+++ b/src/plugins/gstreamer/camerabin/camerabinservice.cpp
@@ -37,6 +37,7 @@
**
****************************************************************************/
+#include <QtMultimedia/private/qtmultimediaglobal_p.h>
#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"
@@ -76,7 +77,6 @@
#include <private/qmediaserviceprovider_p.h>
#include <QtCore/qdebug.h>
-#include <QtCore/qprocess.h>
QT_BEGIN_NAMESPACE
@@ -202,7 +202,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 1e075f58d..ab0bea24a 100644
--- a/src/plugins/gstreamer/camerabin/camerabinsession.cpp
+++ b/src/plugins/gstreamer/camerabin/camerabinsession.cpp
@@ -36,6 +36,8 @@
** $QT_END_LICENSE$
**
****************************************************************************/
+
+#include <QtMultimedia/private/qtmultimediaglobal_p.h>
#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 <qmediarecorder.h>
#include <qvideosurfaceformat.h>
-#ifdef HAVE_GST_PHOTOGRAPHY
+#if QT_CONFIG(gstreamer_photography)
#include <gst/interfaces/photography.h>
#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 0d66d9ee1..d5c2d7822 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 <QtMultimedia/private/qtmultimediaglobal_p.h>
#include <qmediarecordercontrol.h>
#include <QtCore/qurl.h>
#include <QtCore/qdir.h>
#include <gst/gst.h>
-#ifdef HAVE_GST_PHOTOGRAPHY
+#if QT_CONFIG(gstreamer_photography)
#include <gst/interfaces/photography.h>
#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 <QtMultimedia/private/qtmultimediaglobal_p.h>
#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<int,int> CameraBinVideoEncoder::rateAsRational(qreal frameRate) const
return QPair<int,int>();
}
-#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 9eb931dbb..24013ceab 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 <QtMultimedia/private/qtmultimediaglobal_p.h>
#include <qvideoencodersettingscontrol.h>
#include <QtCore/qstringlist.h>
@@ -49,7 +50,7 @@
#include <gst/gst.h>
#include <gst/pbutils/pbutils.h>
-#ifdef HAVE_GST_ENCODING_PROFILES
+#if QT_CONFIG(gstreamer_encodingprofiles)
#include <gst/pbutils/encoding-profile.h>
#include <private/qgstcodecsinfo_p.h>
#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 <QtMultimedia/private/qtmultimediaglobal_p.h>
#include <QtCore/qstring.h>
#include <QtCore/qdebug.h>
#include <QtCore/QDir>
@@ -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 f71332f35..cf2ec6262 100644
--- a/src/plugins/gstreamer/mediaplayer/qgstreamerplayersession.cpp
+++ b/src/plugins/gstreamer/mediaplayer/qgstreamerplayersession.cpp
@@ -126,7 +126,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),
@@ -237,7 +237,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
}
@@ -267,7 +267,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);
@@ -288,7 +288,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
@@ -325,7 +325,7 @@ void QGstreamerPlayerSession::loadFromUri(const QNetworkRequest &request)
m_duration = -1;
m_lastPosition = 0;
-#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 14ef6070f..7f46e8f41 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 <QtMultimedia/private/qtmultimediaglobal_p.h>
#include <QObject>
#include <QtCore/qmutex.h>
#include <QtNetwork/qnetworkrequest.h>
@@ -49,7 +50,7 @@
#include <qmediastreamscontrol.h>
#include <qaudioformat.h>
-#if defined(HAVE_GST_APPSRC)
+#if QT_CONFIG(gstreamer_app)
#include <private/qgstappsrc_p.h>
#endif
@@ -116,7 +117,7 @@ public:
bool processBusMessage(const QGstreamerMessage &message) override;
-#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
@@ -216,7 +217,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/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/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 <EGL/egl.h>
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
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/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<LPCWSTR>(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();
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 += \
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 <QtCore/QFile>
#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 <QtMultimedia/private/qtmultimediaglobal_p.h>
#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")