CSD: Add Mel processing for FastMixer

Moved the MelProcessor into the AudioStreamOutSink. This should be ok
now to use in the FastMixer since the new MelProcessor logic is not
blocking and the callbacks are executed asynchronously in the MelWorker.

Test: OboeTester + dumpsys and logs
Bug: 264255998
Change-Id: Idce0a2653b4f8fa42ea12893c6e77e765806f3b1
diff --git a/services/audioflinger/Threads.cpp b/services/audioflinger/Threads.cpp
index c617ef7..0f65aec 100644
--- a/services/audioflinger/Threads.cpp
+++ b/services/audioflinger/Threads.cpp
@@ -3428,12 +3428,6 @@
         if (framesWritten > 0) {
             bytesWritten = framesWritten * mFrameSize;
 
-            // Send to MelProcessor for sound dose measurement.
-            auto processor = mMelProcessor.load();
-            if (processor) {
-                processor->process((char *)mSinkBuffer + offset, bytesWritten);
-            }
-
 #ifdef TEE_SINK
             mTee.write((char *)mSinkBuffer + offset, framesWritten);
 #endif
@@ -3479,15 +3473,14 @@
 void AudioFlinger::PlaybackThread::startMelComputation(
         const sp<audio_utils::MelProcessor>& processor)
 {
-    ALOGV("%s: starting mel processor for thread %d", __func__, id());
-    mMelProcessor = processor;
+    auto outputSink = static_cast<AudioStreamOutSink*>(mOutputSink.get());
+    outputSink->startMelComputation(processor);
 }
 
-void AudioFlinger::PlaybackThread::stopMelComputation() {
-    if (mMelProcessor.load() != nullptr) {
-        ALOGV("%s: stopping mel processor for thread %d", __func__, id());
-        mMelProcessor = nullptr;
-    }
+void AudioFlinger::PlaybackThread::stopMelComputation()
+{
+    auto outputSink = static_cast<AudioStreamOutSink*>(mOutputSink.get());
+    outputSink->stopMelComputation();
 }
 
 void AudioFlinger::PlaybackThread::threadLoop_drain()