Loading include/media/Interpolator.h +14 −5 Original line number Diff line number Diff line Loading @@ -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(); } Loading @@ -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 Loading include/media/VolumeShaper.h +354 −192 File changed.Preview size limit exceeded, changes collapsed. Show changes media/libaudioclient/AudioTrack.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -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); }); Loading media/libaudioclient/include/media/AudioTrack.h +4 −0 Original line number Diff line number Diff line Loading @@ -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); Loading media/libmediaplayerservice/MediaPlayerService.cpp +4 −3 Original line number Diff line number Diff line Loading @@ -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); }); Loading Loading @@ -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); } Loading Loading
include/media/Interpolator.h +14 −5 Original line number Diff line number Diff line Loading @@ -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(); } Loading @@ -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 Loading
include/media/VolumeShaper.h +354 −192 File changed.Preview size limit exceeded, changes collapsed. Show changes
media/libaudioclient/AudioTrack.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -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); }); Loading
media/libaudioclient/include/media/AudioTrack.h +4 −0 Original line number Diff line number Diff line Loading @@ -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); Loading
media/libmediaplayerservice/MediaPlayerService.cpp +4 −3 Original line number Diff line number Diff line Loading @@ -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); }); Loading Loading @@ -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); } Loading