Blackberry: Restart camera viewfinder after standby

Listen to the CAMERA_STATUS_POWERUP signal, which is sent
after standby, and trigger a restart of the viewfinder
in this case.

Change-Id: I426f23657844bb270ddfd0e4bfb35880040aa583
Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
This commit is contained in:
Tobias Koenig
2013-02-08 13:35:28 +01:00
committed by The Qt Project
parent b19ec14a62
commit d2b0a345ab
2 changed files with 10 additions and 0 deletions

View File

@@ -924,6 +924,12 @@ void BbCameraSession::deviceOrientationChanged(int angle)
camera_set_device_orientation(m_handle, angle);
}
void BbCameraSession::handleCameraPowerUp()
{
stopViewFinder();
startViewFinder();
}
bool BbCameraSession::openCamera()
{
if (m_handle != CAMERA_HANDLE_INVALID) // camera is already open
@@ -1011,6 +1017,9 @@ static void viewFinderStatusCallback(camera_handle_t handle, camera_devstatus_t
if (status == CAMERA_STATUS_FOCUS_CHANGE) {
BbCameraSession *session = static_cast<BbCameraSession*>(context);
QMetaObject::invokeMethod(session, "handleFocusStatusChanged", Qt::QueuedConnection, Q_ARG(int, value));
} else if (status == CAMERA_STATUS_POWERUP) {
BbCameraSession *session = static_cast<BbCameraSession*>(context);
QMetaObject::invokeMethod(session, "handleCameraPowerUp", Qt::QueuedConnection);
}
}

View File

@@ -177,6 +177,7 @@ private slots:
void handleVideoRecordingPaused();
void handleVideoRecordingResumed();
void deviceOrientationChanged(int);
void handleCameraPowerUp();
private:
bool openCamera();