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:
parent
1c5158213d
commit
c3de6238ca
|
@ -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();
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue
Block a user