QVariant CameraBinExposure::exposureParameter(ExposureParameter parameter) const { switch (parameter) { case QCameraExposureControl::ExposureCompensation: { gfloat ev; gst_photography_get_ev_compensation(m_session->photography(), &ev); return QVariant(ev); } case QCameraExposureControl::ISO: { guint isoSpeed = 0; gst_photography_get_iso_speed(m_session->photography(), &isoSpeed); return QVariant(isoSpeed); } case QCameraExposureControl::Aperture: return QVariant(2.8); case QCameraExposureControl::ShutterSpeed: { guint32 shutterSpeed = 0; gst_photography_get_exposure(m_session->photography(), &shutterSpeed); return QVariant(shutterSpeed/1000000.0); } default: return QVariant(); } }
QVariant CameraBinExposure::actualValue(ExposureParameter parameter) const { switch (parameter) { case QCameraExposureControl::ExposureCompensation: { gfloat ev; gst_photography_get_ev_compensation(m_session->photography(), &ev); return QVariant(ev); } case QCameraExposureControl::ISO: { guint isoSpeed = 0; gst_photography_get_iso_speed(m_session->photography(), &isoSpeed); return QVariant(isoSpeed); } case QCameraExposureControl::Aperture: return QVariant(2.8); case QCameraExposureControl::ShutterSpeed: { guint32 shutterSpeed = 0; gst_photography_get_exposure(m_session->photography(), &shutterSpeed); return QVariant(shutterSpeed/1000000.0); } case QCameraExposureControl::ExposureMode: { GstSceneMode sceneMode; gst_photography_get_scene_mode(m_session->photography(), &sceneMode); switch (sceneMode) { case GST_PHOTOGRAPHY_SCENE_MODE_PORTRAIT: return QCameraExposure::ExposurePortrait; case GST_PHOTOGRAPHY_SCENE_MODE_SPORT: return QCameraExposure::ExposureSports; case GST_PHOTOGRAPHY_SCENE_MODE_NIGHT: return QCameraExposure::ExposureNight; case GST_PHOTOGRAPHY_SCENE_MODE_MANUAL: return QCameraExposure::ExposureManual; case GST_PHOTOGRAPHY_SCENE_MODE_CLOSEUP: //no direct mapping available so mapping to auto mode case GST_PHOTOGRAPHY_SCENE_MODE_LANDSCAPE: //no direct mapping available so mapping to auto mode case GST_PHOTOGRAPHY_SCENE_MODE_AUTO: default: return QCameraExposure::ExposureAuto; } } case QCameraExposureControl::MeteringMode: return QCameraExposure::MeteringMatrix; default: return QVariant(); } }