From e3bd0333de0b7632024cdd5e8e8833173c960549 Mon Sep 17 00:00:00 2001 From: Tobias Koenig Date: Wed, 23 Oct 2013 17:43:50 +0200 Subject: 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(-) (limited to 'src/plugins') diff --git a/src/plugins/blackberry/camera/bbcamerasession.cpp b/src/plugins/blackberry/camera/bbcamerasession.cpp index 707397992..8f8e666d9 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 -- cgit v1.2.3 From a2f9f25d8577fefe8358eb848da206e5ebdf4178 Mon Sep 17 00:00:00 2001 From: Tobias Koenig Date: Wed, 23 Oct 2013 18:04:58 +0200 Subject: Blackberry: Fix camera viewfinder Enter the event loop between opening the camera and starting the viewfinder window grabber. The latter needs a windowGroup set, so in case the QCamera and QCameraViewfinder are constructed directly/indirectly inside the main window constructor, we have to wait for the top-level window of the application to be created, so that we can retrieve the windowGroup from it. Task-number: QTBUG-33739 Change-Id: Ib23781f0e4a2a07ba388e22debcb59b00509ed16 Reviewed-by: Rafael Roquetto Reviewed-by: Fabian Bumberger Reviewed-by: Tobias Koenig Reviewed-by: Sean Harmer --- src/plugins/blackberry/camera/bbcamerasession.cpp | 14 ++++++-------- src/plugins/blackberry/camera/bbcamerasession.h | 2 +- 2 files changed, 7 insertions(+), 9 deletions(-) (limited to 'src/plugins') diff --git a/src/plugins/blackberry/camera/bbcamerasession.cpp b/src/plugins/blackberry/camera/bbcamerasession.cpp index 8f8e666d9..0185dccb4 100644 --- a/src/plugins/blackberry/camera/bbcamerasession.cpp +++ b/src/plugins/blackberry/camera/bbcamerasession.cpp @@ -165,10 +165,8 @@ void BbCameraSession::setState(QCamera::State state) } } else if (state == QCamera::ActiveState) { if (openCamera()) { - applyConfiguration(); - if (startViewFinder()) { - m_state = state; - } + QMetaObject::invokeMethod(this, "applyConfiguration", Qt::QueuedConnection); + m_state = state; } } } else if (previousState == QCamera::LoadedState) { @@ -176,10 +174,8 @@ void BbCameraSession::setState(QCamera::State state) closeCamera(); m_state = state; } else if (state == QCamera::ActiveState) { - applyConfiguration(); - if (startViewFinder()) { - m_state = state; - } + QMetaObject::invokeMethod(this, "applyConfiguration", Qt::QueuedConnection); + m_state = state; } } else if (previousState == QCamera::ActiveState) { if (state == QCamera::LoadedState) { @@ -1157,6 +1153,8 @@ void BbCameraSession::applyConfiguration() } else if (m_captureMode & QCamera::CaptureVideo) { applyVideoSettings(); } + + startViewFinder(); } static void videoRecordingStatusCallback(camera_handle_t handle, camera_devstatus_t status, uint16_t value, void *context) diff --git a/src/plugins/blackberry/camera/bbcamerasession.h b/src/plugins/blackberry/camera/bbcamerasession.h index f57c7dabf..f226d4245 100644 --- a/src/plugins/blackberry/camera/bbcamerasession.h +++ b/src/plugins/blackberry/camera/bbcamerasession.h @@ -176,13 +176,13 @@ private slots: void deviceOrientationChanged(int); void handleCameraPowerUp(); void viewfinderFrameGrabbed(const QImage &image); + void applyConfiguration(); private: bool openCamera(); void closeCamera(); bool startViewFinder(); void stopViewFinder(); - void applyConfiguration(); bool startVideoRecording(); void stopVideoRecording(); -- cgit v1.2.3 From 2858e6cc3ee0fc5d1a42f5f41722246ea9e2831e Mon Sep 17 00:00:00 2001 From: Rafael Roquetto Date: Fri, 18 Oct 2013 19:08:24 -0300 Subject: BlackBerry: fix BbVideoWindowControl window zorder Change-Id: I6c3b70d5d5a0afcb00ce2494ee071d6f3abd7626 Reviewed-by: Fabian Bumberger Reviewed-by: Thomas McGuire --- src/plugins/blackberry/mediaplayer/bbvideowindowcontrol.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/plugins') diff --git a/src/plugins/blackberry/mediaplayer/bbvideowindowcontrol.cpp b/src/plugins/blackberry/mediaplayer/bbvideowindowcontrol.cpp index d29f36f0a..8c1ca19dc 100644 --- a/src/plugins/blackberry/mediaplayer/bbvideowindowcontrol.cpp +++ b/src/plugins/blackberry/mediaplayer/bbvideowindowcontrol.cpp @@ -196,7 +196,7 @@ void BbVideoWindowControl::attachDisplay(mmr_context_t *context) return; } - QWindow * const window = findWindow(m_winId); + QWindow *window = findWindow(m_winId); if (!window) { qDebug() << "BbVideoWindowControl: No video window!"; return; @@ -218,6 +218,10 @@ void BbVideoWindowControl::attachDisplay(mmr_context_t *context) const QString groupName = QString::fromLatin1(groupNameData); m_windowName = QString("BbVideoWindowControl_%1_%2").arg(winIdCounter++) .arg(QCoreApplication::applicationPid()); + + nativeInterface->setWindowProperty(window->handle(), + QStringLiteral("mmRendererWindowName"), m_windowName); + // Start with an invisible window. If it would be visible right away, it would be at the wrong // position, and we can only change the position once we get the window handle. const QString videoDeviceUrl = -- cgit v1.2.3 From 1235fb99101d56694edfa018b4cf6cfae653fa36 Mon Sep 17 00:00:00 2001 From: Yoann Lopes Date: Fri, 25 Oct 2013 12:49:40 +0200 Subject: OpenSL ES: enable the plugin only on Android. Removed the configure test to enable or not the plugin (which solves the problem of the plugin not being built on Windows because of a bug in QMake). Even though it should work on other OpenSL ES implementations than the Android one, it hasn't been tested. Compile and use the plugin only on Android for now. Task-number: QTBUG-34275 Change-Id: I02d47c8be3be8163a17c68b44b8c4b18a218a3fe Reviewed-by: Christian Stromme --- src/plugins/plugins.pro | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'src/plugins') diff --git a/src/plugins/plugins.pro b/src/plugins/plugins.pro index 15d5a0b9b..20b0ccd9e 100644 --- a/src/plugins/plugins.pro +++ b/src/plugins/plugins.pro @@ -9,7 +9,7 @@ TEMPLATE = subdirs SUBDIRS += m3u android { - SUBDIRS += android + SUBDIRS += android opensles } blackberry { @@ -52,10 +52,6 @@ mac:!simulator { !ios: SUBDIRS += qt7 } -config_opensles { - SUBDIRS += opensles -} - config_resourcepolicy { SUBDIRS += resourcepolicy } -- cgit v1.2.3 From 43bc5f65d2c0e909a3b4b9d32da692bc38b3e27a Mon Sep 17 00:00:00 2001 From: Tobias Koenig Date: Thu, 24 Oct 2013 12:49:05 +0200 Subject: Blackberry: Improve camera focus handling Use different state variables for focus/exposure/whitebalance locks and update the exposure and whitebalance variables explicitly, since BB10 doesn't provide a status callback method as for focus. Change-Id: Ie6ba8f6a2a27f317c39994d21be8549c99daef6d Reviewed-by: Fabian Bumberger Reviewed-by: Rafael Roquetto --- .../blackberry/camera/bbcameralockscontrol.cpp | 195 ++++++++++++++++++++- .../blackberry/camera/bbcameralockscontrol.h | 19 ++ src/plugins/blackberry/camera/bbcamerasession.cpp | 148 +--------------- src/plugins/blackberry/camera/bbcamerasession.h | 25 +-- 4 files changed, 214 insertions(+), 173 deletions(-) (limited to 'src/plugins') diff --git a/src/plugins/blackberry/camera/bbcameralockscontrol.cpp b/src/plugins/blackberry/camera/bbcameralockscontrol.cpp index 471940549..d2537361c 100644 --- a/src/plugins/blackberry/camera/bbcameralockscontrol.cpp +++ b/src/plugins/blackberry/camera/bbcameralockscontrol.cpp @@ -47,29 +47,212 @@ QT_BEGIN_NAMESPACE BbCameraLocksControl::BbCameraLocksControl(BbCameraSession *session, QObject *parent) : QCameraLocksControl(parent) , m_session(session) + , m_locksApplyMode(IndependentMode) + , m_focusLockStatus(QCamera::Unlocked) + , m_exposureLockStatus(QCamera::Unlocked) + , m_whiteBalanceLockStatus(QCamera::Unlocked) + , m_currentLockTypes(QCamera::NoLock) + , m_supportedLockTypes(QCamera::NoLock) { - connect(m_session, SIGNAL(lockStatusChanged(QCamera::LockType,QCamera::LockStatus,QCamera::LockChangeReason)), - this, SIGNAL(lockStatusChanged(QCamera::LockType,QCamera::LockStatus,QCamera::LockChangeReason))); + connect(m_session, SIGNAL(cameraOpened()), SLOT(cameraOpened())); + connect(m_session, SIGNAL(focusStatusChanged(int)), SLOT(focusStatusChanged(int))); } QCamera::LockTypes BbCameraLocksControl::supportedLocks() const { - return m_session->supportedLocks(); + return (QCamera::LockFocus | QCamera::LockExposure | QCamera::LockWhiteBalance); } QCamera::LockStatus BbCameraLocksControl::lockStatus(QCamera::LockType lock) const { - return m_session->lockStatus(lock); + if (!m_supportedLockTypes.testFlag(lock) || (m_session->handle() == CAMERA_HANDLE_INVALID)) + return QCamera::Locked; + + switch (lock) { + case QCamera::LockExposure: + return m_exposureLockStatus; + case QCamera::LockWhiteBalance: + return m_whiteBalanceLockStatus; + case QCamera::LockFocus: + return m_focusLockStatus; + default: + return QCamera::Locked; + } } void BbCameraLocksControl::searchAndLock(QCamera::LockTypes locks) { - m_session->searchAndLock(locks); + if (m_session->handle() == CAMERA_HANDLE_INVALID) + return; + + // filter out unsupported locks + locks &= m_supportedLockTypes; + + m_currentLockTypes |= locks; + + uint32_t lockModes = CAMERA_3A_NONE; + + switch (m_locksApplyMode) { + case IndependentMode: + if (m_currentLockTypes & QCamera::LockExposure) + lockModes |= CAMERA_3A_AUTOEXPOSURE; + if (m_currentLockTypes & QCamera::LockWhiteBalance) + lockModes |= CAMERA_3A_AUTOWHITEBALANCE; + if (m_currentLockTypes & QCamera::LockFocus) + lockModes |= CAMERA_3A_AUTOFOCUS; + break; + case FocusExposureBoundMode: + if ((m_currentLockTypes & QCamera::LockExposure) || (m_currentLockTypes & QCamera::LockFocus)) + lockModes = (CAMERA_3A_AUTOEXPOSURE | CAMERA_3A_AUTOFOCUS); + break; + case AllBoundMode: + lockModes = (CAMERA_3A_AUTOEXPOSURE | CAMERA_3A_AUTOFOCUS | CAMERA_3A_AUTOWHITEBALANCE); + break; + case FocusOnlyMode: + lockModes = CAMERA_3A_AUTOFOCUS; + break; + } + + const camera_error_t result = camera_set_3a_lock(m_session->handle(), lockModes); + + if (result != CAMERA_EOK) { + qWarning() << "Unable to set lock modes:" << result; + } else { + if (lockModes & CAMERA_3A_AUTOFOCUS) { + // handled by focusStatusChanged() + } + + if (lockModes & CAMERA_3A_AUTOEXPOSURE) { + m_exposureLockStatus = QCamera::Locked; + emit lockStatusChanged(QCamera::LockExposure, QCamera::Locked, QCamera::LockAcquired); + } + + if (lockModes & CAMERA_3A_AUTOWHITEBALANCE) { + m_whiteBalanceLockStatus = QCamera::Locked; + emit lockStatusChanged(QCamera::LockWhiteBalance, QCamera::Locked, QCamera::LockAcquired); + } + } } void BbCameraLocksControl::unlock(QCamera::LockTypes locks) { - m_session->unlock(locks); + // filter out unsupported locks + locks &= m_supportedLockTypes; + + m_currentLockTypes &= ~locks; + + uint32_t lockModes = CAMERA_3A_NONE; + + switch (m_locksApplyMode) { + case IndependentMode: + if (m_currentLockTypes & QCamera::LockExposure) + lockModes |= CAMERA_3A_AUTOEXPOSURE; + if (m_currentLockTypes & QCamera::LockWhiteBalance) + lockModes |= CAMERA_3A_AUTOWHITEBALANCE; + if (m_currentLockTypes & QCamera::LockFocus) + lockModes |= CAMERA_3A_AUTOFOCUS; + break; + case FocusExposureBoundMode: + if ((m_currentLockTypes & QCamera::LockExposure) || (m_currentLockTypes & QCamera::LockFocus)) + lockModes = (CAMERA_3A_AUTOEXPOSURE | CAMERA_3A_AUTOFOCUS); + break; + case AllBoundMode: + lockModes = (CAMERA_3A_AUTOEXPOSURE | CAMERA_3A_AUTOFOCUS | CAMERA_3A_AUTOWHITEBALANCE); + break; + case FocusOnlyMode: + lockModes = CAMERA_3A_AUTOFOCUS; + break; + } + + const camera_error_t result = camera_set_3a_lock(m_session->handle(), lockModes); + + if (result != CAMERA_EOK) { + qWarning() << "Unable to set lock modes:" << result; + } else { + if (locks.testFlag(QCamera::LockFocus)) { + // handled by focusStatusChanged() + } + + if (locks.testFlag(QCamera::LockExposure)) { + m_exposureLockStatus = QCamera::Unlocked; + emit lockStatusChanged(QCamera::LockExposure, QCamera::Unlocked, QCamera::UserRequest); + } + + if (locks.testFlag(QCamera::LockWhiteBalance)) { + m_whiteBalanceLockStatus = QCamera::Unlocked; + emit lockStatusChanged(QCamera::LockWhiteBalance, QCamera::Unlocked, QCamera::UserRequest); + } + } +} + +void BbCameraLocksControl::cameraOpened() +{ + // retrieve information about lock apply modes + int supported = 0; + uint32_t modes[20]; + + const camera_error_t result = camera_get_3a_lock_modes(m_session->handle(), 20, &supported, modes); + + if (result == CAMERA_EOK) { + // see API documentation of camera_get_3a_lock_modes for explanation of case discrimination below + if (supported == 4) { + m_locksApplyMode = IndependentMode; + } else if (supported == 3) { + m_locksApplyMode = FocusExposureBoundMode; + } else if (supported == 2) { + if (modes[0] == (CAMERA_3A_AUTOFOCUS | CAMERA_3A_AUTOEXPOSURE | CAMERA_3A_AUTOWHITEBALANCE)) + m_locksApplyMode = AllBoundMode; + else + m_locksApplyMode = FocusOnlyMode; + } + } + + // retrieve information about supported lock types + m_supportedLockTypes = QCamera::NoLock; + + if (camera_has_feature(m_session->handle(), CAMERA_FEATURE_AUTOFOCUS)) + m_supportedLockTypes |= QCamera::LockFocus; + + if (camera_has_feature(m_session->handle(), CAMERA_FEATURE_AUTOEXPOSURE)) + m_supportedLockTypes |= QCamera::LockExposure; + + if (camera_has_feature(m_session->handle(), CAMERA_FEATURE_AUTOWHITEBALANCE)) + m_supportedLockTypes |= QCamera::LockWhiteBalance; + + m_focusLockStatus = QCamera::Unlocked; + m_exposureLockStatus = QCamera::Unlocked; + m_whiteBalanceLockStatus = QCamera::Unlocked; +} + +void BbCameraLocksControl::focusStatusChanged(int value) +{ + const camera_focusstate_t focusState = static_cast(value); + + switch (focusState) { + case CAMERA_FOCUSSTATE_NONE: + m_focusLockStatus = QCamera::Unlocked; + emit lockStatusChanged(QCamera::LockFocus, QCamera::Unlocked, QCamera::UserRequest); + break; + case CAMERA_FOCUSSTATE_WAITING: + case CAMERA_FOCUSSTATE_SEARCHING: + m_focusLockStatus = QCamera::Searching; + emit lockStatusChanged(QCamera::LockFocus, QCamera::Searching, QCamera::UserRequest); + break; + case CAMERA_FOCUSSTATE_FAILED: + m_focusLockStatus = QCamera::Unlocked; + emit lockStatusChanged(QCamera::LockFocus, QCamera::Unlocked, QCamera::LockFailed); + break; + case CAMERA_FOCUSSTATE_LOCKED: + m_focusLockStatus = QCamera::Locked; + emit lockStatusChanged(QCamera::LockFocus, QCamera::Locked, QCamera::LockAcquired); + break; + case CAMERA_FOCUSSTATE_SCENECHANGE: + m_focusLockStatus = QCamera::Unlocked; + emit lockStatusChanged(QCamera::LockFocus, QCamera::Unlocked, QCamera::LockTemporaryLost); + break; + default: + break; + } } QT_END_NAMESPACE diff --git a/src/plugins/blackberry/camera/bbcameralockscontrol.h b/src/plugins/blackberry/camera/bbcameralockscontrol.h index 6c4b2da6b..8257abdbc 100644 --- a/src/plugins/blackberry/camera/bbcameralockscontrol.h +++ b/src/plugins/blackberry/camera/bbcameralockscontrol.h @@ -51,6 +51,14 @@ class BbCameraLocksControl : public QCameraLocksControl { Q_OBJECT public: + enum LocksApplyMode + { + IndependentMode, + FocusExposureBoundMode, + AllBoundMode, + FocusOnlyMode + }; + explicit BbCameraLocksControl(BbCameraSession *session, QObject *parent = 0); QCamera::LockTypes supportedLocks() const Q_DECL_OVERRIDE; @@ -58,8 +66,19 @@ public: void searchAndLock(QCamera::LockTypes locks) Q_DECL_OVERRIDE; void unlock(QCamera::LockTypes locks) Q_DECL_OVERRIDE; +private Q_SLOTS: + void cameraOpened(); + void focusStatusChanged(int value); + private: BbCameraSession *m_session; + + LocksApplyMode m_locksApplyMode; + QCamera::LockStatus m_focusLockStatus; + QCamera::LockStatus m_exposureLockStatus; + QCamera::LockStatus m_whiteBalanceLockStatus; + QCamera::LockTypes m_currentLockTypes; + QCamera::LockTypes m_supportedLockTypes; }; QT_END_NAMESPACE diff --git a/src/plugins/blackberry/camera/bbcamerasession.cpp b/src/plugins/blackberry/camera/bbcamerasession.cpp index 0185dccb4..d673040ab 100644 --- a/src/plugins/blackberry/camera/bbcamerasession.cpp +++ b/src/plugins/blackberry/camera/bbcamerasession.cpp @@ -121,8 +121,6 @@ BbCameraSession::BbCameraSession(QObject *parent) , m_captureImageDriveMode(QCameraImageCapture::SingleImageCapture) , m_lastImageCaptureId(0) , m_captureDestination(QCameraImageCapture::CaptureToFile) - , m_locksApplyMode(IndependentMode) - , m_focusLockStatus(QCamera::Unlocked) , m_videoState(QMediaRecorder::StoppedState) , m_videoStatus(QMediaRecorder::LoadedStatus) , m_handle(CAMERA_HANDLE_INVALID) @@ -444,95 +442,6 @@ void BbCameraSession::setImageSettings(const QImageEncoderSettings &settings) m_imageEncoderSettings.setCodec(QLatin1String("jpeg")); } -QCamera::LockTypes BbCameraSession::supportedLocks() const -{ - if (m_locksApplyMode == FocusOnlyMode) - return QCamera::LockFocus; - else - return (QCamera::LockExposure | QCamera::LockWhiteBalance | QCamera::LockFocus); -} - -QCamera::LockStatus BbCameraSession::lockStatus(QCamera::LockType lock) const -{ - switch (lock) { - case QCamera::LockExposure: - return QCamera::Unlocked; - case QCamera::LockWhiteBalance: - return QCamera::Unlocked; - case QCamera::LockFocus: - return m_focusLockStatus; - default: - return QCamera::Unlocked; - } -} - -void BbCameraSession::searchAndLock(QCamera::LockTypes locks) -{ - m_currentLockTypes |= locks; - - uint32_t lockModes = CAMERA_3A_NONE; - - switch (m_locksApplyMode) { - case IndependentMode: - if (m_currentLockTypes & QCamera::LockExposure) - lockModes |= CAMERA_3A_AUTOEXPOSURE; - if (m_currentLockTypes & QCamera::LockWhiteBalance) - lockModes |= CAMERA_3A_AUTOWHITEBALANCE; - if (m_currentLockTypes & QCamera::LockFocus) - lockModes |= CAMERA_3A_AUTOFOCUS; - break; - case FocusExposureBoundMode: - if ((m_currentLockTypes & QCamera::LockExposure) || (m_currentLockTypes & QCamera::LockFocus)) - lockModes = (CAMERA_3A_AUTOEXPOSURE | CAMERA_3A_AUTOFOCUS); - break; - case AllBoundMode: - lockModes = (CAMERA_3A_AUTOEXPOSURE | CAMERA_3A_AUTOFOCUS | CAMERA_3A_AUTOWHITEBALANCE); - break; - case FocusOnlyMode: - lockModes = CAMERA_3A_AUTOFOCUS; - break; - } - - const camera_error_t result = camera_set_3a_lock(m_handle, lockModes); - - if (result != CAMERA_EOK) { - qWarning() << "Unable to set lock modes:" << result; - } -} - -void BbCameraSession::unlock(QCamera::LockTypes locks) -{ - m_currentLockTypes &= ~locks; - - uint32_t lockModes = CAMERA_3A_NONE; - - switch (m_locksApplyMode) { - case IndependentMode: - if (m_currentLockTypes & QCamera::LockExposure) - lockModes |= CAMERA_3A_AUTOEXPOSURE; - if (m_currentLockTypes & QCamera::LockWhiteBalance) - lockModes |= CAMERA_3A_AUTOWHITEBALANCE; - if (m_currentLockTypes & QCamera::LockFocus) - lockModes |= CAMERA_3A_AUTOFOCUS; - break; - case FocusExposureBoundMode: - if ((m_currentLockTypes & QCamera::LockExposure) || (m_currentLockTypes & QCamera::LockFocus)) - lockModes = (CAMERA_3A_AUTOEXPOSURE | CAMERA_3A_AUTOFOCUS); - break; - case AllBoundMode: - lockModes = (CAMERA_3A_AUTOEXPOSURE | CAMERA_3A_AUTOFOCUS | CAMERA_3A_AUTOWHITEBALANCE); - break; - case FocusOnlyMode: - lockModes = CAMERA_3A_AUTOFOCUS; - break; - } - - const camera_error_t result = camera_set_3a_lock(m_handle, lockModes); - - if (result != CAMERA_EOK) - qWarning() << "Unable to set lock modes:" << result; -} - QUrl BbCameraSession::outputLocation() const { return QUrl::fromLocalFile(m_videoOutputLocation); @@ -822,37 +731,6 @@ void BbCameraSession::imageCaptured(int requestId, const QImage &rawImage, const } } -void BbCameraSession::handleFocusStatusChanged(int value) -{ - const camera_focusstate_t focusState = static_cast(value); - - switch (focusState) { - case CAMERA_FOCUSSTATE_NONE: - case CAMERA_FOCUSSTATE_WAITING: - m_focusLockStatus = QCamera::Unlocked; - emit lockStatusChanged(QCamera::LockFocus, QCamera::Unlocked, QCamera::UserRequest); - break; - case CAMERA_FOCUSSTATE_SEARCHING: - m_focusLockStatus = QCamera::Searching; - emit lockStatusChanged(QCamera::LockFocus, QCamera::Searching, QCamera::UserRequest); - break; - case CAMERA_FOCUSSTATE_FAILED: - m_focusLockStatus = QCamera::Unlocked; - emit lockStatusChanged(QCamera::LockFocus, QCamera::Unlocked, QCamera::LockFailed); - break; - case CAMERA_FOCUSSTATE_LOCKED: - m_focusLockStatus = QCamera::Locked; - emit lockStatusChanged(QCamera::LockFocus, QCamera::Locked, QCamera::LockAcquired); - break; - case CAMERA_FOCUSSTATE_SCENECHANGE: - m_focusLockStatus = QCamera::Unlocked; - emit lockStatusChanged(QCamera::LockFocus, QCamera::Unlocked, QCamera::LockTemporaryLost); - break; - default: - break; - } -} - void BbCameraSession::handleVideoRecordingPaused() { //TODO: implement once BB10 API supports pausing a video @@ -942,6 +820,8 @@ bool BbCameraSession::openCamera() m_status = QCamera::LoadedStatus; emit statusChanged(m_status); + emit cameraOpened(); + return true; } @@ -975,7 +855,7 @@ static void viewFinderStatusCallback(camera_handle_t handle, camera_devstatus_t if (status == CAMERA_STATUS_FOCUS_CHANGE) { BbCameraSession *session = static_cast(context); - QMetaObject::invokeMethod(session, "handleFocusStatusChanged", Qt::QueuedConnection, Q_ARG(int, value)); + QMetaObject::invokeMethod(session, "focusStatusChanged", Qt::QueuedConnection, Q_ARG(int, value)); return; } #ifndef Q_OS_BLACKBERRY_TABLET @@ -1006,28 +886,6 @@ bool BbCameraSession::startViewFinder() return false; } - // retrieve information about lock apply modes - { - int supported = 0; - uint32_t modes[20]; - - const camera_error_t result = camera_get_3a_lock_modes(m_handle, 20, &supported, modes); - - if (result == CAMERA_EOK) { - // see API documentation of camera_get_3a_lock_modes for explanation of case discrimination below - if (supported == 4) { - m_locksApplyMode = IndependentMode; - } else if (supported == 3) { - m_locksApplyMode = FocusExposureBoundMode; - } else if (supported == 2) { - if (modes[0] == (CAMERA_3A_AUTOFOCUS | CAMERA_3A_AUTOEXPOSURE | CAMERA_3A_AUTOWHITEBALANCE)) - m_locksApplyMode = AllBoundMode; - else - m_locksApplyMode = FocusOnlyMode; - } - } - } - const int angle = m_orientationHandler->orientation(); const QSize rotatedSize = ((angle == 0 || angle == 180) ? viewfinderResolution diff --git a/src/plugins/blackberry/camera/bbcamerasession.h b/src/plugins/blackberry/camera/bbcamerasession.h index f226d4245..e757a83c3 100644 --- a/src/plugins/blackberry/camera/bbcamerasession.h +++ b/src/plugins/blackberry/camera/bbcamerasession.h @@ -105,20 +105,6 @@ public: QImageEncoderSettings imageSettings() const; void setImageSettings(const QImageEncoderSettings &settings); - // locks control - enum LocksApplyMode - { - IndependentMode, - FocusExposureBoundMode, - AllBoundMode, - FocusOnlyMode - }; - - QCamera::LockTypes supportedLocks() const; - QCamera::LockStatus lockStatus(QCamera::LockType lock) const; - void searchAndLock(QCamera::LockTypes locks); - void unlock(QCamera::LockTypes locks); - // media recorder control QUrl outputLocation() const; bool setOutputLocation(const QUrl &location); @@ -157,9 +143,6 @@ Q_SIGNALS: // capture destination control void captureDestinationChanged(QCameraImageCapture::CaptureDestinations destination); - // locks control - void lockStatusChanged(QCamera::LockType type, QCamera::LockStatus status, QCamera::LockChangeReason reason); - // media recorder control void videoStateChanged(QMediaRecorder::State state); void videoStatusChanged(QMediaRecorder::Status status); @@ -167,10 +150,12 @@ Q_SIGNALS: void actualLocationChanged(const QUrl &location); void videoError(int error, const QString &errorString); + void cameraOpened(); + void focusStatusChanged(int status); + private slots: void updateReadyForCapture(); void imageCaptured(int, const QImage&, const QString&); - void handleFocusStatusChanged(int); void handleVideoRecordingPaused(); void handleVideoRecordingResumed(); void deviceOrientationChanged(int); @@ -210,10 +195,6 @@ private: QImageEncoderSettings m_imageEncoderSettings; - LocksApplyMode m_locksApplyMode; - QCamera::LockStatus m_focusLockStatus; - QCamera::LockTypes m_currentLockTypes; - QString m_videoOutputLocation; QMediaRecorder::State m_videoState; QMediaRecorder::Status m_videoStatus; -- cgit v1.2.3 From acbd998749db4c09801647b21fcb081937160e3a Mon Sep 17 00:00:00 2001 From: Yoann Lopes Date: Mon, 28 Oct 2013 16:50:59 +0100 Subject: WMF: emit positionChanged() signal when reaching the end of a media. This is necessary for QML MediaPlayer to report the correct position at the end of a media. Change-Id: Ifac2a721b850c726305d1a98e360da638b1fa87a Reviewed-by: Christian Stromme --- src/plugins/wmf/player/mfplayersession.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/plugins') diff --git a/src/plugins/wmf/player/mfplayersession.cpp b/src/plugins/wmf/player/mfplayersession.cpp index cca42e2ff..adc762d6e 100644 --- a/src/plugins/wmf/player/mfplayersession.cpp +++ b/src/plugins/wmf/player/mfplayersession.cpp @@ -1936,10 +1936,12 @@ void MFPlayerSession::handleSessionEvent(IMFMediaEvent *sessionEvent) m_request.command = CmdNone; m_request.prevCmd = CmdNone; - changeStatus(QMediaPlayer::EndOfMedia); m_varStart.vt = VT_I8; //keep reporting the final position after end of media m_varStart.hVal.QuadPart = m_duration; + emit positionChanged(position()); + + changeStatus(QMediaPlayer::EndOfMedia); break; case MEEndOfPresentationSegment: break; -- cgit v1.2.3 From 30cf028fb158f08bc01357476f73426c43c35b4e Mon Sep 17 00:00:00 2001 From: Yoann Lopes Date: Fri, 25 Oct 2013 15:07:02 +0200 Subject: Android: fix camera preview showing black frames after restarting it. Clear the camera preview size when stopping the preview in order to force it to be reset when starting it again. Task-number: QTBUG-34346 Change-Id: I0edf8d996348745b9aa7cf0790c16b6cd813b33b Reviewed-by: Christian Stromme --- src/plugins/android/src/mediacapture/qandroidcamerafocuscontrol.cpp | 4 ++++ src/plugins/android/src/mediacapture/qandroidcamerasession.cpp | 6 +++++- src/plugins/android/src/wrappers/jcamera.cpp | 6 ++++-- 3 files changed, 13 insertions(+), 3 deletions(-) (limited to 'src/plugins') diff --git a/src/plugins/android/src/mediacapture/qandroidcamerafocuscontrol.cpp b/src/plugins/android/src/mediacapture/qandroidcamerafocuscontrol.cpp index 899a3a499..345a29174 100644 --- a/src/plugins/android/src/mediacapture/qandroidcamerafocuscontrol.cpp +++ b/src/plugins/android/src/mediacapture/qandroidcamerafocuscontrol.cpp @@ -238,6 +238,10 @@ void QAndroidCameraFocusControl::updateFocusZones(QCameraFocusZone::FocusZoneSta return; QSize viewportSize = m_session->camera()->previewSize(); + + if (!viewportSize.isValid()) + return; + QSizeF focusSize(50.f / viewportSize.width(), 50.f / viewportSize.height()); float x = qBound(qreal(0), m_actualFocusPoint.x() - (focusSize.width() / 2), diff --git a/src/plugins/android/src/mediacapture/qandroidcamerasession.cpp b/src/plugins/android/src/mediacapture/qandroidcamerasession.cpp index 75b0c5e9b..075fe78e5 100644 --- a/src/plugins/android/src/mediacapture/qandroidcamerasession.cpp +++ b/src/plugins/android/src/mediacapture/qandroidcamerasession.cpp @@ -205,8 +205,11 @@ void QAndroidCameraSession::adjustViewfinderSize(const QSize &captureSize, bool QSize viewfinderResolution = m_camera->previewSize(); const qreal aspectRatio = qreal(captureSize.width()) / qreal(captureSize.height()); - if (qFuzzyCompare(aspectRatio, qreal(viewfinderResolution.width()) / qreal(viewfinderResolution.height()))) + if (viewfinderResolution.isValid() && + qFuzzyCompare(aspectRatio, + qreal(viewfinderResolution.width()) / viewfinderResolution.height())) { return; + } QList previewSizes = m_camera->getSupportedPreviewSizes(); for (int i = previewSizes.count() - 1; i >= 0; --i) { @@ -270,6 +273,7 @@ void QAndroidCameraSession::stopPreview() JMultimediaUtils::enableOrientationListener(false); m_camera->stopPreview(); + m_camera->setPreviewSize(QSize()); if (m_videoOutput) m_videoOutput->stop(); m_previewStarted = false; diff --git a/src/plugins/android/src/wrappers/jcamera.cpp b/src/plugins/android/src/wrappers/jcamera.cpp index f858f4702..fc9b18068 100644 --- a/src/plugins/android/src/wrappers/jcamera.cpp +++ b/src/plugins/android/src/wrappers/jcamera.cpp @@ -261,8 +261,10 @@ void JCamera::setPreviewSize(const QSize &size) m_previewSize = size; - m_parameters.callMethod("setPreviewSize", "(II)V", size.width(), size.height()); - applyParameters(); + if (m_previewSize.isValid()) { + m_parameters.callMethod("setPreviewSize", "(II)V", size.width(), size.height()); + applyParameters(); + } emit previewSizeChanged(); } -- cgit v1.2.3 From 4edc0cc3b9d7e56e59eab64d0576e8fd511c27c4 Mon Sep 17 00:00:00 2001 From: Yoann Lopes Date: Thu, 31 Oct 2013 11:57:16 +0100 Subject: DirectShow: fix compilation with MSVC 2008. Task-number: QTBUG-34479 Change-Id: I48ab0760273e08678be5f057e2b39db8cbe10cff Reviewed-by: Christian Stromme --- .../player/directshowmetadatacontrol.cpp | 70 +++++++++++----------- 1 file changed, 35 insertions(+), 35 deletions(-) (limited to 'src/plugins') diff --git a/src/plugins/directshow/player/directshowmetadatacontrol.cpp b/src/plugins/directshow/player/directshowmetadatacontrol.cpp index 3c81ae180..d60bce31a 100644 --- a/src/plugins/directshow/player/directshowmetadatacontrol.cpp +++ b/src/plugins/directshow/player/directshowmetadatacontrol.cpp @@ -389,86 +389,86 @@ void DirectShowMetaDataControl::updateGraph(IFilterGraph2 *graph, IBaseFilter *s if (FAILED(pStore->GetValue(key, &var))) continue; - if (key == PKEY_Author) { + if (IsEqualPropertyKey(key, PKEY_Author)) { m_metadata.insert(QMediaMetaData::Author, convertValue(var)); - } else if (key == PKEY_Title) { + } else if (IsEqualPropertyKey(key, PKEY_Title)) { m_metadata.insert(QMediaMetaData::Title, convertValue(var)); - } else if (key == PKEY_Media_SubTitle) { + } else if (IsEqualPropertyKey(key, PKEY_Media_SubTitle)) { m_metadata.insert(QMediaMetaData::SubTitle, convertValue(var)); - } else if (key == PKEY_ParentalRating) { + } else if (IsEqualPropertyKey(key, PKEY_ParentalRating)) { m_metadata.insert(QMediaMetaData::ParentalRating, convertValue(var)); - } else if (key == PKEY_Comment) { + } else if (IsEqualPropertyKey(key, PKEY_Comment)) { m_metadata.insert(QMediaMetaData::Description, convertValue(var)); - } else if (key == PKEY_Copyright) { + } else if (IsEqualPropertyKey(key, PKEY_Copyright)) { m_metadata.insert(QMediaMetaData::Copyright, convertValue(var)); - } else if (key == PKEY_Media_ProviderStyle) { + } else if (IsEqualPropertyKey(key, PKEY_Media_ProviderStyle)) { m_metadata.insert(QMediaMetaData::Genre, convertValue(var)); - } else if (key == PKEY_Media_Year) { + } else if (IsEqualPropertyKey(key, PKEY_Media_Year)) { m_metadata.insert(QMediaMetaData::Year, convertValue(var)); - } else if (key == PKEY_Media_DateEncoded) { + } else if (IsEqualPropertyKey(key, PKEY_Media_DateEncoded)) { m_metadata.insert(QMediaMetaData::Date, convertValue(var)); - } else if (key == PKEY_Rating) { + } else if (IsEqualPropertyKey(key, PKEY_Rating)) { m_metadata.insert(QMediaMetaData::UserRating, int((convertValue(var).toUInt() - 1) / qreal(98) * 100)); - } else if (key == PKEY_Keywords) { + } else if (IsEqualPropertyKey(key, PKEY_Keywords)) { m_metadata.insert(QMediaMetaData::Keywords, convertValue(var)); - } else if (key == PKEY_Language) { + } else if (IsEqualPropertyKey(key, PKEY_Language)) { m_metadata.insert(QMediaMetaData::Language, convertValue(var)); - } else if (key == PKEY_Media_Publisher) { + } else if (IsEqualPropertyKey(key, PKEY_Media_Publisher)) { m_metadata.insert(QMediaMetaData::Publisher, convertValue(var)); - } else if (key == PKEY_Media_Duration) { + } else if (IsEqualPropertyKey(key, PKEY_Media_Duration)) { m_metadata.insert(QMediaMetaData::Duration, (convertValue(var).toLongLong() + 10000) / 10000); - } else if (key == PKEY_Audio_EncodingBitrate) { + } else if (IsEqualPropertyKey(key, PKEY_Audio_EncodingBitrate)) { m_metadata.insert(QMediaMetaData::AudioBitRate, convertValue(var)); - } else if (key == PKEY_Media_AverageLevel) { + } else if (IsEqualPropertyKey(key, PKEY_Media_AverageLevel)) { m_metadata.insert(QMediaMetaData::AverageLevel, convertValue(var)); - } else if (key == PKEY_Audio_ChannelCount) { + } else if (IsEqualPropertyKey(key, PKEY_Audio_ChannelCount)) { m_metadata.insert(QMediaMetaData::ChannelCount, convertValue(var)); - } else if (key == PKEY_Audio_PeakValue) { + } else if (IsEqualPropertyKey(key, PKEY_Audio_PeakValue)) { m_metadata.insert(QMediaMetaData::PeakValue, convertValue(var)); - } else if (key == PKEY_Audio_SampleRate) { + } else if (IsEqualPropertyKey(key, PKEY_Audio_SampleRate)) { m_metadata.insert(QMediaMetaData::SampleRate, convertValue(var)); - } else if (key == PKEY_Music_AlbumTitle) { + } else if (IsEqualPropertyKey(key, PKEY_Music_AlbumTitle)) { m_metadata.insert(QMediaMetaData::AlbumTitle, convertValue(var)); - } else if (key == PKEY_Music_AlbumArtist) { + } else if (IsEqualPropertyKey(key, PKEY_Music_AlbumArtist)) { m_metadata.insert(QMediaMetaData::AlbumArtist, convertValue(var)); - } else if (key == PKEY_Music_Artist) { + } else if (IsEqualPropertyKey(key, PKEY_Music_Artist)) { m_metadata.insert(QMediaMetaData::ContributingArtist, convertValue(var)); - } else if (key == PKEY_Music_Composer) { + } else if (IsEqualPropertyKey(key, PKEY_Music_Composer)) { m_metadata.insert(QMediaMetaData::Composer, convertValue(var)); - } else if (key == PKEY_Music_Conductor) { + } else if (IsEqualPropertyKey(key, PKEY_Music_Conductor)) { m_metadata.insert(QMediaMetaData::Conductor, convertValue(var)); - } else if (key == PKEY_Music_Lyrics) { + } else if (IsEqualPropertyKey(key, PKEY_Music_Lyrics)) { m_metadata.insert(QMediaMetaData::Lyrics, convertValue(var)); - } else if (key == PKEY_Music_Mood) { + } else if (IsEqualPropertyKey(key, PKEY_Music_Mood)) { m_metadata.insert(QMediaMetaData::Mood, convertValue(var)); - } else if (key == PKEY_Music_TrackNumber) { + } else if (IsEqualPropertyKey(key, PKEY_Music_TrackNumber)) { m_metadata.insert(QMediaMetaData::TrackNumber, convertValue(var)); - } else if (key == PKEY_Music_Genre) { + } else if (IsEqualPropertyKey(key, PKEY_Music_Genre)) { m_metadata.insert(QMediaMetaData::Genre, convertValue(var)); - } else if (key == PKEY_ThumbnailStream) { + } else if (IsEqualPropertyKey(key, PKEY_ThumbnailStream)) { m_metadata.insert(QMediaMetaData::ThumbnailImage, convertValue(var)); - } else if (key == PKEY_Video_FrameHeight) { + } else if (IsEqualPropertyKey(key, PKEY_Video_FrameHeight)) { QSize res; res.setHeight(convertValue(var).toUInt()); if (SUCCEEDED(pStore->GetValue(PKEY_Video_FrameWidth, &var))) res.setWidth(convertValue(var).toUInt()); m_metadata.insert(QMediaMetaData::Resolution, res); - } else if (key == PKEY_Video_HorizontalAspectRatio) { + } else if (IsEqualPropertyKey(key, PKEY_Video_HorizontalAspectRatio)) { QSize aspectRatio; aspectRatio.setWidth(convertValue(var).toUInt()); if (SUCCEEDED(pStore->GetValue(PKEY_Video_VerticalAspectRatio, &var))) aspectRatio.setHeight(convertValue(var).toUInt()); m_metadata.insert(QMediaMetaData::PixelAspectRatio, aspectRatio); - } else if (key == PKEY_Video_FrameRate) { + } else if (IsEqualPropertyKey(key, PKEY_Video_FrameRate)) { m_metadata.insert(QMediaMetaData::VideoFrameRate, convertValue(var).toReal() / 1000); - } else if (key == PKEY_Video_EncodingBitrate) { + } else if (IsEqualPropertyKey(key, PKEY_Video_EncodingBitrate)) { m_metadata.insert(QMediaMetaData::VideoBitRate, convertValue(var)); - } else if (key == PKEY_Video_Director) { + } else if (IsEqualPropertyKey(key, PKEY_Video_Director)) { m_metadata.insert(QMediaMetaData::Director, convertValue(var)); - } else if (key == PKEY_Media_Writer) { + } else if (IsEqualPropertyKey(key, PKEY_Media_Writer)) { m_metadata.insert(QMediaMetaData::Writer, convertValue(var)); } -- cgit v1.2.3 From 27e6611c0e49d0474bb300496c03b342a9b2740d Mon Sep 17 00:00:00 2001 From: Frank Osterfeld Date: Mon, 4 Nov 2013 10:03:55 +0100 Subject: BB10: do not mix up pixel width and height This fixes the aspect ratio calculation for video windows. Change-Id: Ie4762b98ee805a41031e1ba88f5cd353426dfdf8 Reviewed-by: Bernd Weimer Reviewed-by: Tobias Koenig Reviewed-by: Thomas McGuire --- src/plugins/blackberry/mediaplayer/bbmetadata.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/plugins') diff --git a/src/plugins/blackberry/mediaplayer/bbmetadata.cpp b/src/plugins/blackberry/mediaplayer/bbmetadata.cpp index 680833e85..4b51633b1 100644 --- a/src/plugins/blackberry/mediaplayer/bbmetadata.cpp +++ b/src/plugins/blackberry/mediaplayer/bbmetadata.cpp @@ -64,8 +64,8 @@ static const char * trackKey = "md_title_track"; static const char * widthKey = "md_video_width"; static const char * heightKey = "md_video_height"; static const char * mediaTypeKey = "md_title_mediatype"; -static const char * pixelWidthKey = "md_video_pixel_height"; -static const char * pixelHeightKey = "md_video_pixel_width"; +static const char * pixelWidthKey = "md_video_pixel_width"; +static const char * pixelHeightKey = "md_video_pixel_height"; static const char * seekableKey = "md_title_seekable"; static const int mediaTypeAudioFlag = 4; -- cgit v1.2.3 From 2412c298d4e8c112a63eb1e3ec9b5f2789bd3eeb Mon Sep 17 00:00:00 2001 From: Yoann Lopes Date: Mon, 4 Nov 2013 19:14:22 +0100 Subject: Android: fix two race conditions in the media player. start() could be called before the media player was marked as prepared. When changing media, setMediaPath() could be called before the media player was reset. Task-number: QTBUG-34558 Change-Id: I886fd5f5008f76dcbc88c57d7b16a439b394d4a7 Reviewed-by: Christian Stromme --- .../src/org/qtproject/qt5/android/multimedia/QtAndroidMediaPlayer.java | 3 +-- src/plugins/android/src/mediaplayer/qandroidmediaplayercontrol.cpp | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'src/plugins') diff --git a/src/plugins/android/jar/src/org/qtproject/qt5/android/multimedia/QtAndroidMediaPlayer.java b/src/plugins/android/jar/src/org/qtproject/qt5/android/multimedia/QtAndroidMediaPlayer.java index 2ca07a63e..cd79c979c 100644 --- a/src/plugins/android/jar/src/org/qtproject/qt5/android/multimedia/QtAndroidMediaPlayer.java +++ b/src/plugins/android/jar/src/org/qtproject/qt5/android/multimedia/QtAndroidMediaPlayer.java @@ -159,7 +159,6 @@ public class QtAndroidMediaPlayer extends MediaPlayer public void onCompletion(final MediaPlayer mp) { onMediaPlayerInfoNative(MEDIA_PLAYER_FINISHED, 0, mID); - reset(); } } @@ -191,9 +190,9 @@ public class QtAndroidMediaPlayer extends MediaPlayer @Override public void onPrepared(final MediaPlayer mp) { + mPreparing = false; onMediaPlayerInfoNative(MEDIA_PLAYER_READY, 0, mID); onMediaPlayerInfoNative(MEDIA_PLAYER_DURATION, getDuration(), mID); - mPreparing = false; } } diff --git a/src/plugins/android/src/mediaplayer/qandroidmediaplayercontrol.cpp b/src/plugins/android/src/mediaplayer/qandroidmediaplayercontrol.cpp index 3f3b599ac..54c04e5c9 100644 --- a/src/plugins/android/src/mediaplayer/qandroidmediaplayercontrol.cpp +++ b/src/plugins/android/src/mediaplayer/qandroidmediaplayercontrol.cpp @@ -344,7 +344,7 @@ void QAndroidMediaPlayerControl::onMediaPlayerInfo(qint32 what, qint32 extra) Q_EMIT positionChanged(extra); break; case JMediaPlayer::MEDIA_PLAYER_FINISHED: - setState(QMediaPlayer::StoppedState); + stop(); setMediaStatus(QMediaPlayer::EndOfMedia); break; } -- cgit v1.2.3 From 301baf2b689bfdcc21a374b8831765a3fa63a174 Mon Sep 17 00:00:00 2001 From: Yoann Lopes Date: Wed, 6 Nov 2013 14:27:00 +0100 Subject: Android: use correct format when capturing a picture to a buffer. Don't decode the JPEG data to raw RGB using QImage. QCameraImageCapture reports anyway that JPEG is the only supported buffer format. Change-Id: Ib17760e4361b004775c002b686ef7529b3768aab Reviewed-by: Christian Stromme --- .../src/mediacapture/qandroidcamerasession.cpp | 49 +++++++++++++++++----- .../src/mediacapture/qandroidcamerasession.h | 1 + 2 files changed, 40 insertions(+), 10 deletions(-) (limited to 'src/plugins') diff --git a/src/plugins/android/src/mediacapture/qandroidcamerasession.cpp b/src/plugins/android/src/mediacapture/qandroidcamerasession.cpp index 075fe78e5..3a50139c3 100644 --- a/src/plugins/android/src/mediacapture/qandroidcamerasession.cpp +++ b/src/plugins/android/src/mediacapture/qandroidcamerasession.cpp @@ -52,6 +52,41 @@ QT_BEGIN_NAMESPACE +class DataVideoBuffer : public QAbstractVideoBuffer +{ +public: + DataVideoBuffer(const QByteArray &d) + : QAbstractVideoBuffer(NoHandle) + , data(d) + , mode(NotMapped) + { } + + MapMode mapMode() const { return mode; } + + uchar *map(MapMode m, int *numBytes, int *bytesPerLine) + { + if (mode != NotMapped || m == NotMapped) + return 0; + + mode = m; + + if (numBytes) + *numBytes = data.size(); + + if (bytesPerLine) + *bytesPerLine = -1; + + return reinterpret_cast(data.data()); + } + + void unmap() { mode = NotMapped; } + +private: + QByteArray data; + MapMode mode; +}; + + QAndroidCameraSession::QAndroidCameraSession(QObject *parent) : QObject(parent) , m_selectedCamera(0) @@ -463,6 +498,7 @@ void QAndroidCameraSession::onCameraPictureCaptured(const QByteArray &data) QtConcurrent::run(this, &QAndroidCameraSession::processCapturedImage, m_currentImageCaptureId, data, + m_imageSettings.resolution(), m_captureDestination, m_currentImageCaptureFileName); } @@ -477,6 +513,7 @@ void QAndroidCameraSession::onCameraPictureCaptured(const QByteArray &data) void QAndroidCameraSession::processCapturedImage(int id, const QByteArray &data, + const QSize &resolution, QCameraImageCapture::CaptureDestinations dest, const QString &fileName) { @@ -509,16 +546,8 @@ void QAndroidCameraSession::processCapturedImage(int id, } if (dest & QCameraImageCapture::CaptureToBuffer) { - QImage image; - const bool ok = image.loadFromData(data, "JPG"); - - if (ok) { - QVideoFrame frame(image); - emit imageAvailable(id, frame); - } else { - emit imageCaptureError(id, QCameraImageCapture::FormatError, - tr("Could not load JPEG data from captured image")); - } + QVideoFrame frame(new DataVideoBuffer(data), resolution, QVideoFrame::Format_Jpeg); + emit imageAvailable(id, frame); } } diff --git a/src/plugins/android/src/mediacapture/qandroidcamerasession.h b/src/plugins/android/src/mediacapture/qandroidcamerasession.h index de891522b..897cf52d1 100644 --- a/src/plugins/android/src/mediacapture/qandroidcamerasession.h +++ b/src/plugins/android/src/mediacapture/qandroidcamerasession.h @@ -127,6 +127,7 @@ private: void processPreviewImage(int id, const QByteArray &data); void processCapturedImage(int id, const QByteArray &data, + const QSize &resolution, QCameraImageCapture::CaptureDestinations dest, const QString &fileName); -- cgit v1.2.3 From 66219c9a289db01808a15b6416dea1b4cf9314dd Mon Sep 17 00:00:00 2001 From: Frank Osterfeld Date: Mon, 4 Nov 2013 15:52:43 +0100 Subject: Support plain QNX in mm-renderer mediaplayer impl On plain QNX, the native events are plain screen_event_t's, instead of being wrapped in bps_event_t. The bps/mm-renderer interface isn't available on QNX, thus those parts are replaced by reading directly from mm-renderer's PPS objects. Change-Id: I38772ddad04432ff099455a730ce0034f07db70d Reviewed-by: Thomas McGuire --- src/plugins/blackberry/blackberry.pro | 17 +- src/plugins/blackberry/common/windowgrabber.cpp | 70 +++++--- src/plugins/blackberry/common/windowgrabber.h | 2 + .../mediaplayer/bbmediaplayercontrol.cpp | 136 +++++++------- .../blackberry/mediaplayer/bbmediaplayercontrol.h | 27 ++- .../mediaplayer/bbmediaplayerservice.cpp | 10 +- .../mediaplayer/bbplayervideorenderercontrol.h | 1 - .../mediaplayer/bbvideowindowcontrol.cpp | 57 +++--- .../blackberry/mediaplayer/bbvideowindowcontrol.h | 3 +- .../mediaplayer/bpsmediaplayercontrol.cpp | 117 ++++++++++++ .../blackberry/mediaplayer/bpsmediaplayercontrol.h | 66 +++++++ src/plugins/blackberry/mediaplayer/mediaplayer.pri | 10 ++ .../mediaplayer/ppsmediaplayercontrol.cpp | 199 +++++++++++++++++++++ .../blackberry/mediaplayer/ppsmediaplayercontrol.h | 75 ++++++++ src/plugins/blackberry/neutrino_mediaservice.json | 4 + src/plugins/blackberry/neutrinoserviceplugin.cpp | 70 ++++++++ src/plugins/blackberry/neutrinoserviceplugin.h | 65 +++++++ src/plugins/plugins.pro | 5 +- 18 files changed, 780 insertions(+), 154 deletions(-) create mode 100644 src/plugins/blackberry/mediaplayer/bpsmediaplayercontrol.cpp create mode 100644 src/plugins/blackberry/mediaplayer/bpsmediaplayercontrol.h create mode 100644 src/plugins/blackberry/mediaplayer/ppsmediaplayercontrol.cpp create mode 100644 src/plugins/blackberry/mediaplayer/ppsmediaplayercontrol.h create mode 100644 src/plugins/blackberry/neutrino_mediaservice.json create mode 100644 src/plugins/blackberry/neutrinoserviceplugin.cpp create mode 100644 src/plugins/blackberry/neutrinoserviceplugin.h (limited to 'src/plugins') diff --git a/src/plugins/blackberry/blackberry.pro b/src/plugins/blackberry/blackberry.pro index e0a6233ce..fa1d07f80 100644 --- a/src/plugins/blackberry/blackberry.pro +++ b/src/plugins/blackberry/blackberry.pro @@ -7,13 +7,16 @@ load(qt_plugin) LIBS += -lscreen -HEADERS += bbserviceplugin.h -SOURCES += bbserviceplugin.cpp - include(common/common.pri) - -include(camera/camera.pri) - include(mediaplayer/mediaplayer.pri) -OTHER_FILES += blackberry_mediaservice.json +blackberry { + include(camera/camera.pri) + HEADERS += bbserviceplugin.h + SOURCES += bbserviceplugin.cpp + OTHER_FILES += blackberry_mediaservice.json +} else { + HEADERS += neutrinoserviceplugin.h + SOURCES += neutrinoserviceplugin.cpp + OTHER_FILES += neutrino_mediaservice.json +} diff --git a/src/plugins/blackberry/common/windowgrabber.cpp b/src/plugins/blackberry/common/windowgrabber.cpp index 144b5a693..5ed54b87e 100644 --- a/src/plugins/blackberry/common/windowgrabber.cpp +++ b/src/plugins/blackberry/common/windowgrabber.cpp @@ -47,7 +47,10 @@ #include #include +#ifdef Q_OS_BLACKBERRY +#include #include +#endif #include QT_BEGIN_NAMESPACE @@ -232,40 +235,55 @@ void WindowGrabber::resume() m_timer.start(); } -bool WindowGrabber::nativeEventFilter(const QByteArray&, void *message, long*) +bool WindowGrabber::handleScreenEvent(screen_event_t screen_event) { - bps_event_t * const event = static_cast(message); - if (event && bps_event_get_domain(event) == screen_get_domain()) { - const screen_event_t screen_event = screen_event_get_event(event); + int eventType; + if (screen_get_event_property_iv(screen_event, SCREEN_PROPERTY_TYPE, &eventType) != 0) { + qWarning() << "WindowGrabber: Failed to query screen event type"; + return false; + } - int eventType; - if (screen_get_event_property_iv(screen_event, SCREEN_PROPERTY_TYPE, &eventType) != 0) { - qWarning() << "WindowGrabber: Failed to query screen event type"; - return false; - } + if (eventType != SCREEN_EVENT_CREATE) + return false; - if (eventType != SCREEN_EVENT_CREATE) - return false; + screen_window_t window = 0; + if (screen_get_event_property_pv(screen_event, SCREEN_PROPERTY_WINDOW, (void**)&window) != 0) { + qWarning() << "WindowGrabber: Failed to query window property"; + return false; + } - screen_window_t window = 0; - if (screen_get_event_property_pv(screen_event, SCREEN_PROPERTY_WINDOW, (void**)&window) != 0) { - qWarning() << "WindowGrabber: Failed to query window property"; - return false; - } + const int maxIdStrLength = 128; + char idString[maxIdStrLength]; + if (screen_get_window_property_cv(window, SCREEN_PROPERTY_ID_STRING, maxIdStrLength, idString) != 0) { + qWarning() << "WindowGrabber: Failed to query window ID string"; + return false; + } - const int maxIdStrLength = 128; - char idString[maxIdStrLength]; - if (screen_get_window_property_cv(window, SCREEN_PROPERTY_ID_STRING, maxIdStrLength, idString) != 0) { - qWarning() << "WindowGrabber: Failed to query window ID string"; - return false; - } + if (m_windowId == idString) { + m_window = window; + start(); + } - if (m_windowId == idString) { - m_window = window; - start(); - } + return false; +} + +bool WindowGrabber::nativeEventFilter(const QByteArray &eventType, void *message, long*) +{ +#ifdef Q_OS_BLACKBERRY + Q_UNUSED(eventType) + bps_event_t * const event = static_cast(message); + + if (event && bps_event_get_domain(event) == screen_get_domain()) { + const screen_event_t screen_event = screen_event_get_event(event); + return handleScreenEvent(screen_event); } +#else + if (eventType == "screen_event_t") { + const screen_event_t event = static_cast(message); + return handleScreenEvent(event); + } +#endif return false; } diff --git a/src/plugins/blackberry/common/windowgrabber.h b/src/plugins/blackberry/common/windowgrabber.h index f8e3686a2..7ec4202a2 100644 --- a/src/plugins/blackberry/common/windowgrabber.h +++ b/src/plugins/blackberry/common/windowgrabber.h @@ -69,6 +69,8 @@ public: bool nativeEventFilter(const QByteArray &eventType, void *message, long *result) Q_DECL_OVERRIDE; + bool handleScreenEvent(screen_event_t event); + QByteArray windowGroupId() const; signals: diff --git a/src/plugins/blackberry/mediaplayer/bbmediaplayercontrol.cpp b/src/plugins/blackberry/mediaplayer/bbmediaplayercontrol.cpp index c7a0fdd02..6304b66d7 100644 --- a/src/plugins/blackberry/mediaplayer/bbmediaplayercontrol.cpp +++ b/src/plugins/blackberry/mediaplayer/bbmediaplayercontrol.cpp @@ -49,8 +49,7 @@ #include #include #include -#include -#include + #include #include #include @@ -69,7 +68,6 @@ BbMediaPlayerControl::BbMediaPlayerControl(QObject *parent) m_muted(false), m_rate(1), m_id(-1), - m_eventMonitor(0), m_position(0), m_mediaStatus(QMediaPlayer::NoMedia), m_playAfterMediaLoaded(false), @@ -81,10 +79,9 @@ BbMediaPlayerControl::BbMediaPlayerControl(QObject *parent) m_loadingTimer.setInterval(0); connect(&m_loadingTimer, SIGNAL(timeout()), this, SLOT(continueLoadMedia())); QCoreApplication::eventDispatcher()->installNativeEventFilter(this); - openConnection(); } -BbMediaPlayerControl::~BbMediaPlayerControl() +void BbMediaPlayerControl::destroy() { stop(); detach(); @@ -111,19 +108,41 @@ void BbMediaPlayerControl::openConnection() return; } - m_eventMonitor = mmrenderer_request_events(m_contextName.toLatin1(), 0, m_id); - if (!m_eventMonitor) { - qDebug() << "Unable to request multimedia events"; - emit error(0, "Unable to request multimedia events"); + startMonitoring(m_id, m_contextName); +} + +void BbMediaPlayerControl::handleMmStatusUpdate(qint64 newPosition) +{ + // Prevent spurious position change events from overriding our own position, for example + // when setting the position to 0 in stop(). + // Also, don't change the position while we're loading the media, as then play() would + // set a wrong initial position. + if (m_state != QMediaPlayer::PlayingState || + m_mediaStatus == QMediaPlayer::LoadingMedia || + m_mediaStatus == QMediaPlayer::NoMedia || + m_mediaStatus == QMediaPlayer::InvalidMedia) + return; + + setMmPosition(newPosition); +} + +void BbMediaPlayerControl::handleMmStopped() +{ + // Only react to stop events that happen when the end of the stream is reached and + // playback is stopped because of this. + // Ignore other stop event sources, souch as calling mmr_stop() ourselves and + // mmr_input_attach(). + if (m_stopEventsToIgnore > 0) { + --m_stopEventsToIgnore; + } else { + setMediaStatus(QMediaPlayer::EndOfMedia); + stopInternal(IgnoreMmRenderer); } } void BbMediaPlayerControl::closeConnection() { - if (m_eventMonitor) { - mmrenderer_stop_events(m_eventMonitor); - m_eventMonitor = 0; - } + stopMonitoring(); if (m_context) { mmr_context_destroy(m_context); @@ -468,6 +487,16 @@ void BbMediaPlayerControl::continueLoadMedia() play(); } +QString BbMediaPlayerControl::contextName() const +{ + return m_contextName; +} + +BbVideoWindowControl *BbMediaPlayerControl::videoWindowControl() const +{ + return m_videoWindowControl; +} + void BbMediaPlayerControl::play() { if (m_playAfterMediaLoaded) @@ -526,6 +555,11 @@ void BbMediaPlayerControl::stop() stopInternal(StopMmRenderer); } +BbPlayerVideoRendererControl *BbMediaPlayerControl::videoRendererControl() const +{ + return m_videoRendererControl; +} + void BbMediaPlayerControl::setVideoRendererControl(BbPlayerVideoRendererControl *videoControl) { m_videoRendererControl = videoControl; @@ -541,71 +575,25 @@ void BbMediaPlayerControl::setMetaDataReaderControl(BbMetaDataReaderControl *met m_metaDataReaderControl = metaDataReaderControl; } -bool BbMediaPlayerControl::nativeEventFilter(const QByteArray &eventType, void *message, long *result) +void BbMediaPlayerControl::setMmPosition(qint64 newPosition) { - Q_UNUSED(eventType); - Q_UNUSED(result); - - bps_event_t * const event = static_cast(message); - if (!event || - (bps_event_get_domain(event) != mmrenderer_get_domain() && - bps_event_get_domain(event) != screen_get_domain())) - return false; - - if (m_videoWindowControl) - m_videoWindowControl->bpsEventHandler(event); - - if (bps_event_get_domain(event) == mmrenderer_get_domain()) { - if (bps_event_get_code(event) == MMRENDERER_STATE_CHANGE) { - const mmrenderer_state_t newState = mmrenderer_event_get_state(event); - if (newState == MMR_STOPPED) { - - // Only react to stop events that happen when the end of the stream is reached and - // playback is stopped because of this. - // Ignore other stop event sources, souch as calling mmr_stop() ourselves and - // mmr_input_attach(). - if (m_stopEventsToIgnore > 0) { - --m_stopEventsToIgnore; - } else { - setMediaStatus(QMediaPlayer::EndOfMedia); - stopInternal(IgnoreMmRenderer); - } - return false; - } - } - - if (bps_event_get_code(event) == MMRENDERER_STATUS_UPDATE) { - - // Prevent spurious position change events from overriding our own position, for example - // when setting the position to 0 in stop(). - // Also, don't change the position while we're loading the media, as then play() would - // set a wrong initial position. - if (m_state != QMediaPlayer::PlayingState || - m_mediaStatus == QMediaPlayer::LoadingMedia || - m_mediaStatus == QMediaPlayer::NoMedia || - m_mediaStatus == QMediaPlayer::InvalidMedia) - return false; - - const qint64 newPosition = QString::fromLatin1(mmrenderer_event_get_position(event)).toLongLong(); - if (newPosition != 0 && newPosition != m_position) { - m_position = newPosition; - emit positionChanged(m_position); - } + if (newPosition != 0 && newPosition != m_position) { + m_position = newPosition; + emit positionChanged(m_position); + } +} - const QString bufferStatus = QString::fromLatin1(mmrenderer_event_get_bufferlevel(event)); - const int slashPos = bufferStatus.indexOf('/'); - if (slashPos != -1) { - const int fill = bufferStatus.left(slashPos).toInt(); - const int capacity = bufferStatus.mid(slashPos + 1).toInt(); - if (capacity != 0) { - m_bufferStatus = fill / static_cast(capacity) * 100.0f; - emit bufferStatusChanged(m_bufferStatus); - } - } +void BbMediaPlayerControl::setMmBufferStatus(const QString &bufferStatus) +{ + const int slashPos = bufferStatus.indexOf('/'); + if (slashPos != -1) { + const int fill = bufferStatus.left(slashPos).toInt(); + const int capacity = bufferStatus.mid(slashPos + 1).toInt(); + if (capacity != 0) { + m_bufferStatus = fill / static_cast(capacity) * 100.0f; + emit bufferStatusChanged(m_bufferStatus); } } - - return false; } void BbMediaPlayerControl::updateMetaData() diff --git a/src/plugins/blackberry/mediaplayer/bbmediaplayercontrol.h b/src/plugins/blackberry/mediaplayer/bbmediaplayercontrol.h index 16505fd5e..6d6f5e817 100644 --- a/src/plugins/blackberry/mediaplayer/bbmediaplayercontrol.h +++ b/src/plugins/blackberry/mediaplayer/bbmediaplayercontrol.h @@ -47,7 +47,6 @@ #include #include -struct bps_event_t; typedef struct mmr_connection mmr_connection_t; typedef struct mmr_context mmr_context_t; typedef struct mmrenderer_monitor mmrenderer_monitor_t; @@ -63,7 +62,6 @@ class BbMediaPlayerControl : public QMediaPlayerControl, public QAbstractNativeE Q_OBJECT public: explicit BbMediaPlayerControl(QObject *parent = 0); - ~BbMediaPlayerControl(); QMediaPlayer::State state() const Q_DECL_OVERRIDE; @@ -100,25 +98,39 @@ public: void pause() Q_DECL_OVERRIDE; void stop() Q_DECL_OVERRIDE; + BbPlayerVideoRendererControl *videoRendererControl() const; void setVideoRendererControl(BbPlayerVideoRendererControl *videoControl); + + BbVideoWindowControl *videoWindowControl() const; void setVideoWindowControl(BbVideoWindowControl *videoControl); void setMetaDataReaderControl(BbMetaDataReaderControl *metaDataReaderControl); - bool nativeEventFilter(const QByteArray &eventType, void *message, long *result) Q_DECL_OVERRIDE; + +protected: + virtual void startMonitoring(int contextId, const QString &contextName) = 0; + virtual void stopMonitoring() = 0; + + QString contextName() const; + void openConnection(); + void emitMmError(const QString &msg); + void emitPError(const QString &msg); + void setMmPosition(qint64 newPosition); + void setMmBufferStatus(const QString &bufferStatus); + void handleMmStopped(); + void handleMmStatusUpdate(qint64 position); + + // must be called from subclass dtors (calls virtual function stopMonitoring()) + void destroy(); private Q_SLOTS: void continueLoadMedia(); private: QByteArray resourcePathForUrl(const QUrl &url); - void openConnection(); void closeConnection(); void attach(); void detach(); void updateMetaData(); - void emitMmError(const QString &msg); - void emitPError(const QString &msg); - // All these set the specified value to the backend, but neither emit changed signals // nor change the member value. void setVolumeInternal(int newVolume); @@ -145,7 +157,6 @@ private: QPointer m_metaDataReaderControl; BbMetaData m_metaData; int m_id; - mmrenderer_monitor_t *m_eventMonitor; qint64 m_position; QMediaPlayer::MediaStatus m_mediaStatus; bool m_playAfterMediaLoaded; diff --git a/src/plugins/blackberry/mediaplayer/bbmediaplayerservice.cpp b/src/plugins/blackberry/mediaplayer/bbmediaplayerservice.cpp index 5846cc020..5eb2ae6a6 100644 --- a/src/plugins/blackberry/mediaplayer/bbmediaplayerservice.cpp +++ b/src/plugins/blackberry/mediaplayer/bbmediaplayerservice.cpp @@ -46,6 +46,14 @@ #include "bbutil.h" #include "bbvideowindowcontrol.h" +#ifdef Q_OS_BLACKBERRY +#include "bpsmediaplayercontrol.h" +typedef BpsMediaPlayerControl PlatformSpecificMediaPlayerControl; +#else +#include "ppsmediaplayercontrol.h" +typedef PpsMediaPlayerControl PlatformSpecificMediaPlayerControl; +#endif + QT_BEGIN_NAMESPACE BbMediaPlayerService::BbMediaPlayerService(QObject *parent) @@ -72,7 +80,7 @@ QMediaControl *BbMediaPlayerService::requestControl(const char *name) { if (qstrcmp(name, QMediaPlayerControl_iid) == 0) { if (!m_mediaPlayerControl) { - m_mediaPlayerControl = new BbMediaPlayerControl(); + m_mediaPlayerControl = new PlatformSpecificMediaPlayerControl; updateControls(); } return m_mediaPlayerControl; diff --git a/src/plugins/blackberry/mediaplayer/bbplayervideorenderercontrol.h b/src/plugins/blackberry/mediaplayer/bbplayervideorenderercontrol.h index fff80dfe8..a2deaa27c 100644 --- a/src/plugins/blackberry/mediaplayer/bbplayervideorenderercontrol.h +++ b/src/plugins/blackberry/mediaplayer/bbplayervideorenderercontrol.h @@ -46,7 +46,6 @@ #include typedef struct mmr_context mmr_context_t; -struct bps_event_t; QT_BEGIN_NAMESPACE diff --git a/src/plugins/blackberry/mediaplayer/bbvideowindowcontrol.cpp b/src/plugins/blackberry/mediaplayer/bbvideowindowcontrol.cpp index 8c1ca19dc..28029c9b1 100644 --- a/src/plugins/blackberry/mediaplayer/bbvideowindowcontrol.cpp +++ b/src/plugins/blackberry/mediaplayer/bbvideowindowcontrol.cpp @@ -46,7 +46,6 @@ #include #include #include -#include QT_BEGIN_NAMESPACE @@ -368,42 +367,38 @@ void BbVideoWindowControl::setMetaData(const BbMetaData &metaData) updateVideoPosition(); } -void BbVideoWindowControl::bpsEventHandler(bps_event_t *event) +void BbVideoWindowControl::screenEventHandler(const screen_event_t &screen_event) { - if (event && bps_event_get_domain(event) == screen_get_domain()) { - const screen_event_t screen_event = screen_event_get_event(event); - - int eventType; - if (screen_get_event_property_iv(screen_event, SCREEN_PROPERTY_TYPE, &eventType) != 0) { - perror("BbVideoWindowControl: Failed to query screen event type"); - return; - } + int eventType; + if (screen_get_event_property_iv(screen_event, SCREEN_PROPERTY_TYPE, &eventType) != 0) { + perror("BbVideoWindowControl: Failed to query screen event type"); + return; + } - if (eventType != SCREEN_EVENT_CREATE) - return; + if (eventType != SCREEN_EVENT_CREATE) + return; - screen_window_t window = 0; - if (screen_get_event_property_pv(screen_event, SCREEN_PROPERTY_WINDOW, (void**)&window) != 0) { - perror("BbVideoWindowControl: Failed to query window property"); - return; - } + screen_window_t window = 0; + if (screen_get_event_property_pv(screen_event, SCREEN_PROPERTY_WINDOW, (void**)&window) != 0) { + perror("BbVideoWindowControl: Failed to query window property"); + return; + } - const int maxIdStrLength = 128; - char idString[maxIdStrLength]; - if (screen_get_window_property_cv(window, SCREEN_PROPERTY_ID_STRING, maxIdStrLength, idString) != 0) { - perror("BbVideoWindowControl: Failed to query window ID string"); - return; - } + const int maxIdStrLength = 128; + char idString[maxIdStrLength]; + if (screen_get_window_property_cv(window, SCREEN_PROPERTY_ID_STRING, maxIdStrLength, idString) != 0) { + perror("BbVideoWindowControl: Failed to query window ID string"); + return; + } - if (m_windowName == idString) { - m_window = window; - updateVideoPosition(); + if (m_windowName == idString) { + m_window = window; + updateVideoPosition(); - const int visibleFlag = 1; - if (screen_set_window_property_iv(m_window, SCREEN_PROPERTY_VISIBLE, &visibleFlag) != 0) { - perror("BbVideoWindowControl: Failed to make window visible"); - return; - } + const int visibleFlag = 1; + if (screen_set_window_property_iv(m_window, SCREEN_PROPERTY_VISIBLE, &visibleFlag) != 0) { + perror("BbVideoWindowControl: Failed to make window visible"); + return; } } } diff --git a/src/plugins/blackberry/mediaplayer/bbvideowindowcontrol.h b/src/plugins/blackberry/mediaplayer/bbvideowindowcontrol.h index 81bf79682..98751d3ec 100644 --- a/src/plugins/blackberry/mediaplayer/bbvideowindowcontrol.h +++ b/src/plugins/blackberry/mediaplayer/bbvideowindowcontrol.h @@ -46,7 +46,6 @@ #include typedef struct mmr_context mmr_context_t; -struct bps_event_t; QT_BEGIN_NAMESPACE @@ -91,7 +90,7 @@ public: void detachDisplay(); void attachDisplay(mmr_context_t *context); void setMetaData(const BbMetaData &metaData); - void bpsEventHandler(bps_event_t *event); + void screenEventHandler(const screen_event_t &event); private: QWindow *findWindow(WId id) const; diff --git a/src/plugins/blackberry/mediaplayer/bpsmediaplayercontrol.cpp b/src/plugins/blackberry/mediaplayer/bpsmediaplayercontrol.cpp new file mode 100644 index 000000000..7345d8a38 --- /dev/null +++ b/src/plugins/blackberry/mediaplayer/bpsmediaplayercontrol.cpp @@ -0,0 +1,117 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Research In Motion +** Contact: http://www.qt-project.org/legal +** +** This file is part of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "bpsmediaplayercontrol.h" +#include "bbvideowindowcontrol.h" + +#include +#include + +QT_BEGIN_NAMESPACE + +BpsMediaPlayerControl::BpsMediaPlayerControl(QObject *parent) + : BbMediaPlayerControl(parent), + m_eventMonitor(0) +{ + openConnection(); +} + +BpsMediaPlayerControl::~BpsMediaPlayerControl() +{ + destroy(); +} + +void BpsMediaPlayerControl::startMonitoring(int contextId, const QString &contextName) +{ + m_eventMonitor = mmrenderer_request_events(contextName.toLatin1().constData(), 0, contextId); + if (!m_eventMonitor) { + qDebug() << "Unable to request multimedia events"; + emit error(0, "Unable to request multimedia events"); + } +} + +void BpsMediaPlayerControl::stopMonitoring() +{ + if (m_eventMonitor) { + mmrenderer_stop_events(m_eventMonitor); + m_eventMonitor = 0; + } +} + +bool BpsMediaPlayerControl::nativeEventFilter(const QByteArray &eventType, void *message, long *result) +{ + Q_UNUSED(result) + Q_UNUSED(eventType) + + bps_event_t * const event = static_cast(message); + if (!event || + (bps_event_get_domain(event) != mmrenderer_get_domain() && + bps_event_get_domain(event) != screen_get_domain())) + return false; + + if (event && bps_event_get_domain(event) == screen_get_domain()) { + const screen_event_t screen_event = screen_event_get_event(event); + if (BbVideoWindowControl *control = videoWindowControl()) + control->screenEventHandler(screen_event); + } + + if (bps_event_get_domain(event) == mmrenderer_get_domain()) { + if (bps_event_get_code(event) == MMRENDERER_STATE_CHANGE) { + const mmrenderer_state_t newState = mmrenderer_event_get_state(event); + if (newState == MMR_STOPPED) { + handleMmStopped(); + return false; + } + } + + if (bps_event_get_code(event) == MMRENDERER_STATUS_UPDATE) { + const qint64 newPosition = QString::fromLatin1(mmrenderer_event_get_position(event)).toLongLong(); + handleMmStatusUpdate(newPosition); + + const QString bufferStatus = QString::fromLatin1(mmrenderer_event_get_bufferlevel(event)); + setMmBufferStatus(bufferStatus); + } + } + + return false; +} + +QT_END_NAMESPACE diff --git a/src/plugins/blackberry/mediaplayer/bpsmediaplayercontrol.h b/src/plugins/blackberry/mediaplayer/bpsmediaplayercontrol.h new file mode 100644 index 000000000..a2d4e0952 --- /dev/null +++ b/src/plugins/blackberry/mediaplayer/bpsmediaplayercontrol.h @@ -0,0 +1,66 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Research In Motion +** Contact: http://www.qt-project.org/legal +** +** This file is part of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#ifndef BPSMEDIAPLAYERCONTROL_H +#define BPSMEDIAPLAYERCONTROL_H + +#include "bbmediaplayercontrol.h" + +QT_BEGIN_NAMESPACE + +class BpsMediaPlayerControl Q_DECL_FINAL : public BbMediaPlayerControl +{ + Q_OBJECT +public: + explicit BpsMediaPlayerControl(QObject *parent = 0); + ~BpsMediaPlayerControl(); + + void startMonitoring(int contextId, const QString &contextName) Q_DECL_OVERRIDE; + void stopMonitoring() Q_DECL_OVERRIDE; + + bool nativeEventFilter(const QByteArray &eventType, void *message, long *result) Q_DECL_OVERRIDE; + +private: + mmrenderer_monitor_t *m_eventMonitor; +}; + +QT_END_NAMESPACE + +#endif diff --git a/src/plugins/blackberry/mediaplayer/mediaplayer.pri b/src/plugins/blackberry/mediaplayer/mediaplayer.pri index 065c799a6..c5d012e50 100644 --- a/src/plugins/blackberry/mediaplayer/mediaplayer.pri +++ b/src/plugins/blackberry/mediaplayer/mediaplayer.pri @@ -19,3 +19,13 @@ SOURCES += \ $$PWD/bbvideowindowcontrol.cpp LIBS += -lmmrndclient -lstrm + +blackberry { + HEADERS += $$PWD/bpsmediaplayercontrol.h + SOURCES += $$PWD/bpsmediaplayercontrol.cpp +} else { + HEADERS += $$PWD/ppsmediaplayercontrol.h + SOURCES += $$PWD/ppsmediaplayercontrol.cpp + QT += core-private + LIBS += -lpps +} diff --git a/src/plugins/blackberry/mediaplayer/ppsmediaplayercontrol.cpp b/src/plugins/blackberry/mediaplayer/ppsmediaplayercontrol.cpp new file mode 100644 index 000000000..889819b59 --- /dev/null +++ b/src/plugins/blackberry/mediaplayer/ppsmediaplayercontrol.cpp @@ -0,0 +1,199 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Research In Motion +** Contact: http://www.qt-project.org/legal +** +** This file is part of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "ppsmediaplayercontrol.h" +#include "bbvideowindowcontrol.h" + +#include +#include +#include + +#include +#include + +QT_BEGIN_NAMESPACE + +PpsMediaPlayerControl::PpsMediaPlayerControl(QObject *parent) + : BbMediaPlayerControl(parent), + m_ppsStatusNotifier(0), + m_ppsStatusFd(-1), + m_ppsStateNotifier(0), + m_ppsStateFd(-1) + , m_previouslySeenState("STOPPED") +{ + openConnection(); +} + +PpsMediaPlayerControl::~PpsMediaPlayerControl() +{ + destroy(); +} + +void PpsMediaPlayerControl::startMonitoring(int, const QString &contextName) +{ + const QString ppsContextPath = QStringLiteral("/pps/services/multimedia/renderer/context/%1/").arg(contextName); + const QString ppsStatusPath = ppsContextPath + QStringLiteral("/status"); + + Q_ASSERT(m_ppsStatusFd == -1); + errno = 0; + m_ppsStatusFd = qt_safe_open(QFile::encodeName(ppsStatusPath).constData(), O_RDONLY); + if (m_ppsStatusFd == -1) { + emitPError(QStringLiteral("Unable to open %1: %2").arg(ppsStatusPath, qt_error_string(errno))); + return; + } + + Q_ASSERT(!m_ppsStatusNotifier); + m_ppsStatusNotifier = new QSocketNotifier(m_ppsStatusFd, QSocketNotifier::Read); + connect(m_ppsStatusNotifier, SIGNAL(activated(int)), this, SLOT(ppsReadyRead(int))); + + + const QString ppsStatePath = ppsContextPath + QStringLiteral("/state"); + + Q_ASSERT(m_ppsStateFd == -1); + errno = 0; + m_ppsStateFd = qt_safe_open(QFile::encodeName(ppsStatePath).constData(), O_RDONLY); + if (m_ppsStateFd == -1) { + emitPError(QStringLiteral("Unable to open %1: %2").arg(ppsStatePath, qt_error_string(errno))); + return; + } + + Q_ASSERT(!m_ppsStateNotifier); + m_ppsStateNotifier = new QSocketNotifier(m_ppsStateFd, QSocketNotifier::Read); + connect(m_ppsStateNotifier, SIGNAL(activated(int)), this, SLOT(ppsReadyRead(int))); + + //ensure we receive any initial state + ppsReadyRead(m_ppsStatusFd); + ppsReadyRead(m_ppsStateFd); +} + +void PpsMediaPlayerControl::stopMonitoring() +{ + + if (m_ppsStatusFd != -1) { + ::close(m_ppsStatusFd); + m_ppsStatusFd = -1; + } + + delete m_ppsStatusNotifier; + m_ppsStatusNotifier = 0; + + if (m_ppsStateFd != -1) { + ::close(m_ppsStateFd); + m_ppsStateFd = -1; + } + + delete m_ppsStateNotifier; + m_ppsStateNotifier = 0; +} + +bool PpsMediaPlayerControl::nativeEventFilter(const QByteArray &eventType, void *message, long *result) +{ + Q_UNUSED(result) + if (eventType == "screen_event_t") { + screen_event_t event = static_cast(message); + if (BbVideoWindowControl *control = videoWindowControl()) + control->screenEventHandler(event); + } + + return false; +} + +void PpsMediaPlayerControl::ppsReadyRead(int fd) +{ + Q_ASSERT(fd == m_ppsStateFd || fd == m_ppsStatusFd); + const int bufferSize = 2048; + char buffer[bufferSize]; + const ssize_t nread = qt_safe_read(fd, buffer, bufferSize - 1); + if (nread < 0) { + //TODO emit error? + } + + if (nread == 0) { + return; + } + + // nread is the real space necessary, not the amount read. + if (static_cast(nread) > bufferSize - 1) { + //TODO emit error? + qCritical("BBMediaPlayerControl: PPS buffer size too short; need %u.", nread + 1); + return; + } + + buffer[nread] = 0; + + pps_decoder_t decoder; + + if (pps_decoder_initialize(&decoder, buffer) != PPS_DECODER_OK) { + //TODO emit error? + qCritical("Could not initialize pps_decoder"); + pps_decoder_cleanup(&decoder); + return; + } + + pps_decoder_push(&decoder, 0); + + const char *value = 0; + if (pps_decoder_get_string(&decoder, "bufferlevel", &value) == PPS_DECODER_OK) { + setMmBufferStatus(QString::fromLatin1(value)); + } + + if (pps_decoder_get_string(&decoder, "state", &value) == PPS_DECODER_OK) { + const QByteArray state = value; + if (state != m_previouslySeenState && state == "STOPPED") + handleMmStopped(); + m_previouslySeenState = state; + } + + if (pps_decoder_get_string(&decoder, "position", &value) == PPS_DECODER_OK) { + const QByteArray valueBa = QByteArray(value); + bool ok; + const qint64 position = valueBa.toLongLong(&ok); + if (!ok) { + qCritical("Could not parse position from '%s'", valueBa.constData()); + } else { + setMmPosition(position); + } + } + + pps_decoder_cleanup(&decoder); +} + +QT_END_NAMESPACE diff --git a/src/plugins/blackberry/mediaplayer/ppsmediaplayercontrol.h b/src/plugins/blackberry/mediaplayer/ppsmediaplayercontrol.h new file mode 100644 index 000000000..20da63968 --- /dev/null +++ b/src/plugins/blackberry/mediaplayer/ppsmediaplayercontrol.h @@ -0,0 +1,75 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Research In Motion +** Contact: http://www.qt-project.org/legal +** +** This file is part of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#ifndef PPSMEDIAPLAYERCONTROL_H +#define PPSMEDIAPLAYERCONTROL_H + +#include "bbmediaplayercontrol.h" + +QT_BEGIN_NAMESPACE + +class QSocketNotifier; + +class PpsMediaPlayerControl Q_DECL_FINAL : public BbMediaPlayerControl +{ + Q_OBJECT +public: + explicit PpsMediaPlayerControl(QObject *parent = 0); + ~PpsMediaPlayerControl(); + + void startMonitoring(int contextId, const QString &contextName) Q_DECL_OVERRIDE; + void stopMonitoring() Q_DECL_OVERRIDE; + + bool nativeEventFilter(const QByteArray &eventType, void *message, long *result) Q_DECL_OVERRIDE; + +private Q_SLOTS: + void ppsReadyRead(int fd); + +private: + QSocketNotifier *m_ppsStatusNotifier; + int m_ppsStatusFd; + QSocketNotifier *m_ppsStateNotifier; + int m_ppsStateFd; + QByteArray m_previouslySeenState; +}; + +QT_END_NAMESPACE + +#endif diff --git a/src/plugins/blackberry/neutrino_mediaservice.json b/src/plugins/blackberry/neutrino_mediaservice.json new file mode 100644 index 000000000..919368d73 --- /dev/null +++ b/src/plugins/blackberry/neutrino_mediaservice.json @@ -0,0 +1,4 @@ +{ + "Keys": ["neutrinomultimedia"], + "Services": ["org.qt-project.qt.mediaplayer"] +} diff --git a/src/plugins/blackberry/neutrinoserviceplugin.cpp b/src/plugins/blackberry/neutrinoserviceplugin.cpp new file mode 100644 index 000000000..9ceae7d29 --- /dev/null +++ b/src/plugins/blackberry/neutrinoserviceplugin.cpp @@ -0,0 +1,70 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Research In Motion +** Contact: http://www.qt-project.org/legal +** +** This file is part of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#include "neutrinoserviceplugin.h" + +#include "bbmediaplayerservice.h" + +QT_BEGIN_NAMESPACE + +NeutrinoServicePlugin::NeutrinoServicePlugin() +{ +} + +QMediaService *NeutrinoServicePlugin::create(const QString &key) +{ + if (key == QLatin1String(Q_MEDIASERVICE_MEDIAPLAYER)) + return new BbMediaPlayerService(); + + return 0; +} + +void NeutrinoServicePlugin::release(QMediaService *service) +{ + delete service; +} + +QMediaServiceProviderHint::Features NeutrinoServicePlugin::supportedFeatures(const QByteArray &service) const +{ + Q_UNUSED(service) + return QMediaServiceProviderHint::Features(); +} + +QT_END_NAMESPACE diff --git a/src/plugins/blackberry/neutrinoserviceplugin.h b/src/plugins/blackberry/neutrinoserviceplugin.h new file mode 100644 index 000000000..2fc28233f --- /dev/null +++ b/src/plugins/blackberry/neutrinoserviceplugin.h @@ -0,0 +1,65 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Research In Motion +** Contact: http://www.qt-project.org/legal +** +** This file is part of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#ifndef NEUTRINOSERVICEPLUGIN_H +#define NEUTRINOSERVICEPLUGIN_H + +#include + +QT_BEGIN_NAMESPACE + +class NeutrinoServicePlugin + : public QMediaServiceProviderPlugin, + public QMediaServiceFeaturesInterface +{ + Q_OBJECT + Q_INTERFACES(QMediaServiceFeaturesInterface) + Q_PLUGIN_METADATA(IID "org.qt-project.qt.mediaserviceproviderfactory/5.0" FILE "neutrino_mediaservice.json") +public: + NeutrinoServicePlugin(); + + QMediaService *create(const QString &key) Q_DECL_OVERRIDE; + void release(QMediaService *service) Q_DECL_OVERRIDE; + QMediaServiceProviderHint::Features supportedFeatures(const QByteArray &service) const Q_DECL_OVERRIDE; +}; + +QT_END_NAMESPACE + +#endif diff --git a/src/plugins/plugins.pro b/src/plugins/plugins.pro index 20b0ccd9e..d5e3e80db 100644 --- a/src/plugins/plugins.pro +++ b/src/plugins/plugins.pro @@ -12,11 +12,8 @@ android { SUBDIRS += android opensles } -blackberry { - SUBDIRS += blackberry -} - qnx { + SUBDIRS += blackberry SUBDIRS += audiocapture qnx } -- cgit v1.2.3 From 99667804e1c64cace1246d4ce342a218fc1fb1ba Mon Sep 17 00:00:00 2001 From: Frank Osterfeld Date: Tue, 5 Nov 2013 14:28:08 +0100 Subject: QNX: Restructure plugins Now that the MmRenderer implementation is ported to plain QNX, rename the directories and files accordingly: "blackberry" becomes "qnx", replace the Bb prefix with MmRenderer for classes concerned with mm-renderer. The legacy alsa support for plain qnx is now "qnx-audio". Change-Id: I6abd98ecdd713b2d5e554d42224dc30f13772f43 Reviewed-by: Thomas McGuire --- src/plugins/blackberry/bbserviceplugin.cpp | 112 -- src/plugins/blackberry/bbserviceplugin.h | 77 -- src/plugins/blackberry/blackberry.pro | 22 - .../blackberry/blackberry_mediaservice.json | 4 - .../camera/bbcameraaudioencodersettingscontrol.cpp | 89 -- .../camera/bbcameraaudioencodersettingscontrol.h | 68 -- .../camera/bbcameracapturebufferformatcontrol.cpp | 66 -- .../camera/bbcameracapturebufferformatcontrol.h | 61 -- .../camera/bbcameracapturedestinationcontrol.cpp | 70 -- .../camera/bbcameracapturedestinationcontrol.h | 66 -- src/plugins/blackberry/camera/bbcameracontrol.cpp | 92 -- src/plugins/blackberry/camera/bbcameracontrol.h | 73 -- .../blackberry/camera/bbcameraexposurecontrol.cpp | 236 ---- .../blackberry/camera/bbcameraexposurecontrol.h | 73 -- .../blackberry/camera/bbcameraflashcontrol.cpp | 113 -- .../blackberry/camera/bbcameraflashcontrol.h | 68 -- .../blackberry/camera/bbcamerafocuscontrol.cpp | 331 ------ .../blackberry/camera/bbcamerafocuscontrol.h | 79 -- .../camera/bbcameraimagecapturecontrol.cpp | 85 -- .../camera/bbcameraimagecapturecontrol.h | 70 -- .../camera/bbcameraimageprocessingcontrol.cpp | 146 --- .../camera/bbcameraimageprocessingcontrol.h | 67 -- .../blackberry/camera/bbcameralockscontrol.cpp | 258 ----- .../blackberry/camera/bbcameralockscontrol.h | 86 -- .../camera/bbcameramediarecordercontrol.cpp | 169 --- .../camera/bbcameramediarecordercontrol.h | 76 -- .../camera/bbcameraorientationhandler.cpp | 102 -- .../blackberry/camera/bbcameraorientationhandler.h | 69 -- src/plugins/blackberry/camera/bbcameraservice.cpp | 141 --- src/plugins/blackberry/camera/bbcameraservice.h | 104 -- src/plugins/blackberry/camera/bbcamerasession.cpp | 1154 -------------------- src/plugins/blackberry/camera/bbcamerasession.h | 217 ---- .../camera/bbcameravideoencodersettingscontrol.cpp | 90 -- .../camera/bbcameravideoencodersettingscontrol.h | 69 -- .../camera/bbcameraviewfindersettingscontrol.cpp | 249 ----- .../camera/bbcameraviewfindersettingscontrol.h | 66 -- .../blackberry/camera/bbcamerazoomcontrol.cpp | 157 --- .../blackberry/camera/bbcamerazoomcontrol.h | 79 -- .../blackberry/camera/bbimageencodercontrol.cpp | 81 -- .../blackberry/camera/bbimageencodercontrol.h | 68 -- .../blackberry/camera/bbmediastoragelocation.cpp | 119 -- .../blackberry/camera/bbmediastoragelocation.h | 66 -- .../camera/bbvideodeviceselectorcontrol.cpp | 146 --- .../camera/bbvideodeviceselectorcontrol.h | 79 -- .../blackberry/camera/bbvideorenderercontrol.cpp | 64 -- .../blackberry/camera/bbvideorenderercontrol.h | 65 -- src/plugins/blackberry/camera/camera.pri | 53 - src/plugins/blackberry/common/common.pri | 7 - src/plugins/blackberry/common/windowgrabber.cpp | 367 ------- src/plugins/blackberry/common/windowgrabber.h | 109 -- .../mediaplayer/bbmediaplayercontrol.cpp | 634 ----------- .../blackberry/mediaplayer/bbmediaplayercontrol.h | 172 --- .../mediaplayer/bbmediaplayerservice.cpp | 149 --- .../blackberry/mediaplayer/bbmediaplayerservice.h | 78 -- src/plugins/blackberry/mediaplayer/bbmetadata.cpp | 269 ----- src/plugins/blackberry/mediaplayer/bbmetadata.h | 99 -- .../mediaplayer/bbmetadatareadercontrol.cpp | 170 --- .../mediaplayer/bbmetadatareadercontrol.h | 68 -- .../mediaplayer/bbplayervideorenderercontrol.cpp | 158 --- .../mediaplayer/bbplayervideorenderercontrol.h | 84 -- src/plugins/blackberry/mediaplayer/bbutil.cpp | 129 --- src/plugins/blackberry/mediaplayer/bbutil.h | 58 - .../mediaplayer/bbvideowindowcontrol.cpp | 414 ------- .../blackberry/mediaplayer/bbvideowindowcontrol.h | 120 -- .../mediaplayer/bpsmediaplayercontrol.cpp | 117 -- .../blackberry/mediaplayer/bpsmediaplayercontrol.h | 66 -- src/plugins/blackberry/mediaplayer/mediaplayer.pri | 31 - .../mediaplayer/ppsmediaplayercontrol.cpp | 199 ---- .../blackberry/mediaplayer/ppsmediaplayercontrol.h | 75 -- src/plugins/blackberry/neutrino_mediaservice.json | 4 - src/plugins/blackberry/neutrinoserviceplugin.cpp | 70 -- src/plugins/blackberry/neutrinoserviceplugin.h | 65 -- src/plugins/plugins.pro | 7 +- src/plugins/qnx-audio/audio/audio.pro | 22 + src/plugins/qnx-audio/audio/qnx_audio.json | 3 + src/plugins/qnx-audio/audio/qnxaudiodeviceinfo.cpp | 150 +++ src/plugins/qnx-audio/audio/qnxaudiodeviceinfo.h | 74 ++ src/plugins/qnx-audio/audio/qnxaudioinput.cpp | 447 ++++++++ src/plugins/qnx-audio/audio/qnxaudioinput.h | 139 +++ src/plugins/qnx-audio/audio/qnxaudiooutput.cpp | 443 ++++++++ src/plugins/qnx-audio/audio/qnxaudiooutput.h | 131 +++ src/plugins/qnx-audio/audio/qnxaudioplugin.cpp | 88 ++ src/plugins/qnx-audio/audio/qnxaudioplugin.h | 66 ++ src/plugins/qnx-audio/audio/qnxaudioutils.cpp | 130 +++ src/plugins/qnx-audio/audio/qnxaudioutils.h | 57 + src/plugins/qnx-audio/qnx-audio.pro | 3 + src/plugins/qnx/audio/audio.pro | 22 - src/plugins/qnx/audio/qnx_audio.json | 3 - src/plugins/qnx/audio/qnxaudiodeviceinfo.cpp | 150 --- src/plugins/qnx/audio/qnxaudiodeviceinfo.h | 74 -- src/plugins/qnx/audio/qnxaudioinput.cpp | 447 -------- src/plugins/qnx/audio/qnxaudioinput.h | 139 --- src/plugins/qnx/audio/qnxaudiooutput.cpp | 443 -------- src/plugins/qnx/audio/qnxaudiooutput.h | 131 --- src/plugins/qnx/audio/qnxaudioplugin.cpp | 88 -- src/plugins/qnx/audio/qnxaudioplugin.h | 66 -- src/plugins/qnx/audio/qnxaudioutils.cpp | 130 --- src/plugins/qnx/audio/qnxaudioutils.h | 57 - src/plugins/qnx/bbserviceplugin.cpp | 112 ++ src/plugins/qnx/bbserviceplugin.h | 77 ++ src/plugins/qnx/blackberry_mediaservice.json | 4 + .../camera/bbcameraaudioencodersettingscontrol.cpp | 89 ++ .../camera/bbcameraaudioencodersettingscontrol.h | 68 ++ .../camera/bbcameracapturebufferformatcontrol.cpp | 66 ++ .../camera/bbcameracapturebufferformatcontrol.h | 61 ++ .../camera/bbcameracapturedestinationcontrol.cpp | 70 ++ .../qnx/camera/bbcameracapturedestinationcontrol.h | 66 ++ src/plugins/qnx/camera/bbcameracontrol.cpp | 92 ++ src/plugins/qnx/camera/bbcameracontrol.h | 73 ++ src/plugins/qnx/camera/bbcameraexposurecontrol.cpp | 236 ++++ src/plugins/qnx/camera/bbcameraexposurecontrol.h | 73 ++ src/plugins/qnx/camera/bbcameraflashcontrol.cpp | 113 ++ src/plugins/qnx/camera/bbcameraflashcontrol.h | 68 ++ src/plugins/qnx/camera/bbcamerafocuscontrol.cpp | 331 ++++++ src/plugins/qnx/camera/bbcamerafocuscontrol.h | 79 ++ .../qnx/camera/bbcameraimagecapturecontrol.cpp | 85 ++ .../qnx/camera/bbcameraimagecapturecontrol.h | 70 ++ .../qnx/camera/bbcameraimageprocessingcontrol.cpp | 146 +++ .../qnx/camera/bbcameraimageprocessingcontrol.h | 67 ++ src/plugins/qnx/camera/bbcameralockscontrol.cpp | 258 +++++ src/plugins/qnx/camera/bbcameralockscontrol.h | 86 ++ .../qnx/camera/bbcameramediarecordercontrol.cpp | 169 +++ .../qnx/camera/bbcameramediarecordercontrol.h | 76 ++ .../qnx/camera/bbcameraorientationhandler.cpp | 102 ++ .../qnx/camera/bbcameraorientationhandler.h | 69 ++ src/plugins/qnx/camera/bbcameraservice.cpp | 141 +++ src/plugins/qnx/camera/bbcameraservice.h | 104 ++ src/plugins/qnx/camera/bbcamerasession.cpp | 1154 ++++++++++++++++++++ src/plugins/qnx/camera/bbcamerasession.h | 217 ++++ .../camera/bbcameravideoencodersettingscontrol.cpp | 90 ++ .../camera/bbcameravideoencodersettingscontrol.h | 69 ++ .../camera/bbcameraviewfindersettingscontrol.cpp | 249 +++++ .../qnx/camera/bbcameraviewfindersettingscontrol.h | 66 ++ src/plugins/qnx/camera/bbcamerazoomcontrol.cpp | 157 +++ src/plugins/qnx/camera/bbcamerazoomcontrol.h | 79 ++ src/plugins/qnx/camera/bbimageencodercontrol.cpp | 81 ++ src/plugins/qnx/camera/bbimageencodercontrol.h | 68 ++ src/plugins/qnx/camera/bbmediastoragelocation.cpp | 119 ++ src/plugins/qnx/camera/bbmediastoragelocation.h | 66 ++ .../qnx/camera/bbvideodeviceselectorcontrol.cpp | 146 +++ .../qnx/camera/bbvideodeviceselectorcontrol.h | 79 ++ src/plugins/qnx/camera/bbvideorenderercontrol.cpp | 64 ++ src/plugins/qnx/camera/bbvideorenderercontrol.h | 65 ++ src/plugins/qnx/camera/camera.pri | 53 + src/plugins/qnx/common/common.pri | 7 + src/plugins/qnx/common/windowgrabber.cpp | 367 +++++++ src/plugins/qnx/common/windowgrabber.h | 109 ++ .../qnx/mediaplayer/bpsmediaplayercontrol.cpp | 117 ++ .../qnx/mediaplayer/bpsmediaplayercontrol.h | 66 ++ src/plugins/qnx/mediaplayer/mediaplayer.pri | 31 + .../mediaplayer/mmrenderermediaplayercontrol.cpp | 634 +++++++++++ .../qnx/mediaplayer/mmrenderermediaplayercontrol.h | 172 +++ .../mediaplayer/mmrenderermediaplayerservice.cpp | 149 +++ .../qnx/mediaplayer/mmrenderermediaplayerservice.h | 78 ++ src/plugins/qnx/mediaplayer/mmrenderermetadata.cpp | 269 +++++ src/plugins/qnx/mediaplayer/mmrenderermetadata.h | 99 ++ .../mmrenderermetadatareadercontrol.cpp | 170 +++ .../mediaplayer/mmrenderermetadatareadercontrol.h | 68 ++ .../mmrendererplayervideorenderercontrol.cpp | 158 +++ .../mmrendererplayervideorenderercontrol.h | 84 ++ src/plugins/qnx/mediaplayer/mmrendererutil.cpp | 129 +++ src/plugins/qnx/mediaplayer/mmrendererutil.h | 58 + .../mediaplayer/mmrenderervideowindowcontrol.cpp | 414 +++++++ .../qnx/mediaplayer/mmrenderervideowindowcontrol.h | 120 ++ .../qnx/mediaplayer/ppsmediaplayercontrol.cpp | 199 ++++ .../qnx/mediaplayer/ppsmediaplayercontrol.h | 75 ++ src/plugins/qnx/neutrino_mediaservice.json | 4 + src/plugins/qnx/neutrinoserviceplugin.cpp | 70 ++ src/plugins/qnx/neutrinoserviceplugin.h | 65 ++ src/plugins/qnx/qnx.pro | 23 +- 170 files changed, 11364 insertions(+), 11361 deletions(-) delete mode 100644 src/plugins/blackberry/bbserviceplugin.cpp delete mode 100644 src/plugins/blackberry/bbserviceplugin.h delete mode 100644 src/plugins/blackberry/blackberry.pro delete mode 100644 src/plugins/blackberry/blackberry_mediaservice.json delete mode 100644 src/plugins/blackberry/camera/bbcameraaudioencodersettingscontrol.cpp delete mode 100644 src/plugins/blackberry/camera/bbcameraaudioencodersettingscontrol.h delete mode 100644 src/plugins/blackberry/camera/bbcameracapturebufferformatcontrol.cpp delete mode 100644 src/plugins/blackberry/camera/bbcameracapturebufferformatcontrol.h delete mode 100644 src/plugins/blackberry/camera/bbcameracapturedestinationcontrol.cpp delete mode 100644 src/plugins/blackberry/camera/bbcameracapturedestinationcontrol.h delete mode 100644 src/plugins/blackberry/camera/bbcameracontrol.cpp delete mode 100644 src/plugins/blackberry/camera/bbcameracontrol.h delete mode 100644 src/plugins/blackberry/camera/bbcameraexposurecontrol.cpp delete mode 100644 src/plugins/blackberry/camera/bbcameraexposurecontrol.h delete mode 100644 src/plugins/blackberry/camera/bbcameraflashcontrol.cpp delete mode 100644 src/plugins/blackberry/camera/bbcameraflashcontrol.h delete mode 100644 src/plugins/blackberry/camera/bbcamerafocuscontrol.cpp delete mode 100644 src/plugins/blackberry/camera/bbcamerafocuscontrol.h delete mode 100644 src/plugins/blackberry/camera/bbcameraimagecapturecontrol.cpp delete mode 100644 src/plugins/blackberry/camera/bbcameraimagecapturecontrol.h delete mode 100644 src/plugins/blackberry/camera/bbcameraimageprocessingcontrol.cpp delete mode 100644 src/plugins/blackberry/camera/bbcameraimageprocessingcontrol.h delete mode 100644 src/plugins/blackberry/camera/bbcameralockscontrol.cpp delete mode 100644 src/plugins/blackberry/camera/bbcameralockscontrol.h delete mode 100644 src/plugins/blackberry/camera/bbcameramediarecordercontrol.cpp delete mode 100644 src/plugins/blackberry/camera/bbcameramediarecordercontrol.h delete mode 100644 src/plugins/blackberry/camera/bbcameraorientationhandler.cpp delete mode 100644 src/plugins/blackberry/camera/bbcameraorientationhandler.h delete mode 100644 src/plugins/blackberry/camera/bbcameraservice.cpp delete mode 100644 src/plugins/blackberry/camera/bbcameraservice.h delete mode 100644 src/plugins/blackberry/camera/bbcamerasession.cpp delete mode 100644 src/plugins/blackberry/camera/bbcamerasession.h delete mode 100644 src/plugins/blackberry/camera/bbcameravideoencodersettingscontrol.cpp delete mode 100644 src/plugins/blackberry/camera/bbcameravideoencodersettingscontrol.h delete mode 100644 src/plugins/blackberry/camera/bbcameraviewfindersettingscontrol.cpp delete mode 100644 src/plugins/blackberry/camera/bbcameraviewfindersettingscontrol.h delete mode 100644 src/plugins/blackberry/camera/bbcamerazoomcontrol.cpp delete mode 100644 src/plugins/blackberry/camera/bbcamerazoomcontrol.h delete mode 100644 src/plugins/blackberry/camera/bbimageencodercontrol.cpp delete mode 100644 src/plugins/blackberry/camera/bbimageencodercontrol.h delete mode 100644 src/plugins/blackberry/camera/bbmediastoragelocation.cpp delete mode 100644 src/plugins/blackberry/camera/bbmediastoragelocation.h delete mode 100644 src/plugins/blackberry/camera/bbvideodeviceselectorcontrol.cpp delete mode 100644 src/plugins/blackberry/camera/bbvideodeviceselectorcontrol.h delete mode 100644 src/plugins/blackberry/camera/bbvideorenderercontrol.cpp delete mode 100644 src/plugins/blackberry/camera/bbvideorenderercontrol.h delete mode 100644 src/plugins/blackberry/camera/camera.pri delete mode 100644 src/plugins/blackberry/common/common.pri delete mode 100644 src/plugins/blackberry/common/windowgrabber.cpp delete mode 100644 src/plugins/blackberry/common/windowgrabber.h delete mode 100644 src/plugins/blackberry/mediaplayer/bbmediaplayercontrol.cpp delete mode 100644 src/plugins/blackberry/mediaplayer/bbmediaplayercontrol.h delete mode 100644 src/plugins/blackberry/mediaplayer/bbmediaplayerservice.cpp delete mode 100644 src/plugins/blackberry/mediaplayer/bbmediaplayerservice.h delete mode 100644 src/plugins/blackberry/mediaplayer/bbmetadata.cpp delete mode 100644 src/plugins/blackberry/mediaplayer/bbmetadata.h delete mode 100644 src/plugins/blackberry/mediaplayer/bbmetadatareadercontrol.cpp delete mode 100644 src/plugins/blackberry/mediaplayer/bbmetadatareadercontrol.h delete mode 100644 src/plugins/blackberry/mediaplayer/bbplayervideorenderercontrol.cpp delete mode 100644 src/plugins/blackberry/mediaplayer/bbplayervideorenderercontrol.h delete mode 100644 src/plugins/blackberry/mediaplayer/bbutil.cpp delete mode 100644 src/plugins/blackberry/mediaplayer/bbutil.h delete mode 100644 src/plugins/blackberry/mediaplayer/bbvideowindowcontrol.cpp delete mode 100644 src/plugins/blackberry/mediaplayer/bbvideowindowcontrol.h delete mode 100644 src/plugins/blackberry/mediaplayer/bpsmediaplayercontrol.cpp delete mode 100644 src/plugins/blackberry/mediaplayer/bpsmediaplayercontrol.h delete mode 100644 src/plugins/blackberry/mediaplayer/mediaplayer.pri delete mode 100644 src/plugins/blackberry/mediaplayer/ppsmediaplayercontrol.cpp delete mode 100644 src/plugins/blackberry/mediaplayer/ppsmediaplayercontrol.h delete mode 100644 src/plugins/blackberry/neutrino_mediaservice.json delete mode 100644 src/plugins/blackberry/neutrinoserviceplugin.cpp delete mode 100644 src/plugins/blackberry/neutrinoserviceplugin.h create mode 100644 src/plugins/qnx-audio/audio/audio.pro create mode 100644 src/plugins/qnx-audio/audio/qnx_audio.json create mode 100644 src/plugins/qnx-audio/audio/qnxaudiodeviceinfo.cpp create mode 100644 src/plugins/qnx-audio/audio/qnxaudiodeviceinfo.h create mode 100644 src/plugins/qnx-audio/audio/qnxaudioinput.cpp create mode 100644 src/plugins/qnx-audio/audio/qnxaudioinput.h create mode 100644 src/plugins/qnx-audio/audio/qnxaudiooutput.cpp create mode 100644 src/plugins/qnx-audio/audio/qnxaudiooutput.h create mode 100644 src/plugins/qnx-audio/audio/qnxaudioplugin.cpp create mode 100644 src/plugins/qnx-audio/audio/qnxaudioplugin.h create mode 100644 src/plugins/qnx-audio/audio/qnxaudioutils.cpp create mode 100644 src/plugins/qnx-audio/audio/qnxaudioutils.h create mode 100644 src/plugins/qnx-audio/qnx-audio.pro delete mode 100644 src/plugins/qnx/audio/audio.pro delete mode 100644 src/plugins/qnx/audio/qnx_audio.json delete mode 100644 src/plugins/qnx/audio/qnxaudiodeviceinfo.cpp delete mode 100644 src/plugins/qnx/audio/qnxaudiodeviceinfo.h delete mode 100644 src/plugins/qnx/audio/qnxaudioinput.cpp delete mode 100644 src/plugins/qnx/audio/qnxaudioinput.h delete mode 100644 src/plugins/qnx/audio/qnxaudiooutput.cpp delete mode 100644 src/plugins/qnx/audio/qnxaudiooutput.h delete mode 100644 src/plugins/qnx/audio/qnxaudioplugin.cpp delete mode 100644 src/plugins/qnx/audio/qnxaudioplugin.h delete mode 100644 src/plugins/qnx/audio/qnxaudioutils.cpp delete mode 100644 src/plugins/qnx/audio/qnxaudioutils.h create mode 100644 src/plugins/qnx/bbserviceplugin.cpp create mode 100644 src/plugins/qnx/bbserviceplugin.h create mode 100644 src/plugins/qnx/blackberry_mediaservice.json create mode 100644 src/plugins/qnx/camera/bbcameraaudioencodersettingscontrol.cpp create mode 100644 src/plugins/qnx/camera/bbcameraaudioencodersettingscontrol.h create mode 100644 src/plugins/qnx/camera/bbcameracapturebufferformatcontrol.cpp create mode 100644 src/plugins/qnx/camera/bbcameracapturebufferformatcontrol.h create mode 100644 src/plugins/qnx/camera/bbcameracapturedestinationcontrol.cpp create mode 100644 src/plugins/qnx/camera/bbcameracapturedestinationcontrol.h create mode 100644 src/plugins/qnx/camera/bbcameracontrol.cpp create mode 100644 src/plugins/qnx/camera/bbcameracontrol.h create mode 100644 src/plugins/qnx/camera/bbcameraexposurecontrol.cpp create mode 100644 src/plugins/qnx/camera/bbcameraexposurecontrol.h create mode 100644 src/plugins/qnx/camera/bbcameraflashcontrol.cpp create mode 100644 src/plugins/qnx/camera/bbcameraflashcontrol.h create mode 100644 src/plugins/qnx/camera/bbcamerafocuscontrol.cpp create mode 100644 src/plugins/qnx/camera/bbcamerafocuscontrol.h create mode 100644 src/plugins/qnx/camera/bbcameraimagecapturecontrol.cpp create mode 100644 src/plugins/qnx/camera/bbcameraimagecapturecontrol.h create mode 100644 src/plugins/qnx/camera/bbcameraimageprocessingcontrol.cpp create mode 100644 src/plugins/qnx/camera/bbcameraimageprocessingcontrol.h create mode 100644 src/plugins/qnx/camera/bbcameralockscontrol.cpp create mode 100644 src/plugins/qnx/camera/bbcameralockscontrol.h create mode 100644 src/plugins/qnx/camera/bbcameramediarecordercontrol.cpp create mode 100644 src/plugins/qnx/camera/bbcameramediarecordercontrol.h create mode 100644 src/plugins/qnx/camera/bbcameraorientationhandler.cpp create mode 100644 src/plugins/qnx/camera/bbcameraorientationhandler.h create mode 100644 src/plugins/qnx/camera/bbcameraservice.cpp create mode 100644 src/plugins/qnx/camera/bbcameraservice.h create mode 100644 src/plugins/qnx/camera/bbcamerasession.cpp create mode 100644 src/plugins/qnx/camera/bbcamerasession.h create mode 100644 src/plugins/qnx/camera/bbcameravideoencodersettingscontrol.cpp create mode 100644 src/plugins/qnx/camera/bbcameravideoencodersettingscontrol.h create mode 100644 src/plugins/qnx/camera/bbcameraviewfindersettingscontrol.cpp create mode 100644 src/plugins/qnx/camera/bbcameraviewfindersettingscontrol.h create mode 100644 src/plugins/qnx/camera/bbcamerazoomcontrol.cpp create mode 100644 src/plugins/qnx/camera/bbcamerazoomcontrol.h create mode 100644 src/plugins/qnx/camera/bbimageencodercontrol.cpp create mode 100644 src/plugins/qnx/camera/bbimageencodercontrol.h create mode 100644 src/plugins/qnx/camera/bbmediastoragelocation.cpp create mode 100644 src/plugins/qnx/camera/bbmediastoragelocation.h create mode 100644 src/plugins/qnx/camera/bbvideodeviceselectorcontrol.cpp create mode 100644 src/plugins/qnx/camera/bbvideodeviceselectorcontrol.h create mode 100644 src/plugins/qnx/camera/bbvideorenderercontrol.cpp create mode 100644 src/plugins/qnx/camera/bbvideorenderercontrol.h create mode 100644 src/plugins/qnx/camera/camera.pri create mode 100644 src/plugins/qnx/common/common.pri create mode 100644 src/plugins/qnx/common/windowgrabber.cpp create mode 100644 src/plugins/qnx/common/windowgrabber.h create mode 100644 src/plugins/qnx/mediaplayer/bpsmediaplayercontrol.cpp create mode 100644 src/plugins/qnx/mediaplayer/bpsmediaplayercontrol.h create mode 100644 src/plugins/qnx/mediaplayer/mediaplayer.pri create mode 100644 src/plugins/qnx/mediaplayer/mmrenderermediaplayercontrol.cpp create mode 100644 src/plugins/qnx/mediaplayer/mmrenderermediaplayercontrol.h create mode 100644 src/plugins/qnx/mediaplayer/mmrenderermediaplayerservice.cpp create mode 100644 src/plugins/qnx/mediaplayer/mmrenderermediaplayerservice.h create mode 100644 src/plugins/qnx/mediaplayer/mmrenderermetadata.cpp create mode 100644 src/plugins/qnx/mediaplayer/mmrenderermetadata.h create mode 100644 src/plugins/qnx/mediaplayer/mmrenderermetadatareadercontrol.cpp create mode 100644 src/plugins/qnx/mediaplayer/mmrenderermetadatareadercontrol.h create mode 100644 src/plugins/qnx/mediaplayer/mmrendererplayervideorenderercontrol.cpp create mode 100644 src/plugins/qnx/mediaplayer/mmrendererplayervideorenderercontrol.h create mode 100644 src/plugins/qnx/mediaplayer/mmrendererutil.cpp create mode 100644 src/plugins/qnx/mediaplayer/mmrendererutil.h create mode 100644 src/plugins/qnx/mediaplayer/mmrenderervideowindowcontrol.cpp create mode 100644 src/plugins/qnx/mediaplayer/mmrenderervideowindowcontrol.h create mode 100644 src/plugins/qnx/mediaplayer/ppsmediaplayercontrol.cpp create mode 100644 src/plugins/qnx/mediaplayer/ppsmediaplayercontrol.h create mode 100644 src/plugins/qnx/neutrino_mediaservice.json create mode 100644 src/plugins/qnx/neutrinoserviceplugin.cpp create mode 100644 src/plugins/qnx/neutrinoserviceplugin.h (limited to 'src/plugins') diff --git a/src/plugins/blackberry/bbserviceplugin.cpp b/src/plugins/blackberry/bbserviceplugin.cpp deleted file mode 100644 index dab3caf9b..000000000 --- a/src/plugins/blackberry/bbserviceplugin.cpp +++ /dev/null @@ -1,112 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Research In Motion -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include "bbserviceplugin.h" - -#include "bbcameraservice.h" -#include "bbvideodeviceselectorcontrol.h" -#include "bbmediaplayerservice.h" - -#include - -QT_BEGIN_NAMESPACE - -BbServicePlugin::BbServicePlugin() -{ -} - -QMediaService *BbServicePlugin::create(const QString &key) -{ - if (key == QLatin1String(Q_MEDIASERVICE_CAMERA)) - return new BbCameraService(); - - if (key == QLatin1String(Q_MEDIASERVICE_MEDIAPLAYER)) - return new BbMediaPlayerService(); - - return 0; -} - -void BbServicePlugin::release(QMediaService *service) -{ - delete service; -} - -QMediaServiceProviderHint::Features BbServicePlugin::supportedFeatures(const QByteArray &service) const -{ - Q_UNUSED(service) - return QMediaServiceProviderHint::Features(); -} - -QList BbServicePlugin::devices(const QByteArray &service) const -{ - if (service == Q_MEDIASERVICE_CAMERA) { - if (m_cameraDevices.isEmpty()) - updateDevices(); - - return m_cameraDevices; - } - - return QList(); -} - -QString BbServicePlugin::deviceDescription(const QByteArray &service, const QByteArray &device) -{ - if (service == Q_MEDIASERVICE_CAMERA) { - if (m_cameraDevices.isEmpty()) - updateDevices(); - - for (int i = 0; i < m_cameraDevices.count(); i++) - if (m_cameraDevices[i] == device) - return m_cameraDescriptions[i]; - } - - return QString(); -} - -void BbServicePlugin::updateDevices() const -{ - BbVideoDeviceSelectorControl::enumerateDevices(&m_cameraDevices, &m_cameraDescriptions); - - if (m_cameraDevices.isEmpty()) { - qWarning() << "No camera devices found"; - } -} - -QT_END_NAMESPACE diff --git a/src/plugins/blackberry/bbserviceplugin.h b/src/plugins/blackberry/bbserviceplugin.h deleted file mode 100644 index 62fc4a0df..000000000 --- a/src/plugins/blackberry/bbserviceplugin.h +++ /dev/null @@ -1,77 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Research In Motion -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#ifndef BBRSERVICEPLUGIN_H -#define BBRSERVICEPLUGIN_H - -#include - -QT_BEGIN_NAMESPACE - -class BbServicePlugin - : public QMediaServiceProviderPlugin, - public QMediaServiceSupportedDevicesInterface, - public QMediaServiceFeaturesInterface -{ - Q_OBJECT - Q_INTERFACES(QMediaServiceSupportedDevicesInterface) - Q_INTERFACES(QMediaServiceFeaturesInterface) - Q_PLUGIN_METADATA(IID "org.qt-project.qt.mediaserviceproviderfactory/5.0" FILE "blackberry_mediaservice.json") -public: - BbServicePlugin(); - - QMediaService *create(const QString &key) Q_DECL_OVERRIDE; - void release(QMediaService *service) Q_DECL_OVERRIDE; - QMediaServiceProviderHint::Features supportedFeatures(const QByteArray &service) const Q_DECL_OVERRIDE; - - QList devices(const QByteArray &service) const Q_DECL_OVERRIDE; - QString deviceDescription(const QByteArray &service, const QByteArray &device) Q_DECL_OVERRIDE; - QVariant deviceProperty(const QByteArray &service, const QByteArray &device, const QByteArray &property) Q_DECL_OVERRIDE; - -private: - void updateDevices() const; - - mutable QList m_cameraDevices; - mutable QStringList m_cameraDescriptions; -}; - -QT_END_NAMESPACE - -#endif diff --git a/src/plugins/blackberry/blackberry.pro b/src/plugins/blackberry/blackberry.pro deleted file mode 100644 index fa1d07f80..000000000 --- a/src/plugins/blackberry/blackberry.pro +++ /dev/null @@ -1,22 +0,0 @@ -TARGET = qtmedia_blackberry -QT += multimedia-private gui-private - -PLUGIN_TYPE=mediaservice -PLUGIN_CLASS_NAME = BbServicePlugin -load(qt_plugin) - -LIBS += -lscreen - -include(common/common.pri) -include(mediaplayer/mediaplayer.pri) - -blackberry { - include(camera/camera.pri) - HEADERS += bbserviceplugin.h - SOURCES += bbserviceplugin.cpp - OTHER_FILES += blackberry_mediaservice.json -} else { - HEADERS += neutrinoserviceplugin.h - SOURCES += neutrinoserviceplugin.cpp - OTHER_FILES += neutrino_mediaservice.json -} diff --git a/src/plugins/blackberry/blackberry_mediaservice.json b/src/plugins/blackberry/blackberry_mediaservice.json deleted file mode 100644 index 2a59cc770..000000000 --- a/src/plugins/blackberry/blackberry_mediaservice.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "Keys": ["blackberrymultimedia"], - "Services": ["org.qt-project.qt.camera", "org.qt-project.qt.mediaplayer"] -} diff --git a/src/plugins/blackberry/camera/bbcameraaudioencodersettingscontrol.cpp b/src/plugins/blackberry/camera/bbcameraaudioencodersettingscontrol.cpp deleted file mode 100644 index 2ff800a0f..000000000 --- a/src/plugins/blackberry/camera/bbcameraaudioencodersettingscontrol.cpp +++ /dev/null @@ -1,89 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Research In Motion -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include "bbcameraaudioencodersettingscontrol.h" - -#include "bbcamerasession.h" - -QT_BEGIN_NAMESPACE - -BbCameraAudioEncoderSettingsControl::BbCameraAudioEncoderSettingsControl(BbCameraSession *session, QObject *parent) - : QAudioEncoderSettingsControl(parent) - , m_session(session) -{ -} - -QStringList BbCameraAudioEncoderSettingsControl::supportedAudioCodecs() const -{ - return QStringList() << QLatin1String("none") << QLatin1String("aac") << QLatin1String("raw"); -} - -QString BbCameraAudioEncoderSettingsControl::codecDescription(const QString &codecName) const -{ - if (codecName == QLatin1String("none")) - return tr("No compression"); - else if (codecName == QLatin1String("aac")) - return tr("AAC compression"); - else if (codecName == QLatin1String("raw")) - return tr("PCM uncompressed"); - - return QString(); -} - -QList BbCameraAudioEncoderSettingsControl::supportedSampleRates(const QAudioEncoderSettings &settings, bool *continuous) const -{ - Q_UNUSED(settings); - Q_UNUSED(continuous); - - // no API provided by BB10 yet - return QList(); -} - -QAudioEncoderSettings BbCameraAudioEncoderSettingsControl::audioSettings() const -{ - return m_session->audioSettings(); -} - -void BbCameraAudioEncoderSettingsControl::setAudioSettings(const QAudioEncoderSettings &settings) -{ - m_session->setAudioSettings(settings); -} - -QT_END_NAMESPACE diff --git a/src/plugins/blackberry/camera/bbcameraaudioencodersettingscontrol.h b/src/plugins/blackberry/camera/bbcameraaudioencodersettingscontrol.h deleted file mode 100644 index 21fb520e7..000000000 --- a/src/plugins/blackberry/camera/bbcameraaudioencodersettingscontrol.h +++ /dev/null @@ -1,68 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Research In Motion -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#ifndef BBCAMERAAUDIOENCODERSETTINGSCONTROL_H -#define BBCAMERAAUDIOENCODERSETTINGSCONTROL_H - -#include - -QT_BEGIN_NAMESPACE - -class BbCameraSession; - -class BbCameraAudioEncoderSettingsControl : public QAudioEncoderSettingsControl -{ - Q_OBJECT -public: - explicit BbCameraAudioEncoderSettingsControl(BbCameraSession *session, QObject *parent = 0); - - QStringList supportedAudioCodecs() const Q_DECL_OVERRIDE; - QString codecDescription(const QString &codecName) const Q_DECL_OVERRIDE; - QList supportedSampleRates(const QAudioEncoderSettings &settings, bool *continuous = 0) const Q_DECL_OVERRIDE; - QAudioEncoderSettings audioSettings() const Q_DECL_OVERRIDE; - void setAudioSettings(const QAudioEncoderSettings &settings) Q_DECL_OVERRIDE; - -private: - BbCameraSession *m_session; -}; - -QT_END_NAMESPACE - -#endif diff --git a/src/plugins/blackberry/camera/bbcameracapturebufferformatcontrol.cpp b/src/plugins/blackberry/camera/bbcameracapturebufferformatcontrol.cpp deleted file mode 100644 index 57f3c9fb1..000000000 --- a/src/plugins/blackberry/camera/bbcameracapturebufferformatcontrol.cpp +++ /dev/null @@ -1,66 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Research In Motion -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include "bbcameracapturebufferformatcontrol.h" - -QT_BEGIN_NAMESPACE - -BbCameraCaptureBufferFormatControl::BbCameraCaptureBufferFormatControl(QObject *parent) - : QCameraCaptureBufferFormatControl(parent) -{ -} - -QList BbCameraCaptureBufferFormatControl::supportedBufferFormats() const -{ - return (QList() << QVideoFrame::Format_Jpeg); -} - -QVideoFrame::PixelFormat BbCameraCaptureBufferFormatControl::bufferFormat() const -{ - return QVideoFrame::Format_Jpeg; -} - -void BbCameraCaptureBufferFormatControl::setBufferFormat(QVideoFrame::PixelFormat format) -{ - Q_UNUSED(format) - // Do nothing, we support only Jpeg for now -} - -QT_END_NAMESPACE diff --git a/src/plugins/blackberry/camera/bbcameracapturebufferformatcontrol.h b/src/plugins/blackberry/camera/bbcameracapturebufferformatcontrol.h deleted file mode 100644 index 2897cb2fd..000000000 --- a/src/plugins/blackberry/camera/bbcameracapturebufferformatcontrol.h +++ /dev/null @@ -1,61 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Research In Motion -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#ifndef BBCAMERACAPTUREBUFFERFORMATCONTROL_H -#define BBCAMERACAPTUREBUFFERFORMATCONTROL_H - -#include - -QT_BEGIN_NAMESPACE - -class BbCameraCaptureBufferFormatControl : public QCameraCaptureBufferFormatControl -{ - Q_OBJECT -public: - explicit BbCameraCaptureBufferFormatControl(QObject *parent = 0); - - QList supportedBufferFormats() const Q_DECL_OVERRIDE; - QVideoFrame::PixelFormat bufferFormat() const Q_DECL_OVERRIDE; - void setBufferFormat(QVideoFrame::PixelFormat format) Q_DECL_OVERRIDE; -}; - -QT_END_NAMESPACE - -#endif diff --git a/src/plugins/blackberry/camera/bbcameracapturedestinationcontrol.cpp b/src/plugins/blackberry/camera/bbcameracapturedestinationcontrol.cpp deleted file mode 100644 index 6b6bcfcb9..000000000 --- a/src/plugins/blackberry/camera/bbcameracapturedestinationcontrol.cpp +++ /dev/null @@ -1,70 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Research In Motion -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include "bbcameracapturedestinationcontrol.h" - -#include "bbcamerasession.h" - -QT_BEGIN_NAMESPACE - -BbCameraCaptureDestinationControl::BbCameraCaptureDestinationControl(BbCameraSession *session, QObject *parent) - : QCameraCaptureDestinationControl(parent) - , m_session(session) -{ - connect(m_session, SIGNAL(captureDestinationChanged(QCameraImageCapture::CaptureDestinations)), - this, SIGNAL(captureDestinationChanged(QCameraImageCapture::CaptureDestinations))); -} - -bool BbCameraCaptureDestinationControl::isCaptureDestinationSupported(QCameraImageCapture::CaptureDestinations destination) const -{ - return m_session->isCaptureDestinationSupported(destination); -} - -QCameraImageCapture::CaptureDestinations BbCameraCaptureDestinationControl::captureDestination() const -{ - return m_session->captureDestination();; -} - -void BbCameraCaptureDestinationControl::setCaptureDestination(QCameraImageCapture::CaptureDestinations destination) -{ - m_session->setCaptureDestination(destination); -} - -QT_END_NAMESPACE diff --git a/src/plugins/blackberry/camera/bbcameracapturedestinationcontrol.h b/src/plugins/blackberry/camera/bbcameracapturedestinationcontrol.h deleted file mode 100644 index 93a7d2d14..000000000 --- a/src/plugins/blackberry/camera/bbcameracapturedestinationcontrol.h +++ /dev/null @@ -1,66 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Research In Motion -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#ifndef BBCAMERACAPTUREDESTINATIONCONTROL_H -#define BBCAMERACAPTUREDESTINATIONCONTROL_H - -#include - -QT_BEGIN_NAMESPACE - -class BbCameraSession; - -class BbCameraCaptureDestinationControl : public QCameraCaptureDestinationControl -{ - Q_OBJECT -public: - explicit BbCameraCaptureDestinationControl(BbCameraSession *session, QObject *parent = 0); - - bool isCaptureDestinationSupported(QCameraImageCapture::CaptureDestinations destination) const Q_DECL_OVERRIDE; - QCameraImageCapture::CaptureDestinations captureDestination() const Q_DECL_OVERRIDE; - void setCaptureDestination(QCameraImageCapture::CaptureDestinations destination) Q_DECL_OVERRIDE; - -private: - BbCameraSession *m_session; -}; - -QT_END_NAMESPACE - -#endif diff --git a/src/plugins/blackberry/camera/bbcameracontrol.cpp b/src/plugins/blackberry/camera/bbcameracontrol.cpp deleted file mode 100644 index bc3c78264..000000000 --- a/src/plugins/blackberry/camera/bbcameracontrol.cpp +++ /dev/null @@ -1,92 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Research In Motion -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include "bbcameracontrol.h" - -#include "bbcamerasession.h" - -QT_BEGIN_NAMESPACE - -BbCameraControl::BbCameraControl(BbCameraSession *session, QObject *parent) - : QCameraControl(parent) - , m_session(session) -{ - connect(m_session, SIGNAL(statusChanged(QCamera::Status)), this, SIGNAL(statusChanged(QCamera::Status))); - connect(m_session, SIGNAL(stateChanged(QCamera::State)), this, SIGNAL(stateChanged(QCamera::State))); - connect(m_session, SIGNAL(error(int,QString)), this, SIGNAL(error(int,QString))); - connect(m_session, SIGNAL(captureModeChanged(QCamera::CaptureModes)), this, SIGNAL(captureModeChanged(QCamera::CaptureModes))); -} - -QCamera::State BbCameraControl::state() const -{ - return m_session->state(); -} - -void BbCameraControl::setState(QCamera::State state) -{ - m_session->setState(state); -} - -QCamera::CaptureModes BbCameraControl::captureMode() const -{ - return m_session->captureMode(); -} - -void BbCameraControl::setCaptureMode(QCamera::CaptureModes mode) -{ - m_session->setCaptureMode(mode); -} - -QCamera::Status BbCameraControl::status() const -{ - return m_session->status(); -} - -bool BbCameraControl::isCaptureModeSupported(QCamera::CaptureModes mode) const -{ - return m_session->isCaptureModeSupported(mode); -} - -bool BbCameraControl::canChangeProperty(PropertyChangeType /* changeType */, QCamera::Status /* status */) const -{ - return false; -} - -QT_END_NAMESPACE diff --git a/src/plugins/blackberry/camera/bbcameracontrol.h b/src/plugins/blackberry/camera/bbcameracontrol.h deleted file mode 100644 index a5792c5df..000000000 --- a/src/plugins/blackberry/camera/bbcameracontrol.h +++ /dev/null @@ -1,73 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Research In Motion -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#ifndef BBCAMERACONTROL_H -#define BBCAMERACONTROL_H - -#include - -QT_BEGIN_NAMESPACE - -class BbCameraSession; - -class BbCameraControl : public QCameraControl -{ - Q_OBJECT -public: - explicit BbCameraControl(BbCameraSession *session, QObject *parent = 0); - - QCamera::State state() const Q_DECL_OVERRIDE; - void setState(QCamera::State state) Q_DECL_OVERRIDE; - - QCamera::Status status() const Q_DECL_OVERRIDE; - - QCamera::CaptureModes captureMode() const Q_DECL_OVERRIDE; - void setCaptureMode(QCamera::CaptureModes) Q_DECL_OVERRIDE; - bool isCaptureModeSupported(QCamera::CaptureModes mode) const Q_DECL_OVERRIDE; - - bool canChangeProperty(PropertyChangeType changeType, QCamera::Status status) const Q_DECL_OVERRIDE; - -private: - BbCameraSession *m_session; -}; - -QT_END_NAMESPACE - -#endif diff --git a/src/plugins/blackberry/camera/bbcameraexposurecontrol.cpp b/src/plugins/blackberry/camera/bbcameraexposurecontrol.cpp deleted file mode 100644 index b1d637cd0..000000000 --- a/src/plugins/blackberry/camera/bbcameraexposurecontrol.cpp +++ /dev/null @@ -1,236 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Research In Motion -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include "bbcameraexposurecontrol.h" - -#include "bbcamerasession.h" - -#include - -QT_BEGIN_NAMESPACE - -BbCameraExposureControl::BbCameraExposureControl(BbCameraSession *session, QObject *parent) - : QCameraExposureControl(parent) - , m_session(session) - , m_requestedExposureMode(QCameraExposure::ExposureAuto) -{ - connect(m_session, SIGNAL(statusChanged(QCamera::Status)), this, SLOT(statusChanged(QCamera::Status))); -} - -bool BbCameraExposureControl::isParameterSupported(ExposureParameter parameter) const -{ - switch (parameter) { - case QCameraExposureControl::ISO: - return false; - case QCameraExposureControl::Aperture: - return false; - case QCameraExposureControl::ShutterSpeed: - return false; - case QCameraExposureControl::ExposureCompensation: - return false; - case QCameraExposureControl::FlashPower: - return false; - case QCameraExposureControl::FlashCompensation: - return false; - case QCameraExposureControl::TorchPower: - return false; - case QCameraExposureControl::SpotMeteringPoint: - return false; - case QCameraExposureControl::ExposureMode: - return true; - case QCameraExposureControl::MeteringMode: - return false; - default: - return false; - } -} - -QVariantList BbCameraExposureControl::supportedParameterRange(ExposureParameter parameter, bool *continuous) const -{ - if (parameter != QCameraExposureControl::ExposureMode) // no other parameter supported by BB10 API at the moment - return QVariantList(); - - if (m_session->status() != QCamera::ActiveStatus) // we can query supported exposure modes only with active viewfinder - return QVariantList(); - - if (continuous) - *continuous = false; - - int supported = 0; - camera_scenemode_t modes[20]; - const camera_error_t result = camera_get_scene_modes(m_session->handle(), 20, &supported, modes); - if (result != CAMERA_EOK) { - qWarning() << "Unable to retrieve supported scene modes:" << result; - return QVariantList(); - } - - QVariantList exposureModes; - for (int i = 0; i < supported; ++i) { - switch (modes[i]) { - case CAMERA_SCENE_AUTO: - exposureModes << QVariant::fromValue(QCameraExposure::ExposureAuto); - break; - case CAMERA_SCENE_SPORTS: - exposureModes << QVariant::fromValue(QCameraExposure::ExposureSports); - break; - case CAMERA_SCENE_CLOSEUP: - exposureModes << QVariant::fromValue(QCameraExposure::ExposurePortrait); - break; - case CAMERA_SCENE_ACTION: - exposureModes << QVariant::fromValue(QCameraExposure::ExposureSports); - break; - case CAMERA_SCENE_BEACHANDSNOW: - exposureModes << QVariant::fromValue(QCameraExposure::ExposureBeach) << QVariant::fromValue(QCameraExposure::ExposureSnow); - break; - case CAMERA_SCENE_NIGHT: - exposureModes << QVariant::fromValue(QCameraExposure::ExposureNight); - break; - default: break; - } - } - - return exposureModes; -} - -QVariant BbCameraExposureControl::requestedValue(ExposureParameter parameter) const -{ - if (parameter != QCameraExposureControl::ExposureMode) // no other parameter supported by BB10 API at the moment - return QVariant(); - - return QVariant::fromValue(m_requestedExposureMode); -} - -QVariant BbCameraExposureControl::actualValue(ExposureParameter parameter) const -{ -#ifndef Q_OS_BLACKBERRY_TABLET - if (parameter != QCameraExposureControl::ExposureMode) // no other parameter supported by BB10 API at the moment - return QVariantList(); - - if (m_session->status() != QCamera::ActiveStatus) // we can query actual scene modes only with active viewfinder - return QVariantList(); - - camera_scenemode_t sceneMode = CAMERA_SCENE_DEFAULT; - const camera_error_t result = camera_get_scene_mode(m_session->handle(), &sceneMode); - - if (result != CAMERA_EOK) { - qWarning() << "Unable to retrieve scene mode:" << result; - return QVariant(); - } - - switch (sceneMode) { - case CAMERA_SCENE_AUTO: - return QVariant::fromValue(QCameraExposure::ExposureAuto); - case CAMERA_SCENE_SPORTS: - return QVariant::fromValue(QCameraExposure::ExposureSports); - case CAMERA_SCENE_CLOSEUP: - return QVariant::fromValue(QCameraExposure::ExposurePortrait); - case CAMERA_SCENE_ACTION: - return QVariant::fromValue(QCameraExposure::ExposureSports); - case CAMERA_SCENE_BEACHANDSNOW: - return (m_requestedExposureMode == QCameraExposure::ExposureBeach ? QVariant::fromValue(QCameraExposure::ExposureBeach) - : QVariant::fromValue(QCameraExposure::ExposureSnow)); - case CAMERA_SCENE_NIGHT: - return QVariant::fromValue(QCameraExposure::ExposureNight); - default: - return QVariant(); - } -#else - return QVariant(); -#endif -} - -bool BbCameraExposureControl::setValue(ExposureParameter parameter, const QVariant& value) -{ - if (parameter != QCameraExposureControl::ExposureMode) // no other parameter supported by BB10 API at the moment - return false; - - if (m_session->status() != QCamera::ActiveStatus) // we can set actual scene modes only with active viewfinder - return false; - - camera_scenemode_t sceneMode = CAMERA_SCENE_DEFAULT; - - if (value.isValid()) { - m_requestedExposureMode = value.value(); - emit requestedValueChanged(QCameraExposureControl::ExposureMode); - - switch (m_requestedExposureMode) { - case QCameraExposure::ExposureAuto: - sceneMode = CAMERA_SCENE_AUTO; - break; - case QCameraExposure::ExposureSports: - sceneMode = CAMERA_SCENE_SPORTS; - break; - case QCameraExposure::ExposurePortrait: - sceneMode = CAMERA_SCENE_CLOSEUP; - break; - case QCameraExposure::ExposureBeach: - sceneMode = CAMERA_SCENE_BEACHANDSNOW; - break; - case QCameraExposure::ExposureSnow: - sceneMode = CAMERA_SCENE_BEACHANDSNOW; - break; - case QCameraExposure::ExposureNight: - sceneMode = CAMERA_SCENE_NIGHT; - break; - default: - sceneMode = CAMERA_SCENE_DEFAULT; - break; - } - } - - const camera_error_t result = camera_set_scene_mode(m_session->handle(), sceneMode); - - if (result != CAMERA_EOK) { - qWarning() << "Unable to set scene mode:" << result; - return false; - } - - emit actualValueChanged(QCameraExposureControl::ExposureMode); - - return true; -} - -void BbCameraExposureControl::statusChanged(QCamera::Status status) -{ - if (status == QCamera::ActiveStatus || status == QCamera::LoadedStatus) - emit parameterRangeChanged(QCameraExposureControl::ExposureMode); -} - -QT_END_NAMESPACE diff --git a/src/plugins/blackberry/camera/bbcameraexposurecontrol.h b/src/plugins/blackberry/camera/bbcameraexposurecontrol.h deleted file mode 100644 index f4659b624..000000000 --- a/src/plugins/blackberry/camera/bbcameraexposurecontrol.h +++ /dev/null @@ -1,73 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Research In Motion -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#ifndef BBCAMERAEXPOSURECONTROL_H -#define BBCAMERAEXPOSURECONTROL_H - -#include - -QT_BEGIN_NAMESPACE - -class BbCameraSession; - -class BbCameraExposureControl : public QCameraExposureControl -{ - Q_OBJECT -public: - explicit BbCameraExposureControl(BbCameraSession *session, QObject *parent = 0); - - virtual bool isParameterSupported(ExposureParameter parameter) const Q_DECL_OVERRIDE; - virtual QVariantList supportedParameterRange(ExposureParameter parameter, bool *continuous) const Q_DECL_OVERRIDE; - - virtual QVariant requestedValue(ExposureParameter parameter) const Q_DECL_OVERRIDE; - virtual QVariant actualValue(ExposureParameter parameter) const Q_DECL_OVERRIDE; - virtual bool setValue(ExposureParameter parameter, const QVariant& value) Q_DECL_OVERRIDE; - -private Q_SLOTS: - void statusChanged(QCamera::Status status); - -private: - BbCameraSession *m_session; - QCameraExposure::ExposureMode m_requestedExposureMode; -}; - -QT_END_NAMESPACE - -#endif diff --git a/src/plugins/blackberry/camera/bbcameraflashcontrol.cpp b/src/plugins/blackberry/camera/bbcameraflashcontrol.cpp deleted file mode 100644 index 06ebe01f6..000000000 --- a/src/plugins/blackberry/camera/bbcameraflashcontrol.cpp +++ /dev/null @@ -1,113 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Research In Motion -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include "bbcameraflashcontrol.h" - -#include "bbcamerasession.h" - -#include - -QT_BEGIN_NAMESPACE - -BbCameraFlashControl::BbCameraFlashControl(BbCameraSession *session, QObject *parent) - : QCameraFlashControl(parent) - , m_session(session) - , m_flashMode(QCameraExposure::FlashAuto) -{ -} - -QCameraExposure::FlashModes BbCameraFlashControl::flashMode() const -{ - return m_flashMode; -} - -void BbCameraFlashControl::setFlashMode(QCameraExposure::FlashModes mode) -{ - if (m_flashMode == mode) - return; - - if (m_session->status() != QCamera::ActiveStatus) // can only be changed when viewfinder is active - return; - - if (m_flashMode == QCameraExposure::FlashVideoLight) { - const camera_error_t result = camera_config_videolight(m_session->handle(), CAMERA_VIDEOLIGHT_OFF); - if (result != CAMERA_EOK) - qWarning() << "Unable to switch off video light:" << result; - } - - m_flashMode = mode; - - if (m_flashMode == QCameraExposure::FlashVideoLight) { - const camera_error_t result = camera_config_videolight(m_session->handle(), CAMERA_VIDEOLIGHT_ON); - if (result != CAMERA_EOK) - qWarning() << "Unable to switch on video light:" << result; - } else { - camera_flashmode_t flashMode = CAMERA_FLASH_AUTO; - - if (m_flashMode.testFlag(QCameraExposure::FlashAuto)) flashMode = CAMERA_FLASH_AUTO; - else if (mode.testFlag(QCameraExposure::FlashOff)) flashMode = CAMERA_FLASH_OFF; - else if (mode.testFlag(QCameraExposure::FlashOn)) flashMode = CAMERA_FLASH_ON; - - const camera_error_t result = camera_config_flash(m_session->handle(), flashMode); - if (result != CAMERA_EOK) - qWarning() << "Unable to configure flash:" << result; - } -} - -bool BbCameraFlashControl::isFlashModeSupported(QCameraExposure::FlashModes mode) const -{ - bool supportsVideoLight = false; - if (m_session->handle() != CAMERA_HANDLE_INVALID) { - supportsVideoLight = camera_has_feature(m_session->handle(), CAMERA_FEATURE_VIDEOLIGHT); - } - - return (mode == QCameraExposure::FlashOff || - mode == QCameraExposure::FlashOn || - mode == QCameraExposure::FlashAuto || - ((mode == QCameraExposure::FlashVideoLight) && supportsVideoLight)); -} - -bool BbCameraFlashControl::isFlashReady() const -{ - //TODO: check for flash charge-level here?!? - return true; -} - -QT_END_NAMESPACE diff --git a/src/plugins/blackberry/camera/bbcameraflashcontrol.h b/src/plugins/blackberry/camera/bbcameraflashcontrol.h deleted file mode 100644 index d46dc8c12..000000000 --- a/src/plugins/blackberry/camera/bbcameraflashcontrol.h +++ /dev/null @@ -1,68 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Research In Motion -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#ifndef BBCAMERAFLASHCONTROL_H -#define BBCAMERAFLASHCONTROL_H - -#include - -QT_BEGIN_NAMESPACE - -class BbCameraSession; - -class BbCameraFlashControl : public QCameraFlashControl -{ - Q_OBJECT -public: - explicit BbCameraFlashControl(BbCameraSession *session, QObject *parent = 0); - - QCameraExposure::FlashModes flashMode() const Q_DECL_OVERRIDE; - void setFlashMode(QCameraExposure::FlashModes mode) Q_DECL_OVERRIDE; - bool isFlashModeSupported(QCameraExposure::FlashModes mode) const Q_DECL_OVERRIDE; - bool isFlashReady() const Q_DECL_OVERRIDE; - -private: - BbCameraSession *m_session; - QCameraExposure::FlashModes m_flashMode; -}; - -QT_END_NAMESPACE - -#endif diff --git a/src/plugins/blackberry/camera/bbcamerafocuscontrol.cpp b/src/plugins/blackberry/camera/bbcamerafocuscontrol.cpp deleted file mode 100644 index e0b57d6c6..000000000 --- a/src/plugins/blackberry/camera/bbcamerafocuscontrol.cpp +++ /dev/null @@ -1,331 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Research In Motion -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include "bbcamerafocuscontrol.h" - -#include "bbcamerasession.h" - -#include - -QT_BEGIN_NAMESPACE - -BbCameraFocusControl::BbCameraFocusControl(BbCameraSession *session, QObject *parent) - : QCameraFocusControl(parent) - , m_session(session) - , m_focusMode(QCameraFocus::FocusModes()) - , m_focusPointMode(QCameraFocus::FocusPointAuto) - , m_customFocusPoint(QPointF(0, 0)) -{ -} - -QCameraFocus::FocusModes BbCameraFocusControl::focusMode() const -{ - camera_focusmode_t focusMode = CAMERA_FOCUSMODE_OFF; - - const camera_error_t result = camera_get_focus_mode(m_session->handle(), &focusMode); - if (result != CAMERA_EOK) { - qWarning() << "Unable to retrieve focus mode from camera:" << result; - return QCameraFocus::FocusModes(); - } - - switch (focusMode) { - case CAMERA_FOCUSMODE_EDOF: - return QCameraFocus::HyperfocalFocus; - case CAMERA_FOCUSMODE_MANUAL: - return QCameraFocus::ManualFocus; - case CAMERA_FOCUSMODE_AUTO: - return QCameraFocus::AutoFocus; - case CAMERA_FOCUSMODE_MACRO: - return QCameraFocus::MacroFocus; - case CAMERA_FOCUSMODE_CONTINUOUS_AUTO: - return QCameraFocus::ContinuousFocus; - case CAMERA_FOCUSMODE_CONTINUOUS_MACRO: // fall through - case CAMERA_FOCUSMODE_OFF: // fall through - default: - return QCameraFocus::FocusModes(); - } -} - -void BbCameraFocusControl::setFocusMode(QCameraFocus::FocusModes mode) -{ - if (m_focusMode == mode) - return; - - camera_focusmode_t focusMode = CAMERA_FOCUSMODE_OFF; - - if (mode == QCameraFocus::HyperfocalFocus) - focusMode = CAMERA_FOCUSMODE_EDOF; - else if (mode == QCameraFocus::ManualFocus) - focusMode = CAMERA_FOCUSMODE_MANUAL; - else if (mode == QCameraFocus::AutoFocus) - focusMode = CAMERA_FOCUSMODE_AUTO; - else if (mode == QCameraFocus::MacroFocus) - focusMode = CAMERA_FOCUSMODE_MACRO; - else if (mode == QCameraFocus::ContinuousFocus) - focusMode = CAMERA_FOCUSMODE_CONTINUOUS_AUTO; - - const camera_error_t result = camera_set_focus_mode(m_session->handle(), focusMode); - - if (result != CAMERA_EOK) { - qWarning() << "Unable to set focus mode:" << result; - return; - } - - m_focusMode = mode; - emit focusModeChanged(m_focusMode); -} - -bool BbCameraFocusControl::isFocusModeSupported(QCameraFocus::FocusModes mode) const -{ - if (m_session->state() == QCamera::UnloadedState) - return false; - - if (mode == QCameraFocus::HyperfocalFocus) - return false; //TODO how to check? - else if (mode == QCameraFocus::ManualFocus) - return camera_has_feature(m_session->handle(), CAMERA_FEATURE_MANUALFOCUS); - else if (mode == QCameraFocus::AutoFocus) - return camera_has_feature(m_session->handle(), CAMERA_FEATURE_AUTOFOCUS); - else if (mode == QCameraFocus::MacroFocus) - return camera_has_feature(m_session->handle(), CAMERA_FEATURE_MACROFOCUS); - else if (mode == QCameraFocus::ContinuousFocus) - return camera_has_feature(m_session->handle(), CAMERA_FEATURE_AUTOFOCUS); - - return false; -} - -QCameraFocus::FocusPointMode BbCameraFocusControl::focusPointMode() const -{ - return m_focusPointMode; -} - -void BbCameraFocusControl::setFocusPointMode(QCameraFocus::FocusPointMode mode) -{ - if (m_session->status() != QCamera::ActiveStatus) - return; - - if (m_focusPointMode == mode) - return; - - m_focusPointMode = mode; - emit focusPointModeChanged(m_focusPointMode); - - if (m_focusPointMode == QCameraFocus::FocusPointAuto) { - //TODO: is this correct? - const camera_error_t result = camera_set_focus_regions(m_session->handle(), 0, 0); - if (result != CAMERA_EOK) { - qWarning() << "Unable to set focus region:" << result; - return; - } - - emit focusZonesChanged(); - } else if (m_focusPointMode == QCameraFocus::FocusPointCenter) { - // get the size of the viewfinder - int viewfinderWidth = 0; - int viewfinderHeight = 0; - - if (!retrieveViewfinderSize(&viewfinderWidth, &viewfinderHeight)) - return; - - // define a 40x40 pixel focus region in the center of the viewfinder - camera_region_t focusRegion; - focusRegion.left = (viewfinderWidth / 2) - 20; - focusRegion.top = (viewfinderHeight / 2) - 20; - focusRegion.width = 40; - focusRegion.height = 40; - - camera_error_t result = camera_set_focus_regions(m_session->handle(), 1, &focusRegion); - if (result != CAMERA_EOK) { - qWarning() << "Unable to set focus region:" << result; - return; - } - - // re-set focus mode to apply focus region changes - camera_focusmode_t focusMode = CAMERA_FOCUSMODE_OFF; - result = camera_get_focus_mode(m_session->handle(), &focusMode); - camera_set_focus_mode(m_session->handle(), focusMode); - - emit focusZonesChanged(); - - } else if (m_focusPointMode == QCameraFocus::FocusPointFaceDetection) { - //TODO: implement later - } else if (m_focusPointMode == QCameraFocus::FocusPointCustom) { - updateCustomFocusRegion(); - } -} - -bool BbCameraFocusControl::isFocusPointModeSupported(QCameraFocus::FocusPointMode mode) const -{ - if (m_session->state() == QCamera::UnloadedState) - return false; - - if (mode == QCameraFocus::FocusPointAuto) { - return camera_has_feature(m_session->handle(), CAMERA_FEATURE_AUTOFOCUS); - } else if (mode == QCameraFocus::FocusPointCenter) { - return camera_has_feature(m_session->handle(), CAMERA_FEATURE_REGIONFOCUS); - } else if (mode == QCameraFocus::FocusPointFaceDetection) { - return false; //TODO: implement via custom region in combination with face detection in viewfinder - } else if (mode == QCameraFocus::FocusPointCustom) { - return camera_has_feature(m_session->handle(), CAMERA_FEATURE_REGIONFOCUS); - } - - return false; -} - -QPointF BbCameraFocusControl::customFocusPoint() const -{ - return m_customFocusPoint; -} - -void BbCameraFocusControl::setCustomFocusPoint(const QPointF &point) -{ - if (m_customFocusPoint == point) - return; - - m_customFocusPoint = point; - emit customFocusPointChanged(m_customFocusPoint); - - updateCustomFocusRegion(); -} - -QCameraFocusZoneList BbCameraFocusControl::focusZones() const -{ - if (m_session->state() == QCamera::UnloadedState) - return QCameraFocusZoneList(); - - camera_region_t regions[20]; - int supported = 0; - int asked = 0; - camera_error_t result = camera_get_focus_regions(m_session->handle(), 20, &supported, &asked, regions); - - if (result != CAMERA_EOK) { - qWarning() << "Unable to retrieve focus regions:" << result; - return QCameraFocusZoneList(); - } - - // retrieve width and height of viewfinder - int viewfinderWidth = 0; - int viewfinderHeight = 0; - if (m_session->captureMode() & QCamera::CaptureStillImage) - result = camera_get_photovf_property(m_session->handle(), - CAMERA_IMGPROP_WIDTH, &viewfinderWidth, - CAMERA_IMGPROP_HEIGHT, &viewfinderHeight); - else if (m_session->captureMode() & QCamera::CaptureVideo) - result = camera_get_videovf_property(m_session->handle(), - CAMERA_IMGPROP_WIDTH, &viewfinderWidth, - CAMERA_IMGPROP_HEIGHT, &viewfinderHeight); - - if (result != CAMERA_EOK) { - qWarning() << "Unable to retrieve viewfinder size:" << result; - return QCameraFocusZoneList(); - } - - QCameraFocusZoneList list; - for (int i = 0; i < asked; ++i) { - const int x = regions[i].left; - const int y = regions[i].top; - const int width = regions[i].width; - const int height = regions[i].height; - - QRectF rect(static_cast(x)/static_cast(viewfinderWidth), - static_cast(y)/static_cast(viewfinderHeight), - static_cast(width)/static_cast(viewfinderWidth), - static_cast(height)/static_cast(viewfinderHeight)); - - list << QCameraFocusZone(rect, QCameraFocusZone::Focused); //TODO: how to know if a zone is unused/selected/focused?!? - } - - return list; -} - -void BbCameraFocusControl::updateCustomFocusRegion() -{ - // get the size of the viewfinder - int viewfinderWidth = 0; - int viewfinderHeight = 0; - - if (!retrieveViewfinderSize(&viewfinderWidth, &viewfinderHeight)) - return; - - // define a 40x40 pixel focus region around the custom focus point - camera_region_t focusRegion; - focusRegion.left = qMax(0, static_cast(m_customFocusPoint.x() * viewfinderWidth) - 20); - focusRegion.top = qMax(0, static_cast(m_customFocusPoint.y() * viewfinderHeight) - 20); - focusRegion.width = 40; - focusRegion.height = 40; - - camera_error_t result = camera_set_focus_regions(m_session->handle(), 1, &focusRegion); - if (result != CAMERA_EOK) { - qWarning() << "Unable to set focus region:" << result; - return; - } - - // re-set focus mode to apply focus region changes - camera_focusmode_t focusMode = CAMERA_FOCUSMODE_OFF; - result = camera_get_focus_mode(m_session->handle(), &focusMode); - camera_set_focus_mode(m_session->handle(), focusMode); - - emit focusZonesChanged(); -} - -bool BbCameraFocusControl::retrieveViewfinderSize(int *width, int *height) -{ - if (!width || !height) - return false; - - camera_error_t result = CAMERA_EOK; - if (m_session->captureMode() & QCamera::CaptureStillImage) - result = camera_get_photovf_property(m_session->handle(), - CAMERA_IMGPROP_WIDTH, width, - CAMERA_IMGPROP_HEIGHT, height); - else if (m_session->captureMode() & QCamera::CaptureVideo) - result = camera_get_videovf_property(m_session->handle(), - CAMERA_IMGPROP_WIDTH, width, - CAMERA_IMGPROP_HEIGHT, height); - - if (result != CAMERA_EOK) { - qWarning() << "Unable to retrieve viewfinder size:" << result; - return false; - } - - return true; -} - -QT_END_NAMESPACE diff --git a/src/plugins/blackberry/camera/bbcamerafocuscontrol.h b/src/plugins/blackberry/camera/bbcamerafocuscontrol.h deleted file mode 100644 index 052c29b4b..000000000 --- a/src/plugins/blackberry/camera/bbcamerafocuscontrol.h +++ /dev/null @@ -1,79 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Research In Motion -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#ifndef BBCAMERAFOCUSCONTROL_H -#define BBCAMERAFOCUSCONTROL_H - -#include - -QT_BEGIN_NAMESPACE - -class BbCameraSession; - -class BbCameraFocusControl : public QCameraFocusControl -{ - Q_OBJECT -public: - explicit BbCameraFocusControl(BbCameraSession *session, QObject *parent = 0); - - QCameraFocus::FocusModes focusMode() const Q_DECL_OVERRIDE; - void setFocusMode(QCameraFocus::FocusModes mode) Q_DECL_OVERRIDE; - bool isFocusModeSupported(QCameraFocus::FocusModes mode) const Q_DECL_OVERRIDE; - QCameraFocus::FocusPointMode focusPointMode() const Q_DECL_OVERRIDE; - void setFocusPointMode(QCameraFocus::FocusPointMode mode) Q_DECL_OVERRIDE; - bool isFocusPointModeSupported(QCameraFocus::FocusPointMode mode) const Q_DECL_OVERRIDE; - QPointF customFocusPoint() const Q_DECL_OVERRIDE; - void setCustomFocusPoint(const QPointF &point) Q_DECL_OVERRIDE; - QCameraFocusZoneList focusZones() const Q_DECL_OVERRIDE; - -private: - void updateCustomFocusRegion(); - bool retrieveViewfinderSize(int *width, int *height); - - BbCameraSession *m_session; - - QCameraFocus::FocusModes m_focusMode; - QCameraFocus::FocusPointMode m_focusPointMode; - QPointF m_customFocusPoint; -}; - -QT_END_NAMESPACE - -#endif diff --git a/src/plugins/blackberry/camera/bbcameraimagecapturecontrol.cpp b/src/plugins/blackberry/camera/bbcameraimagecapturecontrol.cpp deleted file mode 100644 index a2f61f73d..000000000 --- a/src/plugins/blackberry/camera/bbcameraimagecapturecontrol.cpp +++ /dev/null @@ -1,85 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Research In Motion -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include "bbcameraimagecapturecontrol.h" - -#include "bbcamerasession.h" - -QT_BEGIN_NAMESPACE - -BbCameraImageCaptureControl::BbCameraImageCaptureControl(BbCameraSession *session, QObject *parent) - : QCameraImageCaptureControl(parent) - , m_session(session) -{ - connect(m_session, SIGNAL(readyForCaptureChanged(bool)), this, SIGNAL(readyForCaptureChanged(bool))); - connect(m_session, SIGNAL(imageExposed(int)), this, SIGNAL(imageExposed(int))); - connect(m_session, SIGNAL(imageCaptured(int,QImage)), this, SIGNAL(imageCaptured(int,QImage))); - connect(m_session, SIGNAL(imageMetadataAvailable(int,QString,QVariant)), this, SIGNAL(imageMetadataAvailable(int,QString,QVariant))); - connect(m_session, SIGNAL(imageAvailable(int,QVideoFrame)), this, SIGNAL(imageAvailable(int,QVideoFrame))); - connect(m_session, SIGNAL(imageSaved(int,QString)), this, SIGNAL(imageSaved(int,QString))); - connect(m_session, SIGNAL(imageCaptureError(int,int,QString)), this, SIGNAL(error(int,int,QString))); -} - -bool BbCameraImageCaptureControl::isReadyForCapture() const -{ - return m_session->isReadyForCapture(); -} - -QCameraImageCapture::DriveMode BbCameraImageCaptureControl::driveMode() const -{ - return m_session->driveMode(); -} - -void BbCameraImageCaptureControl::setDriveMode(QCameraImageCapture::DriveMode mode) -{ - m_session->setDriveMode(mode); -} - -int BbCameraImageCaptureControl::capture(const QString &fileName) -{ - return m_session->capture(fileName); -} - -void BbCameraImageCaptureControl::cancelCapture() -{ - m_session->cancelCapture(); -} - -QT_END_NAMESPACE diff --git a/src/plugins/blackberry/camera/bbcameraimagecapturecontrol.h b/src/plugins/blackberry/camera/bbcameraimagecapturecontrol.h deleted file mode 100644 index a73a4f1d5..000000000 --- a/src/plugins/blackberry/camera/bbcameraimagecapturecontrol.h +++ /dev/null @@ -1,70 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Research In Motion -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#ifndef BBCAMERAIMAGECAPTURECONTROL_H -#define BBCAMERAIMAGECAPTURECONTROL_H - -#include - -QT_BEGIN_NAMESPACE - -class BbCameraSession; - -class BbCameraImageCaptureControl : public QCameraImageCaptureControl -{ - Q_OBJECT -public: - explicit BbCameraImageCaptureControl(BbCameraSession *session, QObject *parent = 0); - - bool isReadyForCapture() const Q_DECL_OVERRIDE; - - QCameraImageCapture::DriveMode driveMode() const Q_DECL_OVERRIDE; - void setDriveMode(QCameraImageCapture::DriveMode mode) Q_DECL_OVERRIDE; - - int capture(const QString &fileName) Q_DECL_OVERRIDE; - void cancelCapture() Q_DECL_OVERRIDE; - -private: - BbCameraSession *m_session; -}; - -QT_END_NAMESPACE - -#endif diff --git a/src/plugins/blackberry/camera/bbcameraimageprocessingcontrol.cpp b/src/plugins/blackberry/camera/bbcameraimageprocessingcontrol.cpp deleted file mode 100644 index 54ae48c6b..000000000 --- a/src/plugins/blackberry/camera/bbcameraimageprocessingcontrol.cpp +++ /dev/null @@ -1,146 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Research In Motion -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include "bbcameraimageprocessingcontrol.h" - -#include "bbcamerasession.h" - -#include - -QT_BEGIN_NAMESPACE - -BbCameraImageProcessingControl::BbCameraImageProcessingControl(BbCameraSession *session, QObject *parent) - : QCameraImageProcessingControl(parent) - , m_session(session) -{ -} - -bool BbCameraImageProcessingControl::isParameterSupported(ProcessingParameter parameter) const -{ - return (parameter == QCameraImageProcessingControl::WhiteBalancePreset); -} - -bool BbCameraImageProcessingControl::isParameterValueSupported(ProcessingParameter parameter, const QVariant &value) const -{ - if (parameter != QCameraImageProcessingControl::WhiteBalancePreset) - return false; - - if (m_session->handle() == CAMERA_HANDLE_INVALID) - return false; - - int supported = 0; - camera_whitebalancemode_t modes[20]; - const camera_error_t result = camera_get_whitebalance_modes(m_session->handle(), 20, &supported, modes); - - if (result != CAMERA_EOK) { - qWarning() << "Unable to retrieve supported whitebalance modes:" << result; - return false; - } - - QSet supportedModes; - for (int i = 0; i < supported; ++i) { - switch (modes[i]) { - case CAMERA_WHITEBALANCEMODE_AUTO: - supportedModes.insert(QCameraImageProcessing::WhiteBalanceAuto); - break; - case CAMERA_WHITEBALANCEMODE_MANUAL: - supportedModes.insert(QCameraImageProcessing::WhiteBalanceManual); - break; - default: - break; - } - } - - return supportedModes.contains(value.value()); -} - -QVariant BbCameraImageProcessingControl::parameter(ProcessingParameter parameter) const -{ - if (parameter != QCameraImageProcessingControl::WhiteBalancePreset) - return QVariant(); - - if (m_session->handle() == CAMERA_HANDLE_INVALID) - return QVariant(); - - camera_whitebalancemode_t mode; - const camera_error_t result = camera_get_whitebalance_mode(m_session->handle(), &mode); - - if (result != CAMERA_EOK) { - qWarning() << "Unable to retrieve current whitebalance mode:" << result; - return QVariant(); - } - - switch (mode) { - case CAMERA_WHITEBALANCEMODE_AUTO: - return QVariant::fromValue(QCameraImageProcessing::WhiteBalanceAuto); - case CAMERA_WHITEBALANCEMODE_MANUAL: - return QVariant::fromValue(QCameraImageProcessing::WhiteBalanceManual); - default: - return QVariant(); - } -} - -void BbCameraImageProcessingControl::setParameter(ProcessingParameter parameter, const QVariant &value) -{ - if (parameter != QCameraImageProcessingControl::WhiteBalancePreset) - return; - - if (m_session->handle() == CAMERA_HANDLE_INVALID) - return; - - camera_whitebalancemode_t mode = CAMERA_WHITEBALANCEMODE_DEFAULT; - switch (value.value()) { - case QCameraImageProcessing::WhiteBalanceAuto: - mode = CAMERA_WHITEBALANCEMODE_AUTO; - break; - case QCameraImageProcessing::WhiteBalanceManual: - mode = CAMERA_WHITEBALANCEMODE_MANUAL; - break; - default: - break; - } - - const camera_error_t result = camera_set_whitebalance_mode(m_session->handle(), mode); - - if (result != CAMERA_EOK) - qWarning() << "Unable to set whitebalance mode:" << result; -} - -QT_END_NAMESPACE diff --git a/src/plugins/blackberry/camera/bbcameraimageprocessingcontrol.h b/src/plugins/blackberry/camera/bbcameraimageprocessingcontrol.h deleted file mode 100644 index ec16d66d7..000000000 --- a/src/plugins/blackberry/camera/bbcameraimageprocessingcontrol.h +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Research In Motion -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#ifndef BBCAMERAIMAGEPROCESSINGCONTROL_H -#define BBCAMERAIMAGEPROCESSINGCONTROL_H - -#include - -QT_BEGIN_NAMESPACE - -class BbCameraSession; - -class BbCameraImageProcessingControl : public QCameraImageProcessingControl -{ - Q_OBJECT -public: - explicit BbCameraImageProcessingControl(BbCameraSession *session, QObject *parent = 0); - - bool isParameterSupported(ProcessingParameter) const Q_DECL_OVERRIDE; - bool isParameterValueSupported(ProcessingParameter parameter, const QVariant &value) const Q_DECL_OVERRIDE; - QVariant parameter(ProcessingParameter parameter) const Q_DECL_OVERRIDE; - void setParameter(ProcessingParameter parameter, const QVariant &value) Q_DECL_OVERRIDE; - -private: - BbCameraSession *m_session; -}; - -QT_END_NAMESPACE - -#endif diff --git a/src/plugins/blackberry/camera/bbcameralockscontrol.cpp b/src/plugins/blackberry/camera/bbcameralockscontrol.cpp deleted file mode 100644 index d2537361c..000000000 --- a/src/plugins/blackberry/camera/bbcameralockscontrol.cpp +++ /dev/null @@ -1,258 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Research In Motion -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include "bbcameralockscontrol.h" - -#include "bbcamerasession.h" - -QT_BEGIN_NAMESPACE - -BbCameraLocksControl::BbCameraLocksControl(BbCameraSession *session, QObject *parent) - : QCameraLocksControl(parent) - , m_session(session) - , m_locksApplyMode(IndependentMode) - , m_focusLockStatus(QCamera::Unlocked) - , m_exposureLockStatus(QCamera::Unlocked) - , m_whiteBalanceLockStatus(QCamera::Unlocked) - , m_currentLockTypes(QCamera::NoLock) - , m_supportedLockTypes(QCamera::NoLock) -{ - connect(m_session, SIGNAL(cameraOpened()), SLOT(cameraOpened())); - connect(m_session, SIGNAL(focusStatusChanged(int)), SLOT(focusStatusChanged(int))); -} - -QCamera::LockTypes BbCameraLocksControl::supportedLocks() const -{ - return (QCamera::LockFocus | QCamera::LockExposure | QCamera::LockWhiteBalance); -} - -QCamera::LockStatus BbCameraLocksControl::lockStatus(QCamera::LockType lock) const -{ - if (!m_supportedLockTypes.testFlag(lock) || (m_session->handle() == CAMERA_HANDLE_INVALID)) - return QCamera::Locked; - - switch (lock) { - case QCamera::LockExposure: - return m_exposureLockStatus; - case QCamera::LockWhiteBalance: - return m_whiteBalanceLockStatus; - case QCamera::LockFocus: - return m_focusLockStatus; - default: - return QCamera::Locked; - } -} - -void BbCameraLocksControl::searchAndLock(QCamera::LockTypes locks) -{ - if (m_session->handle() == CAMERA_HANDLE_INVALID) - return; - - // filter out unsupported locks - locks &= m_supportedLockTypes; - - m_currentLockTypes |= locks; - - uint32_t lockModes = CAMERA_3A_NONE; - - switch (m_locksApplyMode) { - case IndependentMode: - if (m_currentLockTypes & QCamera::LockExposure) - lockModes |= CAMERA_3A_AUTOEXPOSURE; - if (m_currentLockTypes & QCamera::LockWhiteBalance) - lockModes |= CAMERA_3A_AUTOWHITEBALANCE; - if (m_currentLockTypes & QCamera::LockFocus) - lockModes |= CAMERA_3A_AUTOFOCUS; - break; - case FocusExposureBoundMode: - if ((m_currentLockTypes & QCamera::LockExposure) || (m_currentLockTypes & QCamera::LockFocus)) - lockModes = (CAMERA_3A_AUTOEXPOSURE | CAMERA_3A_AUTOFOCUS); - break; - case AllBoundMode: - lockModes = (CAMERA_3A_AUTOEXPOSURE | CAMERA_3A_AUTOFOCUS | CAMERA_3A_AUTOWHITEBALANCE); - break; - case FocusOnlyMode: - lockModes = CAMERA_3A_AUTOFOCUS; - break; - } - - const camera_error_t result = camera_set_3a_lock(m_session->handle(), lockModes); - - if (result != CAMERA_EOK) { - qWarning() << "Unable to set lock modes:" << result; - } else { - if (lockModes & CAMERA_3A_AUTOFOCUS) { - // handled by focusStatusChanged() - } - - if (lockModes & CAMERA_3A_AUTOEXPOSURE) { - m_exposureLockStatus = QCamera::Locked; - emit lockStatusChanged(QCamera::LockExposure, QCamera::Locked, QCamera::LockAcquired); - } - - if (lockModes & CAMERA_3A_AUTOWHITEBALANCE) { - m_whiteBalanceLockStatus = QCamera::Locked; - emit lockStatusChanged(QCamera::LockWhiteBalance, QCamera::Locked, QCamera::LockAcquired); - } - } -} - -void BbCameraLocksControl::unlock(QCamera::LockTypes locks) -{ - // filter out unsupported locks - locks &= m_supportedLockTypes; - - m_currentLockTypes &= ~locks; - - uint32_t lockModes = CAMERA_3A_NONE; - - switch (m_locksApplyMode) { - case IndependentMode: - if (m_currentLockTypes & QCamera::LockExposure) - lockModes |= CAMERA_3A_AUTOEXPOSURE; - if (m_currentLockTypes & QCamera::LockWhiteBalance) - lockModes |= CAMERA_3A_AUTOWHITEBALANCE; - if (m_currentLockTypes & QCamera::LockFocus) - lockModes |= CAMERA_3A_AUTOFOCUS; - break; - case FocusExposureBoundMode: - if ((m_currentLockTypes & QCamera::LockExposure) || (m_currentLockTypes & QCamera::LockFocus)) - lockModes = (CAMERA_3A_AUTOEXPOSURE | CAMERA_3A_AUTOFOCUS); - break; - case AllBoundMode: - lockModes = (CAMERA_3A_AUTOEXPOSURE | CAMERA_3A_AUTOFOCUS | CAMERA_3A_AUTOWHITEBALANCE); - break; - case FocusOnlyMode: - lockModes = CAMERA_3A_AUTOFOCUS; - break; - } - - const camera_error_t result = camera_set_3a_lock(m_session->handle(), lockModes); - - if (result != CAMERA_EOK) { - qWarning() << "Unable to set lock modes:" << result; - } else { - if (locks.testFlag(QCamera::LockFocus)) { - // handled by focusStatusChanged() - } - - if (locks.testFlag(QCamera::LockExposure)) { - m_exposureLockStatus = QCamera::Unlocked; - emit lockStatusChanged(QCamera::LockExposure, QCamera::Unlocked, QCamera::UserRequest); - } - - if (locks.testFlag(QCamera::LockWhiteBalance)) { - m_whiteBalanceLockStatus = QCamera::Unlocked; - emit lockStatusChanged(QCamera::LockWhiteBalance, QCamera::Unlocked, QCamera::UserRequest); - } - } -} - -void BbCameraLocksControl::cameraOpened() -{ - // retrieve information about lock apply modes - int supported = 0; - uint32_t modes[20]; - - const camera_error_t result = camera_get_3a_lock_modes(m_session->handle(), 20, &supported, modes); - - if (result == CAMERA_EOK) { - // see API documentation of camera_get_3a_lock_modes for explanation of case discrimination below - if (supported == 4) { - m_locksApplyMode = IndependentMode; - } else if (supported == 3) { - m_locksApplyMode = FocusExposureBoundMode; - } else if (supported == 2) { - if (modes[0] == (CAMERA_3A_AUTOFOCUS | CAMERA_3A_AUTOEXPOSURE | CAMERA_3A_AUTOWHITEBALANCE)) - m_locksApplyMode = AllBoundMode; - else - m_locksApplyMode = FocusOnlyMode; - } - } - - // retrieve information about supported lock types - m_supportedLockTypes = QCamera::NoLock; - - if (camera_has_feature(m_session->handle(), CAMERA_FEATURE_AUTOFOCUS)) - m_supportedLockTypes |= QCamera::LockFocus; - - if (camera_has_feature(m_session->handle(), CAMERA_FEATURE_AUTOEXPOSURE)) - m_supportedLockTypes |= QCamera::LockExposure; - - if (camera_has_feature(m_session->handle(), CAMERA_FEATURE_AUTOWHITEBALANCE)) - m_supportedLockTypes |= QCamera::LockWhiteBalance; - - m_focusLockStatus = QCamera::Unlocked; - m_exposureLockStatus = QCamera::Unlocked; - m_whiteBalanceLockStatus = QCamera::Unlocked; -} - -void BbCameraLocksControl::focusStatusChanged(int value) -{ - const camera_focusstate_t focusState = static_cast(value); - - switch (focusState) { - case CAMERA_FOCUSSTATE_NONE: - m_focusLockStatus = QCamera::Unlocked; - emit lockStatusChanged(QCamera::LockFocus, QCamera::Unlocked, QCamera::UserRequest); - break; - case CAMERA_FOCUSSTATE_WAITING: - case CAMERA_FOCUSSTATE_SEARCHING: - m_focusLockStatus = QCamera::Searching; - emit lockStatusChanged(QCamera::LockFocus, QCamera::Searching, QCamera::UserRequest); - break; - case CAMERA_FOCUSSTATE_FAILED: - m_focusLockStatus = QCamera::Unlocked; - emit lockStatusChanged(QCamera::LockFocus, QCamera::Unlocked, QCamera::LockFailed); - break; - case CAMERA_FOCUSSTATE_LOCKED: - m_focusLockStatus = QCamera::Locked; - emit lockStatusChanged(QCamera::LockFocus, QCamera::Locked, QCamera::LockAcquired); - break; - case CAMERA_FOCUSSTATE_SCENECHANGE: - m_focusLockStatus = QCamera::Unlocked; - emit lockStatusChanged(QCamera::LockFocus, QCamera::Unlocked, QCamera::LockTemporaryLost); - break; - default: - break; - } -} - -QT_END_NAMESPACE diff --git a/src/plugins/blackberry/camera/bbcameralockscontrol.h b/src/plugins/blackberry/camera/bbcameralockscontrol.h deleted file mode 100644 index 8257abdbc..000000000 --- a/src/plugins/blackberry/camera/bbcameralockscontrol.h +++ /dev/null @@ -1,86 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Research In Motion -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#ifndef BBCAMERALOCKSCONTROL_H -#define BBCAMERALOCKSCONTROL_H - -#include - -QT_BEGIN_NAMESPACE - -class BbCameraSession; - -class BbCameraLocksControl : public QCameraLocksControl -{ - Q_OBJECT -public: - enum LocksApplyMode - { - IndependentMode, - FocusExposureBoundMode, - AllBoundMode, - FocusOnlyMode - }; - - explicit BbCameraLocksControl(BbCameraSession *session, QObject *parent = 0); - - QCamera::LockTypes supportedLocks() const Q_DECL_OVERRIDE; - QCamera::LockStatus lockStatus(QCamera::LockType lock) const Q_DECL_OVERRIDE; - void searchAndLock(QCamera::LockTypes locks) Q_DECL_OVERRIDE; - void unlock(QCamera::LockTypes locks) Q_DECL_OVERRIDE; - -private Q_SLOTS: - void cameraOpened(); - void focusStatusChanged(int value); - -private: - BbCameraSession *m_session; - - LocksApplyMode m_locksApplyMode; - QCamera::LockStatus m_focusLockStatus; - QCamera::LockStatus m_exposureLockStatus; - QCamera::LockStatus m_whiteBalanceLockStatus; - QCamera::LockTypes m_currentLockTypes; - QCamera::LockTypes m_supportedLockTypes; -}; - -QT_END_NAMESPACE - -#endif diff --git a/src/plugins/blackberry/camera/bbcameramediarecordercontrol.cpp b/src/plugins/blackberry/camera/bbcameramediarecordercontrol.cpp deleted file mode 100644 index 44c19fb46..000000000 --- a/src/plugins/blackberry/camera/bbcameramediarecordercontrol.cpp +++ /dev/null @@ -1,169 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Research In Motion -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include "bbcameramediarecordercontrol.h" - -#include "bbcamerasession.h" - -#include -#include - -#ifndef Q_OS_BLACKBERRY_TABLET -#include