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