void QAndroidCameraFlashControl::setFlashMode(QCameraExposure::FlashModes mode) { if (m_flashMode == mode || !m_session->camera() || !isFlashModeSupported(mode)) return; // if torch was enabled, it first needs to be turned off before setting another mode if (m_flashMode == QCameraExposure::FlashVideoLight) m_session->camera()->setFlashMode(QLatin1String("off")); m_flashMode = mode; QString flashMode; if (mode.testFlag(QCameraExposure::FlashAuto)) flashMode = QLatin1String("auto"); else if (mode.testFlag(QCameraExposure::FlashOn)) flashMode = QLatin1String("on"); else if (mode.testFlag(QCameraExposure::FlashRedEyeReduction)) flashMode = QLatin1String("red-eye"); else if (mode.testFlag(QCameraExposure::FlashVideoLight)) flashMode = QLatin1String("torch"); else // FlashOff flashMode = QLatin1String("off"); m_session->camera()->setFlashMode(flashMode); }
void S60CameraFlashControl::setFlashMode(QCameraExposure::FlashModes mode) { if (isFlashModeSupported(mode)) m_session->settings()->setFlashMode(mode); else m_session->setError(KErrNotSupported, tr("Requested flash mode is not supported.")); }