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

Fix crash on windows (camera)

This commit is contained in:
Tux3 / Mlkj / !Lev.uXFMLA 2014-06-30 19:50:55 +02:00
parent 625715f505
commit 5f649d6f85
2 changed files with 3 additions and 0 deletions

View File

@ -10,11 +10,13 @@ Camera::Camera()
camera->setCaptureMode(QCamera::CaptureVideo); camera->setCaptureMode(QCamera::CaptureVideo);
camera->setViewfinder(this); camera->setViewfinder(this);
/* CRASHES ON WINDOWS !
QMediaService *m = camera->service(); QMediaService *m = camera->service();
QVideoEncoderSettingsControl *enc = m->requestControl<QVideoEncoderSettingsControl*>(); QVideoEncoderSettingsControl *enc = m->requestControl<QVideoEncoderSettingsControl*>();
QVideoEncoderSettings sets = enc->videoSettings(); QVideoEncoderSettings sets = enc->videoSettings();
sets.setResolution(640, 480); sets.setResolution(640, 480);
enc->setVideoSettings(sets); enc->setVideoSettings(sets);
*/
connect(camera, SIGNAL(error(QCamera::Error)), this, SLOT(onCameraError(QCamera::Error))); connect(camera, SIGNAL(error(QCamera::Error)), this, SLOT(onCameraError(QCamera::Error)));

View File

@ -44,6 +44,7 @@ Widget::Widget(QWidget *parent) :
qRegisterMetaType<ToxFile::FileDirection>("ToxFile::FileDirection"); qRegisterMetaType<ToxFile::FileDirection>("ToxFile::FileDirection");
core = new Core(camera); core = new Core(camera);
core = new Core(nullptr);
coreThread = new QThread(this); coreThread = new QThread(this);
core->moveToThread(coreThread); core->moveToThread(coreThread);
connect(coreThread, &QThread::started, core, &Core::start); connect(coreThread, &QThread::started, core, &Core::start);