Android Hardware Abstraction Layer
Data Structures | Macros | Typedefs | Enumerations
audio.h File Reference
#include <stdint.h>
#include <strings.h>
#include <sys/cdefs.h>
#include <sys/types.h>
#include <cutils/bitops.h>
#include <hardware/hardware.h>
#include <system/audio.h>
#include <hardware/audio_effect.h>

Go to the source code of this file.

Data Structures

struct  audio_config
 
struct  audio_stream
 
struct  audio_stream_out
 
struct  audio_stream_in
 
struct  audio_module
 
struct  audio_hw_device
 

Macros

#define AUDIO_HARDWARE_MODULE_ID   "audio"
 
#define AUDIO_HARDWARE_INTERFACE   "audio_hw_if"
 
#define AUDIO_MODULE_API_VERSION_0_1   HARDWARE_MODULE_API_VERSION(0, 1)
 
#define AUDIO_MODULE_API_VERSION_CURRENT   AUDIO_MODULE_API_VERSION_0_1
 
#define AUDIO_DEVICE_API_VERSION_0_0   HARDWARE_DEVICE_API_VERSION(0, 0)
 
#define AUDIO_DEVICE_API_VERSION_1_0   HARDWARE_DEVICE_API_VERSION(1, 0)
 
#define AUDIO_DEVICE_API_VERSION_2_0   HARDWARE_DEVICE_API_VERSION(2, 0)
 
#define AUDIO_DEVICE_API_VERSION_CURRENT   AUDIO_DEVICE_API_VERSION_2_0
 
#define AUDIO_HARDWARE_MODULE_ID_PRIMARY   "primary"
 
#define AUDIO_HARDWARE_MODULE_ID_A2DP   "a2dp"
 
#define AUDIO_HARDWARE_MODULE_ID_USB   "usb"
 
#define AUDIO_HARDWARE_MODULE_ID_REMOTE_SUBMIX   "r_submix"
 
#define AUDIO_HARDWARE_MODULE_ID_CODEC_OFFLOAD   "codec_offload"
 
#define AUDIO_PARAMETER_KEY_BT_NREC   "bt_headset_nrec"
 
#define AUDIO_PARAMETER_VALUE_ON   "on"
 
#define AUDIO_PARAMETER_VALUE_OFF   "off"
 
#define AUDIO_PARAMETER_KEY_TTY_MODE   "tty_mode"
 
#define AUDIO_PARAMETER_VALUE_TTY_OFF   "tty_off"
 
#define AUDIO_PARAMETER_VALUE_TTY_VCO   "tty_vco"
 
#define AUDIO_PARAMETER_VALUE_TTY_HCO   "tty_hco"
 
#define AUDIO_PARAMETER_VALUE_TTY_FULL   "tty_full"
 
#define AUDIO_PARAMETER_A2DP_SINK_ADDRESS   "a2dp_sink_address"
 
#define AUDIO_PARAMETER_KEY_SCREEN_STATE   "screen_state"
 
#define AUDIO_PARAMETER_STREAM_ROUTING   "routing"
 
#define AUDIO_PARAMETER_STREAM_FORMAT   "format"
 
#define AUDIO_PARAMETER_STREAM_CHANNELS   "channels"
 
#define AUDIO_PARAMETER_STREAM_FRAME_COUNT   "frame_count"
 
#define AUDIO_PARAMETER_STREAM_INPUT_SOURCE   "input_source"
 
#define AUDIO_PARAMETER_STREAM_SAMPLING_RATE   "sampling_rate"
 
#define AUDIO_PARAMETER_STREAM_SUP_FORMATS   "sup_formats"
 
#define AUDIO_PARAMETER_STREAM_SUP_CHANNELS   "sup_channels"
 
#define AUDIO_PARAMETER_STREAM_SUP_SAMPLING_RATES   "sup_sampling_rates"
 
#define AUDIO_OFFLOAD_CODEC_PARAMS   "music_offload_codec_param"
 
#define AUDIO_OFFLOAD_CODEC_BIT_PER_SAMPLE   "music_offload_bit_per_sample"
 
#define AUDIO_OFFLOAD_CODEC_BIT_RATE   "music_offload_bit_rate"
 
#define AUDIO_OFFLOAD_CODEC_AVG_BIT_RATE   "music_offload_avg_bit_rate"
 
#define AUDIO_OFFLOAD_CODEC_ID   "music_offload_codec_id"
 
#define AUDIO_OFFLOAD_CODEC_BLOCK_ALIGN   "music_offload_block_align"
 
#define AUDIO_OFFLOAD_CODEC_SAMPLE_RATE   "music_offload_sample_rate"
 
#define AUDIO_OFFLOAD_CODEC_ENCODE_OPTION   "music_offload_encode_option"
 
#define AUDIO_OFFLOAD_CODEC_NUM_CHANNEL   "music_offload_num_channels"
 
#define AUDIO_OFFLOAD_CODEC_DOWN_SAMPLING   "music_offload_down_sampling"
 
#define AUDIO_OFFLOAD_CODEC_DELAY_SAMPLES   "delay_samples"
 
#define AUDIO_OFFLOAD_CODEC_PADDING_SAMPLES   "padding_samples"
 

Typedefs

typedef struct audio_config audio_config_t
 
typedef struct audio_stream audio_stream_t
 
typedef int(* stream_callback_t )(stream_callback_event_t event, void *param, void *cookie)
 
typedef struct audio_stream_out audio_stream_out_t
 
typedef struct audio_stream_in audio_stream_in_t
 
typedef struct audio_hw_device audio_hw_device_t
 

Enumerations

enum  stream_callback_event_t { STREAM_CBK_EVENT_WRITE_READY, STREAM_CBK_EVENT_DRAIN_READY }
 
enum  audio_drain_type_t { AUDIO_DRAIN_ALL, AUDIO_DRAIN_EARLY_NOTIFY }
 

Macro Definition Documentation

#define AUDIO_DEVICE_API_VERSION_0_0   HARDWARE_DEVICE_API_VERSION(0, 0)

Definition at line 54 of file audio.h.

#define AUDIO_DEVICE_API_VERSION_1_0   HARDWARE_DEVICE_API_VERSION(1, 0)

Definition at line 55 of file audio.h.

#define AUDIO_DEVICE_API_VERSION_2_0   HARDWARE_DEVICE_API_VERSION(2, 0)

Definition at line 56 of file audio.h.

#define AUDIO_DEVICE_API_VERSION_CURRENT   AUDIO_DEVICE_API_VERSION_2_0

Definition at line 57 of file audio.h.

#define AUDIO_HARDWARE_INTERFACE   "audio_hw_if"

Name of the audio devices to open

Definition at line 42 of file audio.h.

#define AUDIO_HARDWARE_MODULE_ID   "audio"

The id of this module

Definition at line 37 of file audio.h.

#define AUDIO_HARDWARE_MODULE_ID_A2DP   "a2dp"

Definition at line 67 of file audio.h.

#define AUDIO_HARDWARE_MODULE_ID_CODEC_OFFLOAD   "codec_offload"

Definition at line 70 of file audio.h.

#define AUDIO_HARDWARE_MODULE_ID_PRIMARY   "primary"

List of known audio HAL modules. This is the base name of the audio HAL library composed of the "audio." prefix, one of the base names below and a suffix specific to the device. e.g: audio.primary.goldfish.so or audio.a2dp.default.so

Definition at line 66 of file audio.h.

#define AUDIO_HARDWARE_MODULE_ID_REMOTE_SUBMIX   "r_submix"

Definition at line 69 of file audio.h.

#define AUDIO_HARDWARE_MODULE_ID_USB   "usb"

Definition at line 68 of file audio.h.

#define AUDIO_MODULE_API_VERSION_0_1   HARDWARE_MODULE_API_VERSION(0, 1)

Definition at line 48 of file audio.h.

#define AUDIO_MODULE_API_VERSION_CURRENT   AUDIO_MODULE_API_VERSION_0_1

Definition at line 49 of file audio.h.

#define AUDIO_OFFLOAD_CODEC_AVG_BIT_RATE   "music_offload_avg_bit_rate"

Definition at line 128 of file audio.h.

#define AUDIO_OFFLOAD_CODEC_BIT_PER_SAMPLE   "music_offload_bit_per_sample"

Definition at line 126 of file audio.h.

#define AUDIO_OFFLOAD_CODEC_BIT_RATE   "music_offload_bit_rate"

Definition at line 127 of file audio.h.

#define AUDIO_OFFLOAD_CODEC_BLOCK_ALIGN   "music_offload_block_align"

Definition at line 130 of file audio.h.

#define AUDIO_OFFLOAD_CODEC_DELAY_SAMPLES   "delay_samples"

Definition at line 135 of file audio.h.

#define AUDIO_OFFLOAD_CODEC_DOWN_SAMPLING   "music_offload_down_sampling"

Definition at line 134 of file audio.h.

#define AUDIO_OFFLOAD_CODEC_ENCODE_OPTION   "music_offload_encode_option"

Definition at line 132 of file audio.h.

#define AUDIO_OFFLOAD_CODEC_ID   "music_offload_codec_id"

Definition at line 129 of file audio.h.

#define AUDIO_OFFLOAD_CODEC_NUM_CHANNEL   "music_offload_num_channels"

Definition at line 133 of file audio.h.

#define AUDIO_OFFLOAD_CODEC_PADDING_SAMPLES   "padding_samples"

Definition at line 136 of file audio.h.

#define AUDIO_OFFLOAD_CODEC_PARAMS   "music_offload_codec_param"

audio codec parameters

Definition at line 125 of file audio.h.

#define AUDIO_OFFLOAD_CODEC_SAMPLE_RATE   "music_offload_sample_rate"

Definition at line 131 of file audio.h.

#define AUDIO_PARAMETER_A2DP_SINK_ADDRESS   "a2dp_sink_address"

Definition at line 95 of file audio.h.

#define AUDIO_PARAMETER_KEY_BT_NREC   "bt_headset_nrec"

standard audio parameters that the HAL may need to handle audio device parameters

Definition at line 83 of file audio.h.

#define AUDIO_PARAMETER_KEY_SCREEN_STATE   "screen_state"

Definition at line 98 of file audio.h.

#define AUDIO_PARAMETER_KEY_TTY_MODE   "tty_mode"

Definition at line 88 of file audio.h.

#define AUDIO_PARAMETER_STREAM_CHANNELS   "channels"

Definition at line 106 of file audio.h.

#define AUDIO_PARAMETER_STREAM_FORMAT   "format"

Definition at line 105 of file audio.h.

#define AUDIO_PARAMETER_STREAM_FRAME_COUNT   "frame_count"

Definition at line 107 of file audio.h.

#define AUDIO_PARAMETER_STREAM_INPUT_SOURCE   "input_source"

Definition at line 108 of file audio.h.

#define AUDIO_PARAMETER_STREAM_ROUTING   "routing"

audio stream parameters

Definition at line 104 of file audio.h.

#define AUDIO_PARAMETER_STREAM_SAMPLING_RATE   "sampling_rate"

Definition at line 109 of file audio.h.

#define AUDIO_PARAMETER_STREAM_SUP_CHANNELS   "sup_channels"

Definition at line 116 of file audio.h.

#define AUDIO_PARAMETER_STREAM_SUP_FORMATS   "sup_formats"

Definition at line 113 of file audio.h.

#define AUDIO_PARAMETER_STREAM_SUP_SAMPLING_RATES   "sup_sampling_rates"

Definition at line 119 of file audio.h.

#define AUDIO_PARAMETER_VALUE_OFF   "off"

Definition at line 85 of file audio.h.

#define AUDIO_PARAMETER_VALUE_ON   "on"

Definition at line 84 of file audio.h.

#define AUDIO_PARAMETER_VALUE_TTY_FULL   "tty_full"

Definition at line 92 of file audio.h.

#define AUDIO_PARAMETER_VALUE_TTY_HCO   "tty_hco"

Definition at line 91 of file audio.h.

#define AUDIO_PARAMETER_VALUE_TTY_OFF   "tty_off"

Definition at line 89 of file audio.h.

#define AUDIO_PARAMETER_VALUE_TTY_VCO   "tty_vco"

Definition at line 90 of file audio.h.

Typedef Documentation

typedef struct audio_config audio_config_t

Definition at line 150 of file audio.h.

Definition at line 547 of file audio.h.

Definition at line 408 of file audio.h.

Definition at line 380 of file audio.h.

typedef struct audio_stream audio_stream_t

Definition at line 234 of file audio.h.

typedef int(* stream_callback_t)(stream_callback_event_t event, void *param, void *cookie)

Definition at line 242 of file audio.h.

Enumeration Type Documentation

Enumerator
AUDIO_DRAIN_ALL 
AUDIO_DRAIN_EARLY_NOTIFY 

Definition at line 245 of file audio.h.

Enumerator
STREAM_CBK_EVENT_WRITE_READY 
STREAM_CBK_EVENT_DRAIN_READY 

Definition at line 237 of file audio.h.