diff options
author | Yoann Lopes <yoann.lopes@theqtcompany.com> | 2015-07-13 09:45:25 +0200 |
---|---|---|
committer | Yoann Lopes <yoann.lopes@theqtcompany.com> | 2015-07-14 12:30:23 +0000 |
commit | bcdac5539d1cb0ed04ff568a236aeb1c105156ce (patch) | |
tree | edb67d3066382d6253808eb47178aa656c5697e1 | |
parent | 5f11c33fd54bfdc51e918d8976ee0405e8835481 (diff) |
GStreamer: fix supported values returned by CameraBinImageProcessing.
Change-Id: I5a4db9c055495714943421742dd237b6abf7daee
Reviewed-by: Andrew den Exter <andrew.den.exter@qinetic.com.au>
-rw-r--r-- | src/plugins/gstreamer/camerabin/camerabinimageprocessing.cpp | 33 |
1 files changed, 22 insertions, 11 deletions
diff --git a/src/plugins/gstreamer/camerabin/camerabinimageprocessing.cpp b/src/plugins/gstreamer/camerabin/camerabinimageprocessing.cpp index 74f34655f..633662c70 100644 --- a/src/plugins/gstreamer/camerabin/camerabinimageprocessing.cpp +++ b/src/plugins/gstreamer/camerabin/camerabinimageprocessing.cpp @@ -48,13 +48,15 @@ CameraBinImageProcessing::CameraBinImageProcessing(CameraBinSession *session) m_whiteBalanceMode(QCameraImageProcessing::WhiteBalanceAuto) { #ifdef HAVE_GST_PHOTOGRAPHY - m_mappedWbValues[GST_PHOTOGRAPHY_WB_MODE_AUTO] = QCameraImageProcessing::WhiteBalanceAuto; - m_mappedWbValues[GST_PHOTOGRAPHY_WB_MODE_DAYLIGHT] = QCameraImageProcessing::WhiteBalanceSunlight; - m_mappedWbValues[GST_PHOTOGRAPHY_WB_MODE_CLOUDY] = QCameraImageProcessing::WhiteBalanceCloudy; - m_mappedWbValues[GST_PHOTOGRAPHY_WB_MODE_SUNSET] = QCameraImageProcessing::WhiteBalanceSunset; - m_mappedWbValues[GST_PHOTOGRAPHY_WB_MODE_TUNGSTEN] = QCameraImageProcessing::WhiteBalanceTungsten; - m_mappedWbValues[GST_PHOTOGRAPHY_WB_MODE_FLUORESCENT] = QCameraImageProcessing::WhiteBalanceFluorescent; - unlockWhiteBalance(); + if (m_session->photography()) { + m_mappedWbValues[GST_PHOTOGRAPHY_WB_MODE_AUTO] = QCameraImageProcessing::WhiteBalanceAuto; + m_mappedWbValues[GST_PHOTOGRAPHY_WB_MODE_DAYLIGHT] = QCameraImageProcessing::WhiteBalanceSunlight; + m_mappedWbValues[GST_PHOTOGRAPHY_WB_MODE_CLOUDY] = QCameraImageProcessing::WhiteBalanceCloudy; + m_mappedWbValues[GST_PHOTOGRAPHY_WB_MODE_SUNSET] = QCameraImageProcessing::WhiteBalanceSunset; + m_mappedWbValues[GST_PHOTOGRAPHY_WB_MODE_TUNGSTEN] = QCameraImageProcessing::WhiteBalanceTungsten; + m_mappedWbValues[GST_PHOTOGRAPHY_WB_MODE_FLUORESCENT] = QCameraImageProcessing::WhiteBalanceFluorescent; + unlockWhiteBalance(); + } #if GST_CHECK_VERSION(1, 0, 0) m_filterMap.insert(QCameraImageProcessing::ColorFilterNone, GST_PHOTOGRAPHY_COLOR_TONE_MODE_NORMAL); @@ -188,10 +190,19 @@ bool CameraBinImageProcessing::isWhiteBalanceModeSupported(QCameraImageProcessin bool CameraBinImageProcessing::isParameterSupported(QCameraImageProcessingControl::ProcessingParameter parameter) const { - return parameter == QCameraImageProcessingControl::Contrast +#ifdef HAVE_GST_PHOTOGRAPHY + if (parameter == QCameraImageProcessingControl::WhiteBalancePreset + || parameter == QCameraImageProcessingControl::ColorFilter) + return m_session->photography(); +#endif + + if (parameter == QCameraImageProcessingControl::Contrast || parameter == QCameraImageProcessingControl::Brightness - || parameter == QCameraImageProcessingControl::Saturation - || parameter == QCameraImageProcessingControl::WhiteBalancePreset; + || parameter == QCameraImageProcessingControl::Saturation) { + return GST_IS_COLOR_BALANCE(m_session->cameraBin()); + } + + return false; } bool CameraBinImageProcessing::isParameterValueSupported(QCameraImageProcessingControl::ProcessingParameter parameter, const QVariant &value) const @@ -200,7 +211,7 @@ bool CameraBinImageProcessing::isParameterValueSupported(QCameraImageProcessingC case ContrastAdjustment: case BrightnessAdjustment: case SaturationAdjustment: - return qAbs(value.toReal()) <= 1.0; + return GST_IS_COLOR_BALANCE(m_session->cameraBin()) && qAbs(value.toReal()) <= 1.0; case WhiteBalancePreset: return isWhiteBalanceModeSupported(value.value<QCameraImageProcessing::WhiteBalanceMode>()); case ColorFilter: { |