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:
committed by
The Qt Project
parent
b19ec14a62
commit
d2b0a345ab
@@ -924,6 +924,12 @@ void BbCameraSession::deviceOrientationChanged(int angle)
|
|||||||
camera_set_device_orientation(m_handle, angle);
|
camera_set_device_orientation(m_handle, angle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void BbCameraSession::handleCameraPowerUp()
|
||||||
|
{
|
||||||
|
stopViewFinder();
|
||||||
|
startViewFinder();
|
||||||
|
}
|
||||||
|
|
||||||
bool BbCameraSession::openCamera()
|
bool BbCameraSession::openCamera()
|
||||||
{
|
{
|
||||||
if (m_handle != CAMERA_HANDLE_INVALID) // camera is already open
|
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) {
|
if (status == CAMERA_STATUS_FOCUS_CHANGE) {
|
||||||
BbCameraSession *session = static_cast<BbCameraSession*>(context);
|
BbCameraSession *session = static_cast<BbCameraSession*>(context);
|
||||||
QMetaObject::invokeMethod(session, "handleFocusStatusChanged", Qt::QueuedConnection, Q_ARG(int, value));
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -177,6 +177,7 @@ private slots:
|
|||||||
void handleVideoRecordingPaused();
|
void handleVideoRecordingPaused();
|
||||||
void handleVideoRecordingResumed();
|
void handleVideoRecordingResumed();
|
||||||
void deviceOrientationChanged(int);
|
void deviceOrientationChanged(int);
|
||||||
|
void handleCameraPowerUp();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool openCamera();
|
bool openCamera();
|
||||||
|
|||||||
Reference in New Issue
Block a user