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

Commit e93b34f1 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Set the piid for legacy aaudio streams."

parents e49f7f7a 1b29d704
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -410,7 +410,7 @@ public:
     * This should only be called for client streams and not for streams
     * that run in the service.
     */
    void registerPlayerBase() {
    virtual void registerPlayerBase() {
        if (getDirection() == AAUDIO_DIRECTION_OUTPUT) {
            mPlayerBase->registerWithAudioManager(this);
        }
@@ -664,6 +664,8 @@ protected:

    std::mutex                 mStreamLock;

    const android::sp<MyPlayerBase>   mPlayerBase;

private:

    aaudio_result_t safeStop_l() REQUIRES(mStreamLock);
@@ -679,8 +681,6 @@ private:
        close_l();
    }

    const android::sp<MyPlayerBase>   mPlayerBase;

    std::atomic<aaudio_stream_state_t>          mState{AAUDIO_STREAM_STATE_UNINITIALIZED};

    // These do not change after open().
+10 −0
Original line number Diff line number Diff line
@@ -552,6 +552,16 @@ status_t AudioStreamTrack::doSetVolume() {
    return status;
}

void AudioStreamTrack::registerPlayerBase() {
    AudioStream::registerPlayerBase();

    if (mAudioTrack == nullptr) {
        ALOGW("%s: cannot set piid, AudioTrack is null", __func__);
        return;
    }
    mAudioTrack->setPlayerIId(mPlayerBase->getPlayerIId());
}

#if AAUDIO_USE_VOLUME_SHAPER

using namespace android::media::VolumeShaper;
+2 −0
Original line number Diff line number Diff line
@@ -87,6 +87,8 @@ public:

    android::status_t doSetVolume() override;

    void registerPlayerBase() override;

#if AAUDIO_USE_VOLUME_SHAPER
    virtual android::binder::Status applyVolumeShaper(
            const android::media::VolumeShaper::Configuration& configuration,