@@ -156,9 +156,6 @@ static int out_set_parameters(struct audio_stream *stream, const char *kvpairs)
156
156
parms = str_parms_create_str (kvpairs );
157
157
pthread_mutex_lock (& adev -> lock );
158
158
159
- adev -> card = -1 ;
160
- adev -> device = -1 ;
161
-
162
159
ret = str_parms_get_str (parms , "card" , value , sizeof (value ));
163
160
if (ret >= 0 )
164
161
adev -> card = atoi (value );
@@ -247,8 +244,10 @@ static int out_get_next_write_timestamp(const struct audio_stream_out *stream,
247
244
}
248
245
249
246
static int adev_open_output_stream (struct audio_hw_device * dev ,
250
- uint32_t devices , audio_format_t * format ,
251
- uint32_t * channels , uint32_t * sample_rate ,
247
+ audio_io_handle_t handle ,
248
+ audio_devices_t devices ,
249
+ audio_output_flags_t flags ,
250
+ struct audio_config * config ,
252
251
struct audio_stream_out * * stream_out )
253
252
{
254
253
struct audio_device * adev = (struct audio_device * )dev ;
@@ -279,12 +278,15 @@ static int adev_open_output_stream(struct audio_hw_device *dev,
279
278
280
279
out -> dev = adev ;
281
280
282
- * format = out_get_format (& out -> stream .common );
283
- * channels = out_get_channels (& out -> stream .common );
284
- * sample_rate = out_get_sample_rate (& out -> stream .common );
281
+ config -> format = out_get_format (& out -> stream .common );
282
+ config -> channel_mask = out_get_channels (& out -> stream .common );
283
+ config -> sample_rate = out_get_sample_rate (& out -> stream .common );
285
284
286
285
out -> standby = true;
287
286
287
+ adev -> card = -1 ;
288
+ adev -> device = -1 ;
289
+
288
290
* stream_out = & out -> stream ;
289
291
return 0 ;
290
292
@@ -345,16 +347,15 @@ static int adev_get_mic_mute(const struct audio_hw_device *dev, bool *state)
345
347
}
346
348
347
349
static size_t adev_get_input_buffer_size (const struct audio_hw_device * dev ,
348
- uint32_t sample_rate , audio_format_t format ,
349
- int channel_count )
350
+ const struct audio_config * config )
350
351
{
351
352
return 0 ;
352
353
}
353
354
354
- static int adev_open_input_stream (struct audio_hw_device * dev , uint32_t devices ,
355
- audio_format_t * format , uint32_t * channel_mask ,
356
- uint32_t * sample_rate ,
357
- audio_in_acoustics_t acoustics ,
355
+ static int adev_open_input_stream (struct audio_hw_device * dev ,
356
+ audio_io_handle_t handle ,
357
+ audio_devices_t devices ,
358
+ struct audio_config * config ,
358
359
struct audio_stream_in * * stream_in )
359
360
{
360
361
return - ENOSYS ;
@@ -397,7 +398,7 @@ static int adev_open(const hw_module_t* module, const char* name,
397
398
return - ENOMEM ;
398
399
399
400
adev -> hw_device .common .tag = HARDWARE_DEVICE_TAG ;
400
- adev -> hw_device .common .version = 0 ;
401
+ adev -> hw_device .common .version = AUDIO_DEVICE_API_VERSION_1_0 ;
401
402
adev -> hw_device .common .module = (struct hw_module_t * ) module ;
402
403
adev -> hw_device .common .close = adev_close ;
403
404
@@ -429,8 +430,8 @@ static struct hw_module_methods_t hal_module_methods = {
429
430
struct audio_module HAL_MODULE_INFO_SYM = {
430
431
.common = {
431
432
.tag = HARDWARE_MODULE_TAG ,
432
- .version_major = 1 ,
433
- .version_minor = 0 ,
433
+ .module_api_version = AUDIO_MODULE_API_VERSION_0_1 ,
434
+ .hal_api_version = HARDWARE_HAL_API_VERSION ,
434
435
.id = AUDIO_HARDWARE_MODULE_ID ,
435
436
.name = "USB audio HW HAL" ,
436
437
.author = "The Android Open Source Project" ,
0 commit comments