void S60ImageEncoderControl::setImageSettings(const QImageEncoderSettings &settings) { if (!settings.isNull()) { // Notify that settings have been implicitly set and there's no need to // initialize them in case camera is changed m_session->settings()->notifySettingsSet(); if (!settings.codec().isEmpty()) m_session->settings()->setImageCodec(settings.codec()); // Set quality before resolution as quality defines the // resolution used in case it's not explicitly set m_session->settings()->setImageQuality(settings.quality()); m_session->settings()->setImageResolution(settings.resolution()); // Prepare ImageCapture with the settings and set error if needed int prepareSuccess = m_session->prepareImageCapture(); // Preparation fails with KErrNotReady if camera has not been started. // That can be ignored since settings are set internally in that case. if (prepareSuccess != KErrNotReady && prepareSuccess != KErrNone) m_session->setError(prepareSuccess, tr("Failed to apply image settings."), true); } else { m_session->setError(KErrNotSupported, tr("Unable to set undefined settings."), true); } }
QList<QSize> S60ImageEncoderControl::supportedResolutions( const QImageEncoderSettings &settings, bool *continuous) const { // Discrete resolutions are returned if (continuous) *continuous = false; return m_session->settings()->supportedImageResolutionsForCodec(settings.codec()); }
void AndroidCamImageEncoderControl::setImageSettings(const QImageEncoderSettings &settings) { m_imageSettings.clear(); if(settings.codec() == QLatin1String("JPEG")) { m_imageSettings.append(256); } else if(settings.codec() == QLatin1String("NV21")) { m_imageSettings.append(17); } else if(settings.codec() == QLatin1String("RGB_565")) { m_imageSettings.append(4); } else if(settings.codec() == QLatin1String("YUY2")) { m_imageSettings.append(20); } else { m_imageSettings.append(256); } QSize resolution = settings.resolution(); if(!resolution.isEmpty()) { m_imageSettings.append(resolution.width()); m_imageSettings.append(resolution.height()); } else { m_imageSettings.append(QtCameraJni::getSupportedImageResolutions().at(0)); m_imageSettings.append(QtCameraJni::getSupportedImageResolutions().at(1)); } QtCameraJni::setImageSettings(m_imageSettings); }