parms = str_parms_create_str(kvpairs);
pthread_mutex_lock(&adev->lock);
- adev->card = -1;
- adev->device = -1;
-
ret = str_parms_get_str(parms, "card", value, sizeof(value));
if (ret >= 0)
adev->card = atoi(value);
}
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 audio_device *adev = (struct audio_device *)dev;
out->dev = adev;
- *format = out_get_format(&out->stream.common);
- *channels = out_get_channels(&out->stream.common);
- *sample_rate = out_get_sample_rate(&out->stream.common);
+ config->format = out_get_format(&out->stream.common);
+ config->channel_mask = out_get_channels(&out->stream.common);
+ config->sample_rate = out_get_sample_rate(&out->stream.common);
out->standby = true;
+ adev->card = -1;
+ adev->device = -1;
+
*stream_out = &out->stream;
return 0;
}
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 0;
}
-static int adev_open_input_stream(struct audio_hw_device *dev, uint32_t devices,
- audio_format_t *format, uint32_t *channel_mask,
- 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)
{
return -ENOSYS;
return -ENOMEM;
adev->hw_device.common.tag = HARDWARE_DEVICE_TAG;
- adev->hw_device.common.version = 0;
+ adev->hw_device.common.version = AUDIO_DEVICE_API_VERSION_1_0;
adev->hw_device.common.module = (struct hw_module_t *) module;
adev->hw_device.common.close = adev_close;
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 = "USB audio HW HAL",
.author = "The Android Open Source Project",