diff options
author | Eric Laurent <elaurent@google.com> | 2015-03-12 09:12:01 -0700 |
---|---|---|
committer | Eric Laurent <elaurent@google.com> | 2015-03-19 10:53:21 -0700 |
commit | 53810823a6613f54fc0b3c3bc0de267dc1f4e1e5 (patch) | |
tree | e65a116aa468a5dd5f1e60fc5ca4a84f949b3714 /services/radio/RadioService.h | |
parent | b89b86d48cd5a6258e24fefd0eab888062cbdfb0 (diff) | |
download | frameworks_av-53810823a6613f54fc0b3c3bc0de267dc1f4e1e5.zip frameworks_av-53810823a6613f54fc0b3c3bc0de267dc1f4e1e5.tar.gz frameworks_av-53810823a6613f54fc0b3c3bc0de267dc1f4e1e5.tar.bz2 |
audio routing management for radio
Added radio tuner device connection/disconnection
indication to audio policy manager.
Added documentation and removed unused Module
class member.
Change-Id: I92438c1ff212c4d76f008149554fa89e367fee42
Diffstat (limited to 'services/radio/RadioService.h')
-rw-r--r-- | services/radio/RadioService.h | 48 |
1 files changed, 25 insertions, 23 deletions
diff --git a/services/radio/RadioService.h b/services/radio/RadioService.h index 9ede020..49feda6 100644 --- a/services/radio/RadioService.h +++ b/services/radio/RadioService.h @@ -66,8 +66,7 @@ public: class Module : public virtual RefBase { public: - Module(const sp<RadioService>& service, - radio_hw_device* hwDevice, + Module(radio_hw_device* hwDevice, struct radio_properties properties); virtual ~Module(); @@ -88,16 +87,17 @@ public: const struct radio_properties properties() const { return mProperties; } const struct radio_band_config *getDefaultConfig() const ; - wp<RadioService> service() const { return mService; } - private: - Mutex mLock; - wp<RadioService> mService; - const struct radio_hw_device *mHwDevice; - const struct radio_properties mProperties; - Vector< sp<ModuleClient> > mModuleClients; - bool mMute; + void notifyDeviceConnection(bool connected, const char *address); + + Mutex mLock; // protects mModuleClients + const struct radio_hw_device *mHwDevice; // HAL hardware device + const struct radio_properties mProperties; // cached hardware module properties + Vector< sp<ModuleClient> > mModuleClients; // list of attached clients + bool mMute; // radio audio source state + // when unmuted, audio is routed to the + // output device selected for media use case. }; // class Module class CallbackThread : public Thread { @@ -120,11 +120,11 @@ public: sp<IMemory> prepareEvent(radio_hal_event_t *halEvent); private: - wp<ModuleClient> mModuleClient; - Condition mCallbackCond; - Mutex mCallbackLock; - Vector< sp<IMemory> > mEventQueue; - sp<MemoryDealer> mMemoryDealer; + wp<ModuleClient> mModuleClient; // client module the thread belongs to + Condition mCallbackCond; // condition signaled when a new event is posted + Mutex mCallbackLock; // protects mEventQueue + Vector< sp<IMemory> > mEventQueue; // pending callback events + sp<MemoryDealer> mMemoryDealer; // shared memory for callback event }; // class CallbackThread class ModuleClient : public BnRadio, @@ -181,13 +181,15 @@ public: private: - mutable Mutex mLock; - wp<Module> mModule; - sp<IRadioClient> mClient; - radio_band_config_t mConfig; - sp<CallbackThread> mCallbackThread; + mutable Mutex mLock; // protects mClient, mConfig and mTuner + wp<Module> mModule; // The module this client is attached to + sp<IRadioClient> mClient; // event callback binder interface + radio_band_config_t mConfig; // current band configuration + sp<CallbackThread> mCallbackThread; // event callback thread const bool mAudio; - const struct radio_tuner *mTuner; + const struct radio_tuner *mTuner; // HAL tuner interface. NULL indicates that + // this client does not have control on any + // tuner }; // class ModuleClient @@ -199,8 +201,8 @@ private: static void convertProperties(radio_properties_t *properties, const radio_hal_properties_t *halProperties); - Mutex mServiceLock; - volatile int32_t mNextUniqueId; + Mutex mServiceLock; // protects mModules + volatile int32_t mNextUniqueId; // for module ID allocation DefaultKeyedVector< radio_handle_t, sp<Module> > mModules; }; |