audioflinger: changes for new audio devices enums
The ThreadBase class now has a separate member for input
and output devices (mInDevice, mOutDevice).
Only query get_supported_devices() from audio HAL if the function
is exposed and if the audio policy manager did not specify the
audio module to open.
Also fixed bug in AEC preprocessing that would reset
to default output device when an input device was given.
Change-Id: I19d4d06aeb920b068e3ef31e6e6be6345ce5d67a
diff --git a/services/audioflinger/AudioFlinger.h b/services/audioflinger/AudioFlinger.h
index 0fad7c7..5ffa5a6 100644
--- a/services/audioflinger/AudioFlinger.h
+++ b/services/audioflinger/AudioFlinger.h
@@ -353,7 +353,8 @@
RECORD // Thread class is RecordThread
};
- ThreadBase (const sp<AudioFlinger>& audioFlinger, audio_io_handle_t id, audio_devices_t device, type_t type);
+ ThreadBase (const sp<AudioFlinger>& audioFlinger, audio_io_handle_t id,
+ audio_devices_t outDevice, audio_devices_t inDevice, type_t type);
virtual ~ThreadBase();
void dumpBase(int fd, const Vector<String16>& args);
@@ -519,9 +520,10 @@
void sendConfigEvent_l(int event, int param = 0);
void processConfigEvents();
- // see note at declaration of mStandby and mDevice
+ // see note at declaration of mStandby, mOutDevice and mInDevice
bool standby() const { return mStandby; }
- audio_devices_t device() const { return mDevice; }
+ audio_devices_t outDevice() const { return mOutDevice; }
+ audio_devices_t inDevice() const { return mInDevice; }
virtual audio_stream_t* stream() const = 0;
@@ -667,13 +669,14 @@
Vector<ConfigEvent> mConfigEvents;
// These fields are written and read by thread itself without lock or barrier,
- // and read by other threads without lock or barrier via standby() and device().
+ // and read by other threads without lock or barrier via standby() , outDevice()
+ // and inDevice().
// Because of the absence of a lock or barrier, any other thread that reads
// these fields must use the information in isolation, or be prepared to deal
// with possibility that it might be inconsistent with other information.
bool mStandby; // Whether thread is currently in standby.
- audio_devices_t mDevice; // output device for PlaybackThread
- // input + output devices for RecordThread
+ audio_devices_t mOutDevice; // output device
+ audio_devices_t mInDevice; // input device
audio_source_t mAudioSource; // (see audio.h, audio_source_t)
const audio_io_handle_t mId;