diff --git a/src/core/toxcall.cpp b/src/core/toxcall.cpp index 390957f2b..8ed8d14a1 100644 --- a/src/core/toxcall.cpp +++ b/src/core/toxcall.cpp @@ -102,6 +102,7 @@ ToxFriendCall::ToxFriendCall(uint32_t FriendNum, bool VideoEnabled, CoreAV& av) { videoSource = new CoreVideoSource; CameraSource& source = CameraSource::getInstance(); + if (!source.isOpen()) source.open(); source.subscribe(); diff --git a/src/video/camerasource.cpp b/src/video/camerasource.cpp index 7400234e3..1bcbcc296 100644 --- a/src/video/camerasource.cpp +++ b/src/video/camerasource.cpp @@ -28,6 +28,7 @@ extern "C" { #include #include #include +#include "src/persistence/settings.h" #include "camerasource.h" #include "cameradevice.h" #include "videoframe.h" @@ -67,7 +68,15 @@ void CameraSource::open() void CameraSource::open(const QString& deviceName) { - open(deviceName, VideoMode()); + bool isScreen = CameraDevice::isScreen(deviceName); + VideoMode mode = VideoMode(Settings::getInstance().getScreenRegion()); + if (!isScreen) + { + mode = VideoMode(Settings::getInstance().getCamVideoRes()); + mode.FPS = Settings::getInstance().getCamVideoFPS(); + } + + open(deviceName, mode); } void CameraSource::open(const QString& DeviceName, VideoMode Mode)