AudioFlinger: Add more Thread interfaces
Add interfaces
IAfDirectOutputThread
IAfDuplicatingThread
IAfRecordThread
Test: atest audiorecord_tests audiotrack_tests audiorouting_tests trackplayerbase_tests audiosystem_tests
Test: atest AudioTrackTest AudioRecordTest
Test: YouTube Camera
Bug: 288339104
Bug: 289233517
Merged-In: Ibd46b7de4c4264294b645d0df2a69825513a1426
Change-Id: Ibd46b7de4c4264294b645d0df2a69825513a1426
diff --git a/services/audioflinger/TrackBase.h b/services/audioflinger/TrackBase.h
index 8f31468..bd569e6 100644
--- a/services/audioflinger/TrackBase.h
+++ b/services/audioflinger/TrackBase.h
@@ -22,7 +22,7 @@
// base for record and playback
class TrackBase : public ExtendedAudioBufferProvider, public virtual IAfTrackBase {
public:
- TrackBase(AudioFlinger::ThreadBase* thread,
+ TrackBase(IAfThreadBase* thread,
const sp<Client>& client,
const audio_attributes_t& mAttr,
uint32_t sampleRate,
@@ -69,8 +69,7 @@
bool isSpatialized() const override { return false; }
bool isBitPerfect() const override { return false; }
- // TODO(b/288339104) type
- wp<Thread> thread() const final { return mThread; }
+ wp<IAfThreadBase> thread() const final { return mThread; }
const sp<ServerProxy>& serverProxy() const final { return mServerProxy; }
@@ -322,7 +321,7 @@
// true for Track, false for RecordTrack,
// this could be a track type if needed later
- const wp<AudioFlinger::ThreadBase> mThread;
+ const wp<IAfThreadBase> mThread;
const alloc_type mAllocType;
/*const*/ sp<Client> mClient; // see explanation at ~TrackBase() why not const
sp<IMemory> mCblkMemory;
@@ -392,7 +391,7 @@
{
public:
PatchTrackBase(const sp<ClientProxy>& proxy,
- const AudioFlinger::ThreadBase& thread,
+ const IAfThreadBase& thread,
const Timeout& timeout);
void setPeerTimeout(std::chrono::nanoseconds timeout) final;
void setPeerProxy(const sp<IAfPatchTrackBase>& proxy, bool holdReference) final {