diff options
author | Eric Laurent <elaurent@google.com> | 2012-04-10 16:56:32 -0700 |
---|---|---|
committer | Eric Laurent <elaurent@google.com> | 2012-04-17 16:02:48 -0700 |
commit | 55786bcf3ced97dea8fa7ce79df2889d4d06e8a7 (patch) | |
tree | ea7089f133e92da7112cfcb15bbc1bc7a9041ef0 /modules/audio | |
parent | 0c8e630ad66b30058009b9afa682b28b7f55b33a (diff) | |
download | hardware_libhardware-55786bcf3ced97dea8fa7ce79df2889d4d06e8a7.zip hardware_libhardware-55786bcf3ced97dea8fa7ce79df2889d4d06e8a7.tar.gz hardware_libhardware-55786bcf3ced97dea8fa7ce79df2889d4d06e8a7.tar.bz2 |
audio: updated audio HAL device API
Modified open output and input stream functions to add new
parameters needed by audio HAL. Also grouped parameters
in a config structure for clarity.
Change-Id: I60832d8e5b5e4a48f209a6d83f5ca9c044be61f1
Diffstat (limited to 'modules/audio')
-rw-r--r-- | modules/audio/audio_hw.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/modules/audio/audio_hw.c b/modules/audio/audio_hw.c index 4069ace..d860437 100644 --- a/modules/audio/audio_hw.c +++ b/modules/audio/audio_hw.c @@ -214,8 +214,10 @@ static int in_remove_audio_effect(const struct audio_stream *stream, effect_hand } static int adev_open_output_stream(struct audio_hw_device *dev, - uint32_t devices, audio_format_t *format, - uint32_t *channels, uint32_t *sample_rate, + audio_io_handle_t handle, + audio_devices_t devices, + audio_output_flags_t flags, + struct audio_config *config, struct audio_stream_out **stream_out) { struct stub_audio_device *ladev = (struct stub_audio_device *)dev; @@ -307,16 +309,15 @@ static int adev_get_mic_mute(const struct audio_hw_device *dev, bool *state) } static size_t adev_get_input_buffer_size(const struct audio_hw_device *dev, - uint32_t sample_rate, audio_format_t format, - int channel_count) + const struct audio_config *config) { return 320; } -static int adev_open_input_stream(struct audio_hw_device *dev, uint32_t devices, - audio_format_t *format, uint32_t *channels, - uint32_t *sample_rate, - audio_in_acoustics_t acoustics, +static int adev_open_input_stream(struct audio_hw_device *dev, + audio_io_handle_t handle, + audio_devices_t devices, + struct audio_config *config, struct audio_stream_in **stream_in) { struct stub_audio_device *ladev = (struct stub_audio_device *)dev; @@ -406,7 +407,7 @@ static int adev_open(const hw_module_t* module, const char* name, return -ENOMEM; adev->device.common.tag = HARDWARE_DEVICE_TAG; - adev->device.common.version = 0; + adev->device.common.version = AUDIO_DEVICE_API_VERSION_1_0; adev->device.common.module = (struct hw_module_t *) module; adev->device.common.close = adev_close; @@ -439,8 +440,8 @@ static struct hw_module_methods_t hal_module_methods = { struct audio_module HAL_MODULE_INFO_SYM = { .common = { .tag = HARDWARE_MODULE_TAG, - .version_major = 1, - .version_minor = 0, + .module_api_version = AUDIO_MODULE_API_VERSION_0_1, + .hal_api_version = HARDWARE_HAL_API_VERSION, .id = AUDIO_HARDWARE_MODULE_ID, .name = "Default audio HW HAL", .author = "The Android Open Source Project", |