aaudio: teardown stream based on a port handle
Needed for silencing specific input streams.
Pass AAudioService reference into AAudioServiceEndpointMMAP.
Use it to find a specific stream by PortHandle then
stop it and disconnect it.
Bug: 72134552
Test: b/72134552#comment10
Change-Id: Ibdf242f834c83b47c967c3cc634ed1083b019d4a
diff --git a/services/oboeservice/AAudioServiceStreamBase.h b/services/oboeservice/AAudioServiceStreamBase.h
index 3720596..d8102be 100644
--- a/services/oboeservice/AAudioServiceStreamBase.h
+++ b/services/oboeservice/AAudioServiceStreamBase.h
@@ -180,6 +180,10 @@
mHandle = handle;
}
+ audio_port_handle_t getPortHandle() const {
+ return mClientHandle;
+ }
+
aaudio_stream_state_t getState() const {
return mState;
}
@@ -269,6 +273,7 @@
int32_t mFramesPerBurst = 0;
android::AudioClient mMmapClient; // set in open, used in MMAP start()
+ // TODO rename mClientHandle to mPortHandle to be more consistent with AudioFlinger.
audio_port_handle_t mClientHandle = AUDIO_PORT_HANDLE_NONE;
SimpleDoubleBuffer<Timestamp> mAtomicTimestamp;