Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c0fa1d47 authored by James Dong's avatar James Dong Committed by Android (Google) Code Review
Browse files

Merge "Revert "Support rotation in media recorder"" into gingerbread

parents 42361551 c80c2880
Loading
Loading
Loading
Loading
+0 −12
Original line number Diff line number Diff line
@@ -284,18 +284,6 @@ public class MediaRecorder
        setAudioEncoder(profile.audioCodec);
    }

    /**
     * Set the rotation degrees for the video recording. This method should be called
     * before start().
     *
     * @param degrees the angle to be rotated clockwise.
     *
     * {@hide}
     */
    public void setClockwiseRotation(int degrees) {
        setParameter(String.format("video-param-clockwise-rotation-degrees=%d", degrees));
    }

    /**
     * Sets the format of the output file produced during recording. Call this
     * after setAudioSource()/setVideoSource() but before prepare().
+0 −25
Original line number Diff line number Diff line
@@ -462,17 +462,6 @@ status_t StagefrightRecorder::setParamVideoTimeScale(int32_t timeScale) {
    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);

@@ -568,11 +557,6 @@ status_t StagefrightRecorder::setParameter(
        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(), &degrees)) {
            return setParamVideoRotation(degrees);
        }
    } else {
        LOGE("setParameter: failed to find key %s", key.string());
    }
@@ -937,12 +921,6 @@ status_t StagefrightRecorder::setupCameraSource() {
    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."
@@ -1210,7 +1188,6 @@ status_t StagefrightRecorder::reset() {
    mMaxFileSizeBytes = 0;
    mTrackEveryTimeDurationUs = 0;
    mEncoderProfiles = MediaProfiles::getInstance();
    mClockwiseRotationDegrees = 0;

    mOutputFd = -1;
    mFlags = 0;
@@ -1284,8 +1261,6 @@ status_t StagefrightRecorder::dump(
    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);
+0 −2
Original line number Diff line number Diff line
@@ -91,7 +91,6 @@ private:
    int64_t mMaxFileSizeBytes;
    int64_t mMaxFileDurationUs;
    int64_t mTrackEveryTimeDurationUs;
    int32_t mClockwiseRotationDegrees;

    String8 mParams;
    int mOutputFd;
@@ -121,7 +120,6 @@ private:
    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);