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

Commit 3262027c authored by Andy Hung's avatar Andy Hung Committed by Automerger Merge Worker
Browse files

Merge "Spatializer: Move priority configuration to threadLoop" into main am: c7328cc4

parents 02986ccc c7328cc4
Loading
Loading
Loading
Loading
+12 −15
Original line number Diff line number Diff line
@@ -3918,6 +3918,18 @@ NO_THREAD_SAFETY_ANALYSIS // manual locking of AudioFlinger
{
    aflog::setThreadWriter(mNBLogWriter.get());

    if (mType == SPATIALIZER) {
        const pid_t tid = getTid();
        if (tid == -1) {  // odd: we are here, we must be a running thread.
            ALOGW("%s: Cannot update Spatializer mixer thread priority, no tid", __func__);
        } else {
            const int priorityBoost = requestSpatializerPriority(getpid(), tid);
            if (priorityBoost > 0) {
                stream()->setHalThreadPriority(priorityBoost);
            }
        }
    }

    Vector<sp<IAfTrack>> tracksToRemove;

    mStandbyTimeNs = systemTime();
@@ -7778,21 +7790,6 @@ SpatializerThread::SpatializerThread(const sp<IAfThreadCallback>& afThreadCallba
{
}

void SpatializerThread::onFirstRef() {
    MixerThread::onFirstRef();

    const pid_t tid = getTid();
    if (tid == -1) {
        // Unusual: PlaybackThread::onFirstRef() should set the threadLoop running.
        ALOGW("%s: Cannot update Spatializer mixer thread priority, not running", __func__);
    } else {
        const int priorityBoost = requestSpatializerPriority(getpid(), tid);
        if (priorityBoost > 0) {
            stream()->setHalThreadPriority(priorityBoost);
        }
    }
}

void SpatializerThread::setHalLatencyMode_l() {
    // if mSupportedLatencyModes is empty, the HAL stream does not support
    // latency mode control and we can exit.
+0 −3
Original line number Diff line number Diff line
@@ -1806,9 +1806,6 @@ public:

    bool hasFastMixer() const final { return false; }

            // RefBase
    void onFirstRef() final;

    status_t setRequestedLatencyMode(audio_latency_mode_t mode) final;

protected: