AudioFlinger: Extract inner Track classes
Finish removing inner Track classes from AudioFlinger.
Test: atest audiorecord_tests audiotrack_tests audiorouting_tests trackplayerbase_tests audiosystem_tests
Test: atest AudioTrackTest AudioRecordTest
Test: YouTube and Camera
Bug: 288339104
Bug: 288468076
Change-Id: Ib44c7eb854f9d447aa11223d76373b00c413a778
diff --git a/services/audioflinger/AudioFlinger.h b/services/audioflinger/AudioFlinger.h
index 840d678..0e7bd1b 100644
--- a/services/audioflinger/AudioFlinger.h
+++ b/services/audioflinger/AudioFlinger.h
@@ -119,6 +119,7 @@
#include "android/media/BnEffect.h"
#include "Client.h"
+#include "ResamplerBufferProvider.h"
// include AudioFlinger component interfaces
#include "IAfEffect.h"
@@ -136,7 +137,6 @@
class FastMixer;
class IAudioManager;
class PassthruBufferProvider;
-class RecordBufferConverter;
class ServerProxy;
// ----------------------------------------------------------------------------
@@ -571,8 +571,6 @@
class AsyncCallbackThread;
class BitPerfectThread;
private:
- class Track;
- class RecordTrack;
class DeviceEffectManager;
// TODO(b/288339104) these should be separate files
public:
@@ -581,8 +579,9 @@
private:
struct AudioStreamIn;
struct TeePatch;
+public:
using TeePatches = std::vector<TeePatch>;
-
+private:
struct stream_type_t {
stream_type_t()
@@ -708,9 +707,12 @@
RecordThread *srcThread,
RecordThread *dstThread);
+public:
+ // TODO(b/288339104) cluster together
status_t moveAuxEffectToIo(int EffectId,
const sp<PlaybackThread>& dstThread,
sp<PlaybackThread> *srcThread);
+private:
// return thread associated with primary hardware device, or NULL
PlaybackThread *primaryPlaybackThread_l() const;
@@ -731,7 +733,10 @@
void removeClient_l(pid_t pid);
void removeNotificationClient(pid_t pid);
+public:
+ // TODO(b/288339104) cluster together
bool isNonOffloadableGlobalEffectEnabled_l();
+private:
void onNonOffloadableGlobalEffectEnable();
bool isSessionAcquired_l(audio_session_t audioSession);
@@ -789,8 +794,8 @@
};
struct TeePatch {
- sp<RecordThread::PatchRecord> patchRecord;
- sp<PlaybackThread::PatchTrack> patchTrack;
+ sp<IAfPatchRecord> patchRecord;
+ sp<IAfPatchTrack> patchTrack;
};
// for mAudioSessionRefs only
@@ -803,11 +808,13 @@
int mCnt;
};
+public:
+ // TODO(b/288339104) access by getter,
mutable Mutex mLock;
// protects mClients and mNotificationClients.
// must be locked after mLock and ThreadBase::mLock if both must be locked
// avoids acquiring AudioFlinger::mLock from inside thread loop.
-public:
+
// TODO(b/288339104) access by getter,
mutable Mutex mClientLock;
private:
@@ -916,9 +923,9 @@
size_t rejectedKVPSize, const String8& rejectedKVPs,
uid_t callingUid);
+public:
sp<IAudioManager> getOrCreateAudioManager();
-public:
// These methods read variables atomically without mLock,
// though the variables are updated with mLock.
bool isLowRamDevice() const { return mIsLowRamDevice; }