Bug 810440 - Add missing rotation parameter to SetupRecording function call, drop default parameter values. r=daleharvey

This commit is contained in:
Mike Habicher 2012-11-09 20:32:10 -05:00
parent 8e0cd86d07
commit 266e0bab6c
2 changed files with 6 additions and 2 deletions

View File

@ -851,7 +851,7 @@ nsGonkCameraControl::StartRecordingImpl(StartRecordingTask* aStartRecording)
return NS_ERROR_FAILURE;
}
nsresult rv = SetupRecording(fd, aStartRecording->mOptions.maxFileSizeBytes, aStartRecording->mOptions.maxVideoLengthMs);
nsresult rv = SetupRecording(fd, aStartRecording->mOptions.rotation, aStartRecording->mOptions.maxFileSizeBytes, aStartRecording->mOptions.maxVideoLengthMs);
NS_ENSURE_SUCCESS(rv, rv);
if (mRecorder->start() != OK) {
@ -1206,6 +1206,10 @@ nsGonkCameraControl::SetupRecording(int aFd, int aRotation, int64_t aMaxFileSize
r += 45;
r /= 90;
r *= 90;
if (r < 0) {
// the video recorder only supports positive rotations
r += 360;
}
DOM_CAMERA_LOGI("setting video rotation to %d degrees (mapped from %d)\n", r, aRotation);
snprintf(buffer, SIZE, "video-param-rotation-angle-degrees=%d", r);
CHECK_SETARG(mRecorder->setParameters(String8(buffer)));

View File

@ -56,7 +56,7 @@ public:
nsresult GetVideoSizes(nsTArray<CameraSize>& aVideoSizes);
nsresult PushParameters();
nsresult SetupRecording(int aFd, int aRotation = 0, int64_t aMaxFileSizeBytes = -1, int64_t aMaxVideoLengthMs = -1);
nsresult SetupRecording(int aFd, int aRotation, int64_t aMaxFileSizeBytes, int64_t aMaxVideoLengthMs);
nsresult SetupVideoMode(const nsAString& aProfile);
void AutoFocusComplete(bool aSuccess);