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

Commit f2264e64 authored by Shigeki Kaneko's avatar Shigeki Kaneko Committed by Richard Tullberg
Browse files

Add getTracks_l to a Thread

Add a function to return all tracks from a Thread.

Test: manual
Bug: 398865958
Change-Id: Ia2309f0e751695171d3e3ac53ee1e999191e3115
parent d03ff96e
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -537,6 +537,8 @@ public:

    virtual IAfTrack* getTrackById_l(audio_port_handle_t trackId) REQUIRES(mutex()) = 0;

    virtual std::vector<sp<IAfTrack>> getTracks_l() REQUIRES(mutex()) = 0;

    virtual bool hasMixer() const = 0;

    virtual status_t setRequestedLatencyMode(audio_latency_mode_t mode) = 0;
+5 −0
Original line number Diff line number Diff line
@@ -3778,6 +3778,11 @@ IAfTrack* PlaybackThread::getTrackById_l(
    return nullptr;
}

// getTracks_l must be called with holding thread lock
std::vector<sp<IAfTrack>> PlaybackThread::getTracks_l() {
    return std::vector(mTracks.begin(), mTracks.end());
}

status_t PlaybackThread::addEffectChain_l(const sp<IAfEffectChain>& chain)
{
    audio_session_t session = chain->sessionId();
+2 −0
Original line number Diff line number Diff line
@@ -1177,6 +1177,8 @@ public:

    IAfTrack* getTrackById_l(audio_port_handle_t trackId) final REQUIRES(mutex());

    std::vector<sp<IAfTrack>> getTracks_l() final REQUIRES(mutex());

    bool hasMixer() const final {
                    return mType == MIXER || mType == DUPLICATING || mType == SPATIALIZER;
                }