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