winrt: Disable camera deactivation automation in debug mode

Camera control reacts to an application becoming inactive and turns off
the camera. However, when debugging or watching internals inside an IDE
this feature breaks the state of the application as the IDE gets focus
and hence camera is turned off.

Change-Id: I6f80476592c0faa32e9da11401f699c6211d226a
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
This commit is contained in:
Maurice Kalinowski
2016-04-22 11:02:13 +02:00
parent a75f8fd0bb
commit 7553a05213

View File

@@ -823,6 +823,9 @@ void QWinRTCameraControl::onBufferRequested()
void QWinRTCameraControl::onApplicationStateChanged(Qt::ApplicationState state)
{
qCDebug(lcMMCamera) << __FUNCTION__ << state;
#ifdef _DEBUG
return;
#else // !_DEBUG
Q_D(QWinRTCameraControl);
static QCamera::State savedState = d->state;
switch (state) {
@@ -838,6 +841,7 @@ void QWinRTCameraControl::onApplicationStateChanged(Qt::ApplicationState state)
default:
break;
}
#endif // _DEBUG
}
HRESULT QWinRTCameraControl::initialize()