Merge remote-tracking branch 'origin/stable' into dev

Conflicts:
	src/plugins/blackberry/camera/bbcamerasession.cpp

Change-Id: I7c86e10140ab86fd2a07e2f034dec38ae9112559
This commit is contained in:
Frederik Gladhorn
2013-10-11 16:18:46 +02:00
96 changed files with 2113 additions and 1286 deletions

View File

@@ -75,8 +75,6 @@ static QString errorToString(camera_error_t error)
return QLatin1String("No permission");
case CAMERA_EBADR:
return QLatin1String("Invalid file descriptor");
case CAMERA_ENODATA:
return QLatin1String("Data does not exist");
case CAMERA_ENOENT:
return QLatin1String("File or directory does not exists");
case CAMERA_ENOMEM:
@@ -87,24 +85,28 @@ static QString errorToString(camera_error_t error)
return QLatin1String("Communication timeout");
case CAMERA_EALREADY:
return QLatin1String("Operation already in progress");
case CAMERA_EBUSY:
return QLatin1String("Camera busy");
case CAMERA_ENOSPC:
return QLatin1String("Disk is full");
case CAMERA_EUNINIT:
return QLatin1String("Camera library not initialized");
case CAMERA_EREGFAULT:
return QLatin1String("Callback registration failed");
case CAMERA_EMICINUSE:
return QLatin1String("Microphone in use already");
#ifndef Q_OS_BLACKBERRY_TABLET
case CAMERA_ENODATA:
return QLatin1String("Data does not exist");
case CAMERA_EBUSY:
return QLatin1String("Camera busy");
case CAMERA_EDESKTOPCAMERAINUSE:
return QLatin1String("Desktop camera in use already");
case CAMERA_ENOSPC:
return QLatin1String("Disk is full");
case CAMERA_EPOWERDOWN:
return QLatin1String("Camera in power down state");
case CAMERA_3ALOCKED:
return QLatin1String("3A have been locked");
case CAMERA_EVIEWFINDERFROZEN:
return QLatin1String("Freeze flag set");
#endif
default:
return QLatin1String("Unknown error");
}
@@ -658,6 +660,9 @@ void BbCameraSession::applyVideoSettings()
return;
}
const QSize resolution = m_videoEncoderSettings.resolution();
#ifndef Q_OS_BLACKBERRY_TABLET
QString videoCodec = m_videoEncoderSettings.codec();
if (videoCodec.isEmpty())
videoCodec = QLatin1String("h264");
@@ -670,8 +675,6 @@ void BbCameraSession::applyVideoSettings()
else if (videoCodec == QLatin1String("h264"))
cameraVideoCodec = CAMERA_VIDEOCODEC_H264;
const QSize resolution = m_videoEncoderSettings.resolution();
qreal frameRate = m_videoEncoderSettings.frameRate();
if (frameRate == 0) {
const QList<qreal> frameRates = supportedFrameRates(QVideoEncoderSettings(), 0);
@@ -690,12 +693,16 @@ 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_VIDEOCODEC, cameraVideoCodec,
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) {
qWarning() << "Unable to apply video settings:" << result;
@@ -979,10 +986,14 @@ static void viewFinderStatusCallback(camera_handle_t handle, camera_devstatus_t
if (status == CAMERA_STATUS_FOCUS_CHANGE) {
BbCameraSession *session = static_cast<BbCameraSession*>(context);
QMetaObject::invokeMethod(session, "handleFocusStatusChanged", Qt::QueuedConnection, Q_ARG(int, value));
} else if (status == CAMERA_STATUS_POWERUP) {
return;
}
#ifndef Q_OS_BLACKBERRY_TABLET
else if (status == CAMERA_STATUS_POWERUP) {
BbCameraSession *session = static_cast<BbCameraSession*>(context);
QMetaObject::invokeMethod(session, "handleCameraPowerUp", Qt::QueuedConnection);
}
#endif
}
bool BbCameraSession::startViewFinder()
@@ -1159,6 +1170,7 @@ static void videoRecordingStatusCallback(camera_handle_t handle, camera_devstatu
Q_UNUSED(handle)
Q_UNUSED(value)
#ifndef Q_OS_BLACKBERRY_TABLET
if (status == CAMERA_STATUS_VIDEO_PAUSE) {
BbCameraSession *session = static_cast<BbCameraSession*>(context);
QMetaObject::invokeMethod(session, "handleVideoRecordingPaused", Qt::QueuedConnection);
@@ -1166,6 +1178,7 @@ static void videoRecordingStatusCallback(camera_handle_t handle, camera_devstatu
BbCameraSession *session = static_cast<BbCameraSession*>(context);
QMetaObject::invokeMethod(session, "handleVideoRecordingResumed", Qt::QueuedConnection);
}
#endif
}
bool BbCameraSession::startVideoRecording()