From e3bd0333de0b7632024cdd5e8e8833173c960549 Mon Sep 17 00:00:00 2001 From: Tobias Koenig Date: Wed, 23 Oct 2013 17:43:50 +0200 Subject: [PATCH] Blackberry: Fix video recording The latest BB10 firmware (10.2) requires to set the rotation property of the video explicitly to the value of the video viewfinder. Change-Id: Iec9d43480820655b5d3ecdd136917d5458f0e55b Reviewed-by: Fabian Bumberger Reviewed-by: Rafael Roquetto --- src/plugins/blackberry/camera/bbcamerasession.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/plugins/blackberry/camera/bbcamerasession.cpp b/src/plugins/blackberry/camera/bbcamerasession.cpp index 7073979..8f8e666 100644 --- a/src/plugins/blackberry/camera/bbcamerasession.cpp +++ b/src/plugins/blackberry/camera/bbcamerasession.cpp @@ -637,13 +637,15 @@ void BbCameraSession::applyVideoSettings() const QByteArray windowGroupId = m_windowGrabber->windowGroupId(); + const int rotationAngle = (360 - m_nativeCameraOrientation); + camera_error_t result = CAMERA_EOK; result = camera_set_videovf_property(m_handle, CAMERA_IMGPROP_WIN_GROUPID, windowGroupId.data(), CAMERA_IMGPROP_WIN_ID, windowId.data(), CAMERA_IMGPROP_WIDTH, viewfinderResolution.width(), CAMERA_IMGPROP_HEIGHT, viewfinderResolution.height(), - CAMERA_IMGPROP_ROTATION, 360 - m_nativeCameraOrientation); + CAMERA_IMGPROP_ROTATION, rotationAngle); if (result != CAMERA_EOK) { qWarning() << "Unable to apply video viewfinder settings:" << result; @@ -683,9 +685,11 @@ void BbCameraSession::applyVideoSettings() cameraAudioCodec = CAMERA_AUDIOCODEC_AAC; else if (audioCodec == QLatin1String("raw")) cameraAudioCodec = CAMERA_AUDIOCODEC_RAW; + result = camera_set_video_property(m_handle, CAMERA_IMGPROP_WIDTH, resolution.width(), CAMERA_IMGPROP_HEIGHT, resolution.height(), + CAMERA_IMGPROP_ROTATION, rotationAngle, CAMERA_IMGPROP_VIDEOCODEC, cameraVideoCodec, CAMERA_IMGPROP_AUDIOCODEC, cameraAudioCodec); #else -- 2.7.4