diff options
author | Liang Qi <liang.qi@qt.io> | 2017-03-21 09:29:56 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2017-03-21 09:29:56 +0100 |
commit | 91c405b5d41232f30fdc3dfd432b057849a26734 (patch) | |
tree | 846932733dec3af5b7361fa237dde30fdb7a9688 /src/plugins/gstreamer/camerabin/camerabinimageprocessing.cpp | |
parent | e26e0edd0c3a0e6120008c8a146d8514163930c4 (diff) | |
parent | 086e0b70ac69987441481055a935c31fe89d03f4 (diff) | |
download | qtmultimedia-91c405b5d41232f30fdc3dfd432b057849a26734.tar.gz |
Merge remote-tracking branch 'origin/5.9' into dev
Change-Id: Ifd122e78933870e39e0e79d78930931d8ce10dba
Diffstat (limited to 'src/plugins/gstreamer/camerabin/camerabinimageprocessing.cpp')
-rw-r--r-- | src/plugins/gstreamer/camerabin/camerabinimageprocessing.cpp | 51 |
1 files changed, 26 insertions, 25 deletions
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) |