1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

feat(camerasource): Change default video mode to preferred

This commit is contained in:
Diadlo 2016-06-23 02:11:02 +03:00
parent 1c5158213d
commit c3de6238ca
No known key found for this signature in database
GPG Key ID: 5AF9F2E29107C727
2 changed files with 11 additions and 1 deletions

View File

@ -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();

View File

@ -28,6 +28,7 @@ extern "C" {
#include <QtConcurrent/QtConcurrentRun>
#include <memory>
#include <functional>
#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)