return OK;
}
-status_t StagefrightRecorder::setParamVideoRotation(int32_t degreesClockwise) {
- LOGV("setParamVideoRotation: %d", degreesClockwise);
-
- if (degreesClockwise < 0 || degreesClockwise % 90 != 0) {
- LOGE("Unsupported video rotation angle: %d", degreesClockwise);
- return BAD_VALUE;
- }
- mClockwiseRotationDegrees = degreesClockwise;
- return OK;
-}
-
status_t StagefrightRecorder::setParamAudioTimeScale(int32_t timeScale) {
LOGV("setParamAudioTimeScale: %d", timeScale);
if (safe_strtoi32(value.string(), &timeScale)) {
return setParamVideoTimeScale(timeScale);
}
- } else if (key == "video-param-clockwise-rotation-degrees") {
- int32_t degrees;
- if (safe_strtoi32(value.string(), °rees)) {
- return setParamVideoRotation(degrees);
- }
} else {
LOGE("setParameter: failed to find key %s", key.string());
}
CameraParameters params(mCamera->getParameters());
params.setPreviewSize(mVideoWidth, mVideoHeight);
params.setPreviewFrameRate(mFrameRate);
- {
- // Optional feature: setting the rotation degrees.
- char degrees[4];
- snprintf(degrees, 4, "%d", mClockwiseRotationDegrees);
- params.set(CameraParameters::KEY_ROTATION, degrees);
- }
String8 s = params.flatten();
if (OK != mCamera->setParameters(s)) {
LOGE("Could not change settings."
mMaxFileSizeBytes = 0;
mTrackEveryTimeDurationUs = 0;
mEncoderProfiles = MediaProfiles::getInstance();
- mClockwiseRotationDegrees = 0;
mOutputFd = -1;
mFlags = 0;
result.append(buffer);
snprintf(buffer, SIZE, " Camera flags: %d\n", mFlags);
result.append(buffer);
- snprintf(buffer, SIZE, " Rotation (clockwise) degrees: %d\n", mClockwiseRotationDegrees);
- result.append(buffer);
snprintf(buffer, SIZE, " Encoder: %d\n", mVideoEncoder);
result.append(buffer);
snprintf(buffer, SIZE, " Encoder profile: %d\n", mVideoEncoderProfile);
int64_t mMaxFileSizeBytes;
int64_t mMaxFileDurationUs;
int64_t mTrackEveryTimeDurationUs;
- int32_t mClockwiseRotationDegrees;
String8 mParams;
int mOutputFd;
status_t setParamVideoEncoderLevel(int32_t level);
status_t setParamVideoCameraId(int32_t cameraId);
status_t setParamVideoTimeScale(int32_t timeScale);
- status_t setParamVideoRotation(int32_t degreesClockwise);
status_t setParamTrackTimeStatus(int64_t timeDurationUs);
status_t setParamInterleaveDuration(int32_t durationUs);
status_t setParam64BitFileOffset(bool use64BitFileOffset);