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, const char *address) |
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, audio_input_flags_t flags, const char *address, audio_source_t source) |
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) |
int(* | create_audio_patch )(struct audio_hw_device *dev, unsigned int num_sources, const struct audio_port_config *sources, unsigned int num_sinks, const struct audio_port_config *sinks, audio_patch_handle_t *handle) |
int(* | release_audio_patch )(struct audio_hw_device *dev, audio_patch_handle_t handle) |
int(* | get_audio_port )(struct audio_hw_device *dev, struct audio_port *port) |
int(* | set_audio_port_config )(struct audio_hw_device *dev, const struct audio_port_config *config) |
Detailed Description
Field Documentation
void(* close_input_stream)(struct audio_hw_device *dev, struct audio_stream_in *stream_in) |
void(* close_output_stream)(struct audio_hw_device *dev, struct audio_stream_out *stream_out) |
struct hw_device_t common |
Common methods of the audio device. This must be the first member of audio_hw_device as users of this structure will cast a hw_device_t to audio_hw_device pointer in contexts where it's known the hw_device_t references an audio_hw_device .
int(* create_audio_patch)(struct audio_hw_device *dev, unsigned int num_sources, const struct audio_port_config *sources, unsigned int num_sinks, const struct audio_port_config *sinks, audio_patch_handle_t *handle) |
int(* dump)(const struct audio_hw_device *dev, int fd) |
int(* get_audio_port)(struct audio_hw_device *dev, struct audio_port *port) |
size_t(* get_input_buffer_size)(const struct audio_hw_device *dev, const struct audio_config *config) |
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.
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.
int(* get_mic_mute)(const struct audio_hw_device *dev, bool *state) |
char*(* get_parameters)(const struct audio_hw_device *dev, const char *keys) |
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.
int(* init_check)(const struct audio_hw_device *dev) |
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, audio_input_flags_t flags, const char *address, audio_source_t source) |
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, const char *address) |
This method creates and opens the audio hardware output stream. The "address" parameter qualifies the "devices" audio device type if needed. The format format depends on the device type:
- Bluetooth devices use the MAC address of the device in the form "00:11:22:AA:BB:CC"
- USB devices use the ALSA card and device numbers in the form "card=X;device=Y"
- Other devices may use a number or any other string.
int(* release_audio_patch)(struct audio_hw_device *dev, audio_patch_handle_t handle) |
int(* set_audio_port_config)(struct audio_hw_device *dev, const struct audio_port_config *config) |
int(* set_master_mute)(struct audio_hw_device *dev, bool mute) |
int(* set_master_volume)(struct audio_hw_device *dev, float volume) |
int(* set_mic_mute)(struct audio_hw_device *dev, bool state) |
int(* set_mode)(struct audio_hw_device *dev, audio_mode_t mode) |
int(* set_parameters)(struct audio_hw_device *dev, const char *kv_pairs) |
int(* set_voice_volume)(struct audio_hw_device *dev, float volume) |
The documentation for this struct was generated from the following file:
- hardware/libhardware/include/hardware/ audio.h