QtMultimediaCamera: fix invalid settings

This commit is contained in:
zhupengfei 2018-06-07 12:59:18 +08:00
parent 7c48160beb
commit a15e4e80c6
No known key found for this signature in database
GPG key ID: 85B82A3E62174206

View file

@ -93,9 +93,11 @@ void QtMultimediaCamera::SetFrameRate(Service::CAM::FrameRate frame_rate) {
auto framerate = FrameRateList[static_cast<int>(frame_rate)]; auto framerate = FrameRateList[static_cast<int>(frame_rate)];
if (handler->camera->supportedViewfinderFrameRateRanges().contains(framerate)) {
handler->settings.setMinimumFrameRate(framerate.minimumFrameRate); handler->settings.setMinimumFrameRate(framerate.minimumFrameRate);
handler->settings.setMaximumFrameRate(framerate.maximumFrameRate); handler->settings.setMaximumFrameRate(framerate.maximumFrameRate);
} }
}
QImage QtMultimediaCamera::QtReceiveFrame() { QImage QtMultimediaCamera::QtReceiveFrame() {
QMutexLocker locker(&handler->camera_surface.mutex); QMutexLocker locker(&handler->camera_surface.mutex);
@ -171,6 +173,7 @@ void QtMultimediaCameraHandler::CreateCamera(const std::string& camera_name) {
settings.setMinimumFrameRate(30); settings.setMinimumFrameRate(30);
settings.setMaximumFrameRate(30); settings.setMaximumFrameRate(30);
camera->setViewfinder(&camera_surface); camera->setViewfinder(&camera_surface);
camera->load();
} }
void QtMultimediaCameraHandler::StopCamera() { void QtMultimediaCameraHandler::StopCamera() {