Add additional exposure modes to QCameraExposure.
[ChangeLog][GStreamer][Android] Camera exposure mode extended to support Action, Landscape, NightPortrait, Theatre, Sunset, SteadyPhoto, Fireworks, Party, Candlelight, and Barcode modes. Change-Id: I13d4bb042d27c0bd2ffcd369882b56bbabc84335 Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
This commit is contained in:
committed by
Yoann Lopes
parent
25ad679c25
commit
4bdf1561f4
@@ -191,6 +191,16 @@ public:
|
|||||||
ExposureBeach = QCameraExposure::ExposureBeach,
|
ExposureBeach = QCameraExposure::ExposureBeach,
|
||||||
ExposureLargeAperture = QCameraExposure::ExposureLargeAperture,
|
ExposureLargeAperture = QCameraExposure::ExposureLargeAperture,
|
||||||
ExposureSmallAperture = QCameraExposure::ExposureSmallAperture,
|
ExposureSmallAperture = QCameraExposure::ExposureSmallAperture,
|
||||||
|
ExposureAction = QCameraExposure::ExposureAction,
|
||||||
|
ExposureLandscape = QCameraExposure::ExposureLandscape,
|
||||||
|
ExposureNightPortrait = QCameraExposure::ExposureNightPortrait,
|
||||||
|
ExposureTheatre = QCameraExposure::ExposureTheatre,
|
||||||
|
ExposureSunset = QCameraExposure::ExposureSunset,
|
||||||
|
ExposureSteadyPhoto = QCameraExposure::ExposureSteadyPhoto,
|
||||||
|
ExposureFireworks = QCameraExposure::ExposureFireworks,
|
||||||
|
ExposureParty = QCameraExposure::ExposureParty,
|
||||||
|
ExposureCandlelight = QCameraExposure::ExposureCandlelight,
|
||||||
|
ExposureBarcode = QCameraExposure::ExposureBarcode,
|
||||||
ExposureModeVendor = QCameraExposure::ExposureModeVendor
|
ExposureModeVendor = QCameraExposure::ExposureModeVendor
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -341,6 +341,16 @@ void QDeclarativeCameraExposure::setAutoIsoSensitivity()
|
|||||||
\row \li Camera.ExposureLargeAperture \li Use larger aperture with small depth of field.
|
\row \li Camera.ExposureLargeAperture \li Use larger aperture with small depth of field.
|
||||||
\row \li Camera.ExposureSmallAperture \li Use smaller aperture.
|
\row \li Camera.ExposureSmallAperture \li Use smaller aperture.
|
||||||
\row \li Camera.ExposurePortrait \li Portrait exposure mode.
|
\row \li Camera.ExposurePortrait \li Portrait exposure mode.
|
||||||
|
\row \li Camera.ExposureAction \li Action exposure mode. Since 5.5
|
||||||
|
\row \li Camera.ExposureLandscape \li Landscape exposure mode. Since 5.5
|
||||||
|
\row \li Camera.ExposureNightPortrait \li Night portrait exposure mode. Since 5.5
|
||||||
|
\row \li Camera.ExposureTheatre \li Theatre exposure mode. Since 5.5
|
||||||
|
\row \li Camera.ExposureSunset \li Sunset exposure mode. Since 5.5
|
||||||
|
\row \li Camera.ExposureSteadyPhoto \li Steady photo exposure mode. Since 5.5
|
||||||
|
\row \li Camera.ExposureFireworks \li Fireworks exposure mode. Since 5.5
|
||||||
|
\row \li Camera.ExposureParty \li Party exposure mode. Since 5.5
|
||||||
|
\row \li Camera.ExposureCandlelight \li Candlelight exposure mode. Since 5.5
|
||||||
|
\row \li Camera.ExposureBarcode \li Barcode exposure mode. Since 5.5
|
||||||
\row \li Camera.ExposureModeVendor \li The base value for device specific exposure modes.
|
\row \li Camera.ExposureModeVendor \li The base value for device specific exposure modes.
|
||||||
\endtable
|
\endtable
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -86,6 +86,16 @@ public:
|
|||||||
ExposureBeach = QCameraExposure::ExposureBeach,
|
ExposureBeach = QCameraExposure::ExposureBeach,
|
||||||
ExposureLargeAperture = QCameraExposure::ExposureLargeAperture,
|
ExposureLargeAperture = QCameraExposure::ExposureLargeAperture,
|
||||||
ExposureSmallAperture = QCameraExposure::ExposureSmallAperture,
|
ExposureSmallAperture = QCameraExposure::ExposureSmallAperture,
|
||||||
|
ExposureAction = QCameraExposure::ExposureAction,
|
||||||
|
ExposureLandscape = QCameraExposure::ExposureLandscape,
|
||||||
|
ExposureNightPortrait = QCameraExposure::ExposureNightPortrait,
|
||||||
|
ExposureTheatre = QCameraExposure::ExposureTheatre,
|
||||||
|
ExposureSunset = QCameraExposure::ExposureSunset,
|
||||||
|
ExposureSteadyPhoto = QCameraExposure::ExposureSteadyPhoto,
|
||||||
|
ExposureFireworks = QCameraExposure::ExposureFireworks,
|
||||||
|
ExposureParty = QCameraExposure::ExposureParty,
|
||||||
|
ExposureCandlelight = QCameraExposure::ExposureCandlelight,
|
||||||
|
ExposureBarcode = QCameraExposure::ExposureBarcode,
|
||||||
ExposureModeVendor = QCameraExposure::ExposureModeVendor
|
ExposureModeVendor = QCameraExposure::ExposureModeVendor
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -632,6 +632,16 @@ void QCameraExposure::setAutoShutterSpeed()
|
|||||||
\value ExposureBeach Beach exposure mode.
|
\value ExposureBeach Beach exposure mode.
|
||||||
\value ExposureLargeAperture Use larger aperture with small depth of field.
|
\value ExposureLargeAperture Use larger aperture with small depth of field.
|
||||||
\value ExposureSmallAperture Use smaller aperture.
|
\value ExposureSmallAperture Use smaller aperture.
|
||||||
|
\value ExposureAction Action mode. Since 5.5
|
||||||
|
\value ExposureLandscape Landscape mode. Since 5.5
|
||||||
|
\value ExposureNightPortrait Night portrait mode. Since 5.5
|
||||||
|
\value ExposureTheatre Theatre mode. Since 5.5
|
||||||
|
\value ExposureSunset Sunset mode. Since 5.5
|
||||||
|
\value ExposureSteadyPhoto Steady photo mode. Since 5.5
|
||||||
|
\value ExposureFireworks Fireworks mode. Since 5.5
|
||||||
|
\value ExposureParty Party mode. Since 5.5
|
||||||
|
\value ExposureCandlelight Candlelight mode. Since 5.5
|
||||||
|
\value ExposureBarcode Barcode mode. Since 5.5
|
||||||
\value ExposureModeVendor The base value for device specific exposure modes.
|
\value ExposureModeVendor The base value for device specific exposure modes.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -85,6 +85,16 @@ public:
|
|||||||
ExposureBeach = 8,
|
ExposureBeach = 8,
|
||||||
ExposureLargeAperture = 9,
|
ExposureLargeAperture = 9,
|
||||||
ExposureSmallAperture = 10,
|
ExposureSmallAperture = 10,
|
||||||
|
ExposureAction = 11,
|
||||||
|
ExposureLandscape = 12,
|
||||||
|
ExposureNightPortrait = 13,
|
||||||
|
ExposureTheatre = 14,
|
||||||
|
ExposureSunset = 15,
|
||||||
|
ExposureSteadyPhoto = 16,
|
||||||
|
ExposureFireworks = 17,
|
||||||
|
ExposureParty = 18,
|
||||||
|
ExposureCandlelight = 19,
|
||||||
|
ExposureBarcode = 20,
|
||||||
ExposureModeVendor = 1000
|
ExposureModeVendor = 1000
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -181,6 +181,36 @@ bool QAndroidCameraExposureControl::setValue(ExposureParameter parameter, const
|
|||||||
case QCameraExposure::ExposureNight:
|
case QCameraExposure::ExposureNight:
|
||||||
sceneMode = QLatin1String("night");
|
sceneMode = QLatin1String("night");
|
||||||
break;
|
break;
|
||||||
|
case QCameraExposure::ExposureAction:
|
||||||
|
sceneMode = QLatin1String("action");
|
||||||
|
break;
|
||||||
|
case QCameraExposure::ExposureLandscape:
|
||||||
|
sceneMode = QLatin1String("landscape");
|
||||||
|
break;
|
||||||
|
case QCameraExposure::ExposureNightPortrait:
|
||||||
|
sceneMode = QLatin1String("night-portrait");
|
||||||
|
break;
|
||||||
|
case QCameraExposure::ExposureTheatre:
|
||||||
|
sceneMode = QLatin1String("theatre");
|
||||||
|
break;
|
||||||
|
case QCameraExposure::ExposureSunset:
|
||||||
|
sceneMode = QLatin1String("sunset");
|
||||||
|
break;
|
||||||
|
case QCameraExposure::ExposureSteadyPhoto:
|
||||||
|
sceneMode = QLatin1String("steadyphoto");
|
||||||
|
break;
|
||||||
|
case QCameraExposure::ExposureFireworks:
|
||||||
|
sceneMode = QLatin1String("fireworks");
|
||||||
|
break;
|
||||||
|
case QCameraExposure::ExposureParty:
|
||||||
|
sceneMode = QLatin1String("party");
|
||||||
|
break;
|
||||||
|
case QCameraExposure::ExposureCandlelight:
|
||||||
|
sceneMode = QLatin1String("candlelight");
|
||||||
|
break;
|
||||||
|
case QCameraExposure::ExposureBarcode:
|
||||||
|
sceneMode = QLatin1String("barcode");
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
sceneMode = QLatin1String("auto");
|
sceneMode = QLatin1String("auto");
|
||||||
m_actualExposureMode = QCameraExposure::ExposureAuto;
|
m_actualExposureMode = QCameraExposure::ExposureAuto;
|
||||||
@@ -226,6 +256,26 @@ void QAndroidCameraExposureControl::onCameraOpened()
|
|||||||
m_supportedExposureModes << QVariant::fromValue(QCameraExposure::ExposureSnow);
|
m_supportedExposureModes << QVariant::fromValue(QCameraExposure::ExposureSnow);
|
||||||
else if (sceneMode == QLatin1String("sports"))
|
else if (sceneMode == QLatin1String("sports"))
|
||||||
m_supportedExposureModes << QVariant::fromValue(QCameraExposure::ExposureSports);
|
m_supportedExposureModes << QVariant::fromValue(QCameraExposure::ExposureSports);
|
||||||
|
else if (sceneMode == QLatin1String("action"))
|
||||||
|
m_supportedExposureModes << QVariant::fromValue(QCameraExposure::ExposureAction);
|
||||||
|
else if (sceneMode == QLatin1String("landscape"))
|
||||||
|
m_supportedExposureModes << QVariant::fromValue(QCameraExposure::ExposureLandscape);
|
||||||
|
else if (sceneMode == QLatin1String("night-portrait"))
|
||||||
|
m_supportedExposureModes << QVariant::fromValue(QCameraExposure::ExposureNightPortrait);
|
||||||
|
else if (sceneMode == QLatin1String("theatre"))
|
||||||
|
m_supportedExposureModes << QVariant::fromValue(QCameraExposure::ExposureTheatre);
|
||||||
|
else if (sceneMode == QLatin1String("sunset"))
|
||||||
|
m_supportedExposureModes << QVariant::fromValue(QCameraExposure::ExposureSunset);
|
||||||
|
else if (sceneMode == QLatin1String("steadyphoto"))
|
||||||
|
m_supportedExposureModes << QVariant::fromValue(QCameraExposure::ExposureSteadyPhoto);
|
||||||
|
else if (sceneMode == QLatin1String("fireworks"))
|
||||||
|
m_supportedExposureModes << QVariant::fromValue(QCameraExposure::ExposureFireworks);
|
||||||
|
else if (sceneMode == QLatin1String("party"))
|
||||||
|
m_supportedExposureModes << QVariant::fromValue(QCameraExposure::ExposureParty);
|
||||||
|
else if (sceneMode == QLatin1String("candlelight"))
|
||||||
|
m_supportedExposureModes << QVariant::fromValue(QCameraExposure::ExposureCandlelight);
|
||||||
|
else if (sceneMode == QLatin1String("barcode"))
|
||||||
|
m_supportedExposureModes << QVariant::fromValue(QCameraExposure::ExposureBarcode);
|
||||||
}
|
}
|
||||||
emit parameterRangeChanged(QCameraExposureControl::ExposureMode);
|
emit parameterRangeChanged(QCameraExposureControl::ExposureMode);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -128,20 +128,44 @@ QVariant CameraBinExposure::actualValue(ExposureParameter parameter) const
|
|||||||
|
|
||||||
switch (sceneMode) {
|
switch (sceneMode) {
|
||||||
case GST_PHOTOGRAPHY_SCENE_MODE_PORTRAIT:
|
case GST_PHOTOGRAPHY_SCENE_MODE_PORTRAIT:
|
||||||
return QCameraExposure::ExposurePortrait;
|
return QVariant::fromValue(QCameraExposure::ExposurePortrait);
|
||||||
case GST_PHOTOGRAPHY_SCENE_MODE_SPORT:
|
case GST_PHOTOGRAPHY_SCENE_MODE_SPORT:
|
||||||
return QCameraExposure::ExposureSports;
|
return QVariant::fromValue(QCameraExposure::ExposureSports);
|
||||||
case GST_PHOTOGRAPHY_SCENE_MODE_NIGHT:
|
case GST_PHOTOGRAPHY_SCENE_MODE_NIGHT:
|
||||||
return QCameraExposure::ExposureNight;
|
return QVariant::fromValue(QCameraExposure::ExposureNight);
|
||||||
case GST_PHOTOGRAPHY_SCENE_MODE_MANUAL:
|
case GST_PHOTOGRAPHY_SCENE_MODE_MANUAL:
|
||||||
return QCameraExposure::ExposureManual;
|
return QVariant::fromValue(QCameraExposure::ExposureManual);
|
||||||
case GST_PHOTOGRAPHY_SCENE_MODE_CLOSEUP:
|
|
||||||
//no direct mapping available so mapping to auto mode
|
|
||||||
case GST_PHOTOGRAPHY_SCENE_MODE_LANDSCAPE:
|
case GST_PHOTOGRAPHY_SCENE_MODE_LANDSCAPE:
|
||||||
//no direct mapping available so mapping to auto mode
|
return QVariant::fromValue(QCameraExposure::ExposureLandscape);
|
||||||
|
#if GST_CHECK_VERSION(1, 2, 0)
|
||||||
|
case GST_PHOTOGRAPHY_SCENE_MODE_SNOW:
|
||||||
|
return QVariant::fromValue(QCameraExposure::ExposureSnow);
|
||||||
|
case GST_PHOTOGRAPHY_SCENE_MODE_BEACH:
|
||||||
|
return QVariant::fromValue(QCameraExposure::ExposureBeach);
|
||||||
|
case GST_PHOTOGRAPHY_SCENE_MODE_ACTION:
|
||||||
|
return QVariant::fromValue(QCameraExposure::ExposureAction);
|
||||||
|
case GST_PHOTOGRAPHY_SCENE_MODE_NIGHT_PORTRAIT:
|
||||||
|
return QVariant::fromValue(QCameraExposure::ExposureNightPortrait);
|
||||||
|
case GST_PHOTOGRAPHY_SCENE_MODE_THEATRE:
|
||||||
|
return QVariant::fromValue(QCameraExposure::ExposureTheatre);
|
||||||
|
case GST_PHOTOGRAPHY_SCENE_MODE_SUNSET:
|
||||||
|
return QVariant::fromValue(QCameraExposure::ExposureSunset);
|
||||||
|
case GST_PHOTOGRAPHY_SCENE_MODE_STEADY_PHOTO:
|
||||||
|
return QVariant::fromValue(QCameraExposure::ExposureSteadyPhoto);
|
||||||
|
case GST_PHOTOGRAPHY_SCENE_MODE_FIREWORKS:
|
||||||
|
return QVariant::fromValue(QCameraExposure::ExposureFireworks);
|
||||||
|
case GST_PHOTOGRAPHY_SCENE_MODE_PARTY:
|
||||||
|
return QVariant::fromValue(QCameraExposure::ExposureParty);
|
||||||
|
case GST_PHOTOGRAPHY_SCENE_MODE_CANDLELIGHT:
|
||||||
|
return QVariant::fromValue(QCameraExposure::ExposureCandlelight);
|
||||||
|
case GST_PHOTOGRAPHY_SCENE_MODE_BARCODE:
|
||||||
|
return QVariant::fromValue(QCameraExposure::ExposureBarcode);
|
||||||
|
#endif
|
||||||
|
//no direct mapping available so mapping to auto mode
|
||||||
|
case GST_PHOTOGRAPHY_SCENE_MODE_CLOSEUP:
|
||||||
case GST_PHOTOGRAPHY_SCENE_MODE_AUTO:
|
case GST_PHOTOGRAPHY_SCENE_MODE_AUTO:
|
||||||
default:
|
default:
|
||||||
return QCameraExposure::ExposureAuto;
|
return QVariant::fromValue(QCameraExposure::ExposureAuto);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
case QCameraExposureControl::MeteringMode:
|
case QCameraExposureControl::MeteringMode:
|
||||||
@@ -170,8 +194,9 @@ bool CameraBinExposure::setValue(ExposureParameter parameter, const QVariant& va
|
|||||||
break;
|
break;
|
||||||
case QCameraExposureControl::ExposureMode:
|
case QCameraExposureControl::ExposureMode:
|
||||||
{
|
{
|
||||||
QCameraExposure::ExposureMode mode = QCameraExposure::ExposureMode(value.toInt());
|
QCameraExposure::ExposureMode mode = value.value<QCameraExposure::ExposureMode>();
|
||||||
GstPhotographySceneMode sceneMode;
|
GstPhotographySceneMode sceneMode;
|
||||||
|
|
||||||
gst_photography_get_scene_mode(m_session->photography(), &sceneMode);
|
gst_photography_get_scene_mode(m_session->photography(), &sceneMode);
|
||||||
|
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
@@ -190,6 +215,44 @@ bool CameraBinExposure::setValue(ExposureParameter parameter, const QVariant& va
|
|||||||
case QCameraExposure::ExposureAuto:
|
case QCameraExposure::ExposureAuto:
|
||||||
sceneMode = GST_PHOTOGRAPHY_SCENE_MODE_AUTO;
|
sceneMode = GST_PHOTOGRAPHY_SCENE_MODE_AUTO;
|
||||||
break;
|
break;
|
||||||
|
case QCameraExposure::ExposureLandscape:
|
||||||
|
sceneMode = GST_PHOTOGRAPHY_SCENE_MODE_LANDSCAPE;
|
||||||
|
break;
|
||||||
|
#if GST_CHECK_VERSION(1, 2, 0)
|
||||||
|
case QCameraExposure::ExposureSnow:
|
||||||
|
sceneMode = GST_PHOTOGRAPHY_SCENE_MODE_SNOW;
|
||||||
|
break;
|
||||||
|
case QCameraExposure::ExposureBeach:
|
||||||
|
sceneMode = GST_PHOTOGRAPHY_SCENE_MODE_BEACH;
|
||||||
|
break;
|
||||||
|
case QCameraExposure::ExposureAction:
|
||||||
|
sceneMode = GST_PHOTOGRAPHY_SCENE_MODE_ACTION;
|
||||||
|
break;
|
||||||
|
case QCameraExposure::ExposureNightPortrait:
|
||||||
|
sceneMode = GST_PHOTOGRAPHY_SCENE_MODE_NIGHT_PORTRAIT;
|
||||||
|
break;
|
||||||
|
case QCameraExposure::ExposureTheatre:
|
||||||
|
sceneMode = GST_PHOTOGRAPHY_SCENE_MODE_THEATRE;
|
||||||
|
break;
|
||||||
|
case QCameraExposure::ExposureSunset:
|
||||||
|
sceneMode = GST_PHOTOGRAPHY_SCENE_MODE_SUNSET;
|
||||||
|
break;
|
||||||
|
case QCameraExposure::ExposureSteadyPhoto:
|
||||||
|
sceneMode = GST_PHOTOGRAPHY_SCENE_MODE_STEADY_PHOTO;
|
||||||
|
break;
|
||||||
|
case QCameraExposure::ExposureFireworks:
|
||||||
|
sceneMode = GST_PHOTOGRAPHY_SCENE_MODE_FIREWORKS;
|
||||||
|
break;
|
||||||
|
case QCameraExposure::ExposureParty:
|
||||||
|
sceneMode = GST_PHOTOGRAPHY_SCENE_MODE_PARTY;
|
||||||
|
break;
|
||||||
|
case QCameraExposure::ExposureCandlelight:
|
||||||
|
sceneMode = GST_PHOTOGRAPHY_SCENE_MODE_CANDLELIGHT;
|
||||||
|
break;
|
||||||
|
case QCameraExposure::ExposureBarcode:
|
||||||
|
sceneMode = GST_PHOTOGRAPHY_SCENE_MODE_BARCODE;
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user