Remove BlackBerry PlayBook support.
Change-Id: I21f9c21bd3badd30f3a989ce3412c9ad03f5f21d Reviewed-by: Bernd Weimer <bernd.weimer@pelagicore.com> Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
This commit is contained in:
committed by
Yoann Lopes
parent
178c040168
commit
e5ffc6a876
@@ -131,7 +131,6 @@ QVariant BbCameraExposureControl::requestedValue(ExposureParameter parameter) co
|
|||||||
|
|
||||||
QVariant BbCameraExposureControl::actualValue(ExposureParameter parameter) const
|
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
|
if (parameter != QCameraExposureControl::ExposureMode) // no other parameter supported by BB10 API at the moment
|
||||||
return QVariantList();
|
return QVariantList();
|
||||||
|
|
||||||
@@ -161,11 +160,10 @@ QVariant BbCameraExposureControl::actualValue(ExposureParameter parameter) const
|
|||||||
case CAMERA_SCENE_NIGHT:
|
case CAMERA_SCENE_NIGHT:
|
||||||
return QVariant::fromValue(QCameraExposure::ExposureNight);
|
return QVariant::fromValue(QCameraExposure::ExposureNight);
|
||||||
default:
|
default:
|
||||||
return QVariant();
|
break;
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
return QVariant();
|
return QVariant();
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BbCameraExposureControl::setValue(ExposureParameter parameter, const QVariant& value)
|
bool BbCameraExposureControl::setValue(ExposureParameter parameter, const QVariant& value)
|
||||||
|
|||||||
@@ -37,14 +37,11 @@
|
|||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
|
|
||||||
#ifndef Q_OS_BLACKBERRY_TABLET
|
|
||||||
#include <audio/audio_manager_device.h>
|
#include <audio/audio_manager_device.h>
|
||||||
#include <audio/audio_manager_volume.h>
|
#include <audio/audio_manager_volume.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
#ifndef Q_OS_BLACKBERRY_TABLET
|
|
||||||
static audio_manager_device_t currentAudioInputDevice()
|
static audio_manager_device_t currentAudioInputDevice()
|
||||||
{
|
{
|
||||||
audio_manager_device_t device = AUDIO_DEVICE_HEADSET;
|
audio_manager_device_t device = AUDIO_DEVICE_HEADSET;
|
||||||
@@ -57,7 +54,6 @@ static audio_manager_device_t currentAudioInputDevice()
|
|||||||
|
|
||||||
return device;
|
return device;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
BbCameraMediaRecorderControl::BbCameraMediaRecorderControl(BbCameraSession *session, QObject *parent)
|
BbCameraMediaRecorderControl::BbCameraMediaRecorderControl(BbCameraSession *session, QObject *parent)
|
||||||
: QMediaRecorderControl(parent)
|
: QMediaRecorderControl(parent)
|
||||||
@@ -99,13 +95,12 @@ bool BbCameraMediaRecorderControl::isMuted() const
|
|||||||
{
|
{
|
||||||
bool muted = false;
|
bool muted = false;
|
||||||
|
|
||||||
#ifndef Q_OS_BLACKBERRY_TABLET
|
|
||||||
const int result = audio_manager_get_input_mute(currentAudioInputDevice(), &muted);
|
const int result = audio_manager_get_input_mute(currentAudioInputDevice(), &muted);
|
||||||
if (result != EOK) {
|
if (result != EOK) {
|
||||||
emit const_cast<BbCameraMediaRecorderControl*>(this)->error(QMediaRecorder::ResourceError, tr("Unable to retrieve mute status"));
|
emit const_cast<BbCameraMediaRecorderControl*>(this)->error(QMediaRecorder::ResourceError, tr("Unable to retrieve mute status"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
return muted;
|
return muted;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -113,13 +108,11 @@ qreal BbCameraMediaRecorderControl::volume() const
|
|||||||
{
|
{
|
||||||
double level = 0.0;
|
double level = 0.0;
|
||||||
|
|
||||||
#ifndef Q_OS_BLACKBERRY_TABLET
|
|
||||||
const int result = audio_manager_get_input_level(currentAudioInputDevice(), &level);
|
const int result = audio_manager_get_input_level(currentAudioInputDevice(), &level);
|
||||||
if (result != EOK) {
|
if (result != EOK) {
|
||||||
emit const_cast<BbCameraMediaRecorderControl*>(this)->error(QMediaRecorder::ResourceError, tr("Unable to retrieve audio input volume"));
|
emit const_cast<BbCameraMediaRecorderControl*>(this)->error(QMediaRecorder::ResourceError, tr("Unable to retrieve audio input volume"));
|
||||||
return 0.0;
|
return 0.0;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
return (level / 100);
|
return (level / 100);
|
||||||
}
|
}
|
||||||
@@ -136,26 +129,22 @@ void BbCameraMediaRecorderControl::setState(QMediaRecorder::State state)
|
|||||||
|
|
||||||
void BbCameraMediaRecorderControl::setMuted(bool muted)
|
void BbCameraMediaRecorderControl::setMuted(bool muted)
|
||||||
{
|
{
|
||||||
#ifndef Q_OS_BLACKBERRY_TABLET
|
|
||||||
const int result = audio_manager_set_input_mute(currentAudioInputDevice(), muted);
|
const int result = audio_manager_set_input_mute(currentAudioInputDevice(), muted);
|
||||||
if (result != EOK) {
|
if (result != EOK) {
|
||||||
emit error(QMediaRecorder::ResourceError, tr("Unable to set mute status"));
|
emit error(QMediaRecorder::ResourceError, tr("Unable to set mute status"));
|
||||||
} else {
|
} else {
|
||||||
emit mutedChanged(muted);
|
emit mutedChanged(muted);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void BbCameraMediaRecorderControl::setVolume(qreal volume)
|
void BbCameraMediaRecorderControl::setVolume(qreal volume)
|
||||||
{
|
{
|
||||||
#ifndef Q_OS_BLACKBERRY_TABLET
|
|
||||||
const int result = audio_manager_set_input_level(currentAudioInputDevice(), (volume * 100));
|
const int result = audio_manager_set_input_level(currentAudioInputDevice(), (volume * 100));
|
||||||
if (result != EOK) {
|
if (result != EOK) {
|
||||||
emit error(QMediaRecorder::ResourceError, tr("Unable to set audio input volume"));
|
emit error(QMediaRecorder::ResourceError, tr("Unable to set audio input volume"));
|
||||||
} else {
|
} else {
|
||||||
emit volumeChanged(volume);
|
emit volumeChanged(volume);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|||||||
@@ -63,11 +63,9 @@ BbCameraOrientationHandler::BbCameraOrientationHandler(QObject *parent)
|
|||||||
|
|
||||||
BbCameraOrientationHandler::~BbCameraOrientationHandler()
|
BbCameraOrientationHandler::~BbCameraOrientationHandler()
|
||||||
{
|
{
|
||||||
#ifndef Q_OS_BLACKBERRY_TABLET
|
|
||||||
const int result = orientation_stop_events(0);
|
const int result = orientation_stop_events(0);
|
||||||
if (result == BPS_FAILURE)
|
if (result == BPS_FAILURE)
|
||||||
qWarning() << "Unable to unregister for orientation change events";
|
qWarning() << "Unable to unregister for orientation change events";
|
||||||
#endif
|
|
||||||
|
|
||||||
QCoreApplication::eventDispatcher()->removeNativeEventFilter(this);
|
QCoreApplication::eventDispatcher()->removeNativeEventFilter(this);
|
||||||
}
|
}
|
||||||
@@ -80,10 +78,9 @@ bool BbCameraOrientationHandler::nativeEventFilter(const QByteArray&, void *mess
|
|||||||
|
|
||||||
const int angle = orientation_event_get_angle(event);
|
const int angle = orientation_event_get_angle(event);
|
||||||
if (angle != m_orientation) {
|
if (angle != m_orientation) {
|
||||||
#ifndef Q_OS_BLACKBERRY_TABLET
|
|
||||||
if (angle == 180) // The screen does not rotate at 180 degrees
|
if (angle == 180) // The screen does not rotate at 180 degrees
|
||||||
return false;
|
return false;
|
||||||
#endif
|
|
||||||
m_orientation = angle;
|
m_orientation = angle;
|
||||||
emit orientationChanged(m_orientation);
|
emit orientationChanged(m_orientation);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -83,7 +83,6 @@ static QString errorToString(camera_error_t error)
|
|||||||
return QLatin1String("Callback registration failed");
|
return QLatin1String("Callback registration failed");
|
||||||
case CAMERA_EMICINUSE:
|
case CAMERA_EMICINUSE:
|
||||||
return QLatin1String("Microphone in use already");
|
return QLatin1String("Microphone in use already");
|
||||||
#ifndef Q_OS_BLACKBERRY_TABLET
|
|
||||||
case CAMERA_ENODATA:
|
case CAMERA_ENODATA:
|
||||||
return QLatin1String("Data does not exist");
|
return QLatin1String("Data does not exist");
|
||||||
case CAMERA_EBUSY:
|
case CAMERA_EBUSY:
|
||||||
@@ -98,7 +97,6 @@ static QString errorToString(camera_error_t error)
|
|||||||
return QLatin1String("3A have been locked");
|
return QLatin1String("3A have been locked");
|
||||||
// case CAMERA_EVIEWFINDERFROZEN: // not yet available in 10.2 NDK
|
// case CAMERA_EVIEWFINDERFROZEN: // not yet available in 10.2 NDK
|
||||||
// return QLatin1String("Freeze flag set");
|
// return QLatin1String("Freeze flag set");
|
||||||
#endif
|
|
||||||
default:
|
default:
|
||||||
return QLatin1String("Unknown error");
|
return QLatin1String("Unknown error");
|
||||||
}
|
}
|
||||||
@@ -561,7 +559,6 @@ void BbCameraSession::applyVideoSettings()
|
|||||||
|
|
||||||
const QSize resolution = m_videoEncoderSettings.resolution();
|
const QSize resolution = m_videoEncoderSettings.resolution();
|
||||||
|
|
||||||
#ifndef Q_OS_BLACKBERRY_TABLET
|
|
||||||
QString videoCodec = m_videoEncoderSettings.codec();
|
QString videoCodec = m_videoEncoderSettings.codec();
|
||||||
if (videoCodec.isEmpty())
|
if (videoCodec.isEmpty())
|
||||||
videoCodec = QLatin1String("h264");
|
videoCodec = QLatin1String("h264");
|
||||||
@@ -599,11 +596,6 @@ void BbCameraSession::applyVideoSettings()
|
|||||||
CAMERA_IMGPROP_ROTATION, rotationAngle,
|
CAMERA_IMGPROP_ROTATION, rotationAngle,
|
||||||
CAMERA_IMGPROP_VIDEOCODEC, cameraVideoCodec,
|
CAMERA_IMGPROP_VIDEOCODEC, cameraVideoCodec,
|
||||||
CAMERA_IMGPROP_AUDIOCODEC, cameraAudioCodec);
|
CAMERA_IMGPROP_AUDIOCODEC, cameraAudioCodec);
|
||||||
#else
|
|
||||||
result = camera_set_video_property(m_handle,
|
|
||||||
CAMERA_IMGPROP_WIDTH, resolution.width(),
|
|
||||||
CAMERA_IMGPROP_HEIGHT, resolution.height());
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (result != CAMERA_EOK) {
|
if (result != CAMERA_EOK) {
|
||||||
qWarning() << "Unable to apply video settings:" << result;
|
qWarning() << "Unable to apply video settings:" << result;
|
||||||
@@ -864,13 +856,10 @@ static void viewFinderStatusCallback(camera_handle_t handle, camera_devstatus_t
|
|||||||
BbCameraSession *session = static_cast<BbCameraSession*>(context);
|
BbCameraSession *session = static_cast<BbCameraSession*>(context);
|
||||||
QMetaObject::invokeMethod(session, "focusStatusChanged", Qt::QueuedConnection, Q_ARG(int, value));
|
QMetaObject::invokeMethod(session, "focusStatusChanged", Qt::QueuedConnection, Q_ARG(int, value));
|
||||||
return;
|
return;
|
||||||
}
|
} else if (status == CAMERA_STATUS_POWERUP) {
|
||||||
#ifndef Q_OS_BLACKBERRY_TABLET
|
|
||||||
else if (status == CAMERA_STATUS_POWERUP) {
|
|
||||||
BbCameraSession *session = static_cast<BbCameraSession*>(context);
|
BbCameraSession *session = static_cast<BbCameraSession*>(context);
|
||||||
QMetaObject::invokeMethod(session, "handleCameraPowerUp", Qt::QueuedConnection);
|
QMetaObject::invokeMethod(session, "handleCameraPowerUp", Qt::QueuedConnection);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BbCameraSession::startViewFinder()
|
bool BbCameraSession::startViewFinder()
|
||||||
@@ -1027,7 +1016,6 @@ static void videoRecordingStatusCallback(camera_handle_t handle, camera_devstatu
|
|||||||
Q_UNUSED(handle)
|
Q_UNUSED(handle)
|
||||||
Q_UNUSED(value)
|
Q_UNUSED(value)
|
||||||
|
|
||||||
#ifndef Q_OS_BLACKBERRY_TABLET
|
|
||||||
if (status == CAMERA_STATUS_VIDEO_PAUSE) {
|
if (status == CAMERA_STATUS_VIDEO_PAUSE) {
|
||||||
BbCameraSession *session = static_cast<BbCameraSession*>(context);
|
BbCameraSession *session = static_cast<BbCameraSession*>(context);
|
||||||
QMetaObject::invokeMethod(session, "handleVideoRecordingPaused", Qt::QueuedConnection);
|
QMetaObject::invokeMethod(session, "handleVideoRecordingPaused", Qt::QueuedConnection);
|
||||||
@@ -1035,7 +1023,6 @@ static void videoRecordingStatusCallback(camera_handle_t handle, camera_devstatu
|
|||||||
BbCameraSession *session = static_cast<BbCameraSession*>(context);
|
BbCameraSession *session = static_cast<BbCameraSession*>(context);
|
||||||
QMetaObject::invokeMethod(session, "handleVideoRecordingResumed", Qt::QueuedConnection);
|
QMetaObject::invokeMethod(session, "handleVideoRecordingResumed", Qt::QueuedConnection);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BbCameraSession::startVideoRecording()
|
bool BbCameraSession::startVideoRecording()
|
||||||
|
|||||||
@@ -148,12 +148,10 @@ QVariant BbCameraViewfinderSettingsControl::viewfinderParameter(ViewfinderParame
|
|||||||
return QVideoFrame::Format_Invalid;
|
return QVideoFrame::Format_Invalid;
|
||||||
case CAMERA_FRAMETYPE_CBYCRY:
|
case CAMERA_FRAMETYPE_CBYCRY:
|
||||||
return QVideoFrame::Format_Invalid;
|
return QVideoFrame::Format_Invalid;
|
||||||
#ifndef Q_OS_BLACKBERRY_TABLET
|
|
||||||
case CAMERA_FRAMETYPE_COMPRESSEDVIDEO:
|
case CAMERA_FRAMETYPE_COMPRESSEDVIDEO:
|
||||||
return QVideoFrame::Format_Invalid;
|
return QVideoFrame::Format_Invalid;
|
||||||
case CAMERA_FRAMETYPE_COMPRESSEDAUDIO:
|
case CAMERA_FRAMETYPE_COMPRESSEDAUDIO:
|
||||||
return QVideoFrame::Format_Invalid;
|
return QVideoFrame::Format_Invalid;
|
||||||
#endif
|
|
||||||
default:
|
default:
|
||||||
return QVideoFrame::Format_Invalid;
|
return QVideoFrame::Format_Invalid;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,8 +48,5 @@ SOURCES += \
|
|||||||
$$PWD/bbvideodeviceselectorcontrol.cpp \
|
$$PWD/bbvideodeviceselectorcontrol.cpp \
|
||||||
$$PWD/bbvideorenderercontrol.cpp
|
$$PWD/bbvideorenderercontrol.cpp
|
||||||
|
|
||||||
LIBS += -lcamapi
|
LIBS += -lcamapi -laudio_manager
|
||||||
|
|
||||||
!blackberry-playbook {
|
|
||||||
LIBS += -laudio_manager
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -127,30 +127,6 @@ void WindowGrabber::start()
|
|||||||
|
|
||||||
int result = 0;
|
int result = 0;
|
||||||
|
|
||||||
#ifdef Q_OS_BLACKBERRY_TABLET
|
|
||||||
|
|
||||||
// HACK: On the Playbook, screen_read_window() will fail for invisible windows.
|
|
||||||
// To workaround this, make the window visible again, but set a global
|
|
||||||
// alpha of less than 255. The global alpha makes the window completely invisible
|
|
||||||
// (due to a bug?), but screen_read_window() will work again.
|
|
||||||
|
|
||||||
errno = 0;
|
|
||||||
int val = 200; // anything less than 255
|
|
||||||
result = screen_set_window_property_iv(m_window, SCREEN_PROPERTY_GLOBAL_ALPHA, &val);
|
|
||||||
if (result != 0) {
|
|
||||||
qWarning() << "WindowGrabber: unable to set global alpha:" << strerror(errno);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
errno = 0;
|
|
||||||
val = 1;
|
|
||||||
result = screen_set_window_property_iv(m_window, SCREEN_PROPERTY_VISIBLE, &val);
|
|
||||||
if (result != 0) {
|
|
||||||
qWarning() << "WindowGrabber: unable to make window visible:" << strerror(errno);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
result = screen_create_context(&m_screenContext, SCREEN_APPLICATION_CONTEXT);
|
result = screen_create_context(&m_screenContext, SCREEN_APPLICATION_CONTEXT);
|
||||||
if (result != 0) {
|
if (result != 0) {
|
||||||
qWarning() << "WindowGrabber: cannot create screen context:" << strerror(errno);
|
qWarning() << "WindowGrabber: cannot create screen context:" << strerror(errno);
|
||||||
|
|||||||
Reference in New Issue
Block a user