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

Commit 2f35206b authored by Andy Hung's avatar Andy Hung Committed by android-build-merger
Browse files

Merge "VolumeShaper: Fixes for updated Cts test" into oc-dev am: 2d12b8e3

am: d906ad02

Change-Id: I27856718a4914e396a7c387da7b4f4e4b7c245e6
parents dc427236 d906ad02
Loading
Loading
Loading
Loading
+14 −5
Original line number Diff line number Diff line
@@ -294,12 +294,21 @@ public:

    std::string toString() const {
        std::stringstream ss;
        ss << "mInterpolatorType: " << static_cast<int32_t>(mInterpolatorType) << std::endl;
        ss << "mFirstSlope: " << mFirstSlope << std::endl;
        ss << "mLastSlope: " << mLastSlope << std::endl;
        ss << "Interpolator{mInterpolatorType=" << static_cast<int32_t>(mInterpolatorType);
        ss << ", mFirstSlope=" << mFirstSlope;
        ss << ", mLastSlope=" << mLastSlope;
        ss << ", {";
        bool first = true;
        for (const auto &pt : *this) {
            ss << pt.first << " " << pt.second << std::endl;
            if (first) {
                first = false;
                ss << "{";
            } else {
                ss << ", {";
            }
            ss << pt.first << ", " << pt.second << "}";
        }
        ss << "}}";
        return ss.str();
    }

@@ -324,7 +333,7 @@ private:

    // spline cubic polynomial coefficient cache
    std::unordered_map<S, std::tuple<S /* c1 */, S /* c2 */, S /* c3 */>> mMemo;
};
}; // Interpolator

} // namespace android

+354 −192

File changed.

Preview size limit exceeded, changes collapsed.

+1 −1
Original line number Diff line number Diff line
@@ -2268,7 +2268,7 @@ status_t AudioTrack::restoreTrack_l(const char *from)
            // For now, we simply advance to the end of the VolumeShaper effect
            // if it has been started.
            if (shaper.isStarted()) {
                operationToEnd->setXOffset(1.f);
                operationToEnd->setNormalizedTime(1.f);
            }
            return mAudioTrack->applyVolumeShaper(shaper.mConfiguration, operationToEnd);
        });
+4 −0
Original line number Diff line number Diff line
@@ -874,6 +874,10 @@ public:
     */
            bool hasStarted(); // not const

            bool isPlaying() {
                AutoMutex lock(mLock);
                return mState == STATE_ACTIVE || mState == STATE_STOPPING;
            }
protected:
    /* copying audio tracks is not allowed */
                        AudioTrack(const AudioTrack& other);
+4 −3
Original line number Diff line number Diff line
@@ -2042,7 +2042,7 @@ status_t MediaPlayerService::AudioOutput::open(
        // For now, we simply advance to the end of the VolumeShaper effect
        // if it has been started.
        if (shaper.isStarted()) {
            operationToEnd->setXOffset(1.f);
            operationToEnd->setNormalizedTime(1.f);
        }
        return t->applyVolumeShaper(shaper.mConfiguration, operationToEnd);
    });
@@ -2301,9 +2301,10 @@ VolumeShaper::Status MediaPlayerService::AudioOutput::applyVolumeShaper(
        status = mTrack->applyVolumeShaper(configuration, operation);
        if (status >= 0) {
            (void)mVolumeHandler->applyVolumeShaper(configuration, operation);
            // TODO: start on exact AudioTrack state (STATE_ACTIVE || STATE_STOPPING)
            if (mTrack->isPlaying()) { // match local AudioTrack to properly restore.
                mVolumeHandler->setStarted();
            }
        }
    } else {
        status = mVolumeHandler->applyVolumeShaper(configuration, operation);
    }