问题
I made some changes in the platform specific existing HAL, and I want this changes to be get selected when I start my audio stream.
For this I need to differentiate it from other streams, so I added a variable in HAL and I wanted it to be exposed to my shared library that I will be pushing to system/lib/hw directory, so that when I start my stream I set this variable in my .so
So that in HAL I can differentiate it from other streams.
Any ideas to expose the variable in HAL to shared library in system/lib/hw ?
Suggestions/help will be really appreciated.
回答1:
I would suggest that you add a new stream type (AUDIO_STREAM_
), and possibly a new routing strategy (STRATEGY_
). Then modify getStrategy
in the AudioPolicyManager
to return your new strategy when your new stream type is used, and modify getDeviceForStrategy
to select the appropriate DEVICE_OUT_
value for your new routing strategy.
来源:https://stackoverflow.com/questions/31705819/how-to-expose-variable-from-hal-to-shared-libraries-present-in-system-lib-hw-an