Android Hardware Abstraction Layer
Data Fields
audio_hw_device Struct Reference

#include <audio.h>

Data Fields

struct hw_device_t common
 
uint32_t(* get_supported_devices )(const struct audio_hw_device *dev)
 
int(* init_check )(const struct audio_hw_device *dev)
 
int(* set_voice_volume )(struct audio_hw_device *dev, float volume)
 
int(* set_master_volume )(struct audio_hw_device *dev, float volume)
 
int(* get_master_volume )(struct audio_hw_device *dev, float *volume)
 
int(* set_mode )(struct audio_hw_device *dev, audio_mode_t mode)
 
int(* set_mic_mute )(struct audio_hw_device *dev, bool state)
 
int(* get_mic_mute )(const struct audio_hw_device *dev, bool *state)
 
int(* set_parameters )(struct audio_hw_device *dev, const char *kv_pairs)
 
char *(* get_parameters )(const struct audio_hw_device *dev, const char *keys)
 
size_t(* get_input_buffer_size )(const struct audio_hw_device *dev, const struct audio_config *config)
 
int(* open_output_stream )(struct audio_hw_device *dev, audio_io_handle_t handle, audio_devices_t devices, audio_output_flags_t flags, struct audio_config *config, struct audio_stream_out **stream_out)
 
void(* close_output_stream )(struct audio_hw_device *dev, struct audio_stream_out *stream_out)
 
int(* 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)
 
void(* close_input_stream )(struct audio_hw_device *dev, struct audio_stream_in *stream_in)
 
int(* dump )(const struct audio_hw_device *dev, int fd)
 
int(* set_master_mute )(struct audio_hw_device *dev, bool mute)
 
int(* get_master_mute )(struct audio_hw_device *dev, bool *mute)
 

Detailed Description

Definition at line 438 of file audio.h.

Field Documentation

void(* close_input_stream)(struct audio_hw_device *dev, struct audio_stream_in *stream_in)

Definition at line 526 of file audio.h.

void(* close_output_stream)(struct audio_hw_device *dev, struct audio_stream_out *stream_out)

Definition at line 516 of file audio.h.

struct hw_device_t common

Definition at line 439 of file audio.h.

int(* dump)(const struct audio_hw_device *dev, int fd)

This method dumps the state of the audio hardware

Definition at line 530 of file audio.h.

size_t(* get_input_buffer_size)(const struct audio_hw_device *dev, const struct audio_config *config)

Definition at line 505 of file audio.h.

int(* get_master_mute)(struct audio_hw_device *dev, bool *mute)

Get the current master mute status for the HAL, if the HAL supports master mute control. AudioFlinger will query this value from the primary audio HAL when the service starts and use the value for setting the initial master mute across all HALs. HALs which do not support this method may leave it set to NULL.

Definition at line 545 of file audio.h.

int(* get_master_volume)(struct audio_hw_device *dev, float *volume)

Get the current master volume value for the HAL, if the HAL supports master volume control. AudioFlinger will query this value from the primary audio HAL when the service starts and use the value for setting the initial master volume across all HALs. HALs which do not support this method may leave it set to NULL.

Definition at line 478 of file audio.h.

int(* get_mic_mute)(const struct audio_hw_device *dev, bool *state)

Definition at line 489 of file audio.h.

char*(* get_parameters)(const struct audio_hw_device *dev, const char *keys)

Definition at line 498 of file audio.h.

uint32_t(* get_supported_devices)(const struct audio_hw_device *dev)

used by audio flinger to enumerate what devices are supported by each audio_hw_device implementation.

Return value is a bitmask of 1 or more values of audio_devices_t

NOTE: audio HAL implementations starting with AUDIO_DEVICE_API_VERSION_2_0 do not implement this function. All supported devices should be listed in audio_policy.conf file and the audio policy manager must choose the appropriate audio module based on information in this file.

Definition at line 453 of file audio.h.

int(* init_check)(const struct audio_hw_device *dev)

check to see if the audio hardware interface has been initialized. returns 0 on success, -ENODEV on failure.

Definition at line 459 of file audio.h.

int(* 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)

This method creates and opens the audio hardware input stream

Definition at line 520 of file audio.h.

int(* open_output_stream)(struct audio_hw_device *dev, audio_io_handle_t handle, audio_devices_t devices, audio_output_flags_t flags, struct audio_config *config, struct audio_stream_out **stream_out)

This method creates and opens the audio hardware output stream

Definition at line 509 of file audio.h.

int(* set_master_mute)(struct audio_hw_device *dev, bool mute)

set the audio mute status for all audio activities. If any value other than 0 is returned, the software mixer will emulate this capability.

Definition at line 536 of file audio.h.

int(* set_master_volume)(struct audio_hw_device *dev, float volume)

set the audio volume for all audio activities other than voice call. Range between 0.0 and 1.0. If any value other than 0 is returned, the software mixer will emulate this capability.

Definition at line 469 of file audio.h.

int(* set_mic_mute)(struct audio_hw_device *dev, bool state)

Definition at line 488 of file audio.h.

int(* set_mode)(struct audio_hw_device *dev, audio_mode_t mode)

set_mode is called when the audio mode changes. AUDIO_MODE_NORMAL mode is for standard audio playback, AUDIO_MODE_RINGTONE when a ringtone is playing, and AUDIO_MODE_IN_CALL when a call is in progress.

Definition at line 485 of file audio.h.

int(* set_parameters)(struct audio_hw_device *dev, const char *kv_pairs)

Definition at line 492 of file audio.h.

int(* set_voice_volume)(struct audio_hw_device *dev, float volume)

set the audio volume of a voice call. Range is between 0.0 and 1.0

Definition at line 462 of file audio.h.


The documentation for this struct was generated from the following file: