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

Commit d023a770 authored by Hangyu Kuang's avatar Hangyu Kuang Committed by Android (Google) Code Review
Browse files

Merge "media: set correct mode if both capture and playback rate are set." into nyc-mr1-dev

parents 7b171a9e 5a4a0a1e
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -820,6 +820,9 @@ status_t StagefrightRecorder::prepareInternal() {
            break;
    }

    ALOGV("Recording frameRate: %d captureFps: %f",
            mFrameRate, mCaptureFps);

    return status;
}

+5 −1
Original line number Diff line number Diff line
@@ -775,7 +775,9 @@ status_t GraphicBufferSource::signalEndOfInputStream() {
int64_t GraphicBufferSource::getTimestamp(const BufferItem &item) {
    int64_t timeUs = item.mTimestamp / 1000;

    if (mTimePerCaptureUs > 0ll) {
    if (mTimePerCaptureUs > 0ll
            && (mTimePerCaptureUs > 2 * mTimePerFrameUs
            || mTimePerFrameUs > 2 * mTimePerCaptureUs)) {
        // Time lapse or slow motion mode
        if (mPrevCaptureUs < 0ll) {
            // first capture
@@ -801,6 +803,8 @@ int64_t GraphicBufferSource::getTimestamp(const BufferItem &item) {

        return mPrevFrameUs;
    } else if (mMaxTimestampGapUs > 0ll) {
        //TODO: Fix the case when mMaxTimestampGapUs and mTimePerCaptureUs are both set.

        /* Cap timestamp gap between adjacent frames to specified max
         *
         * In the scenario of cast mirroring, encoding could be suspended for