audio_stream Struct Reference

audio_stream Struct Reference

#include < audio.h >

Data Fields

uint32_t(*  get_sample_rate )(const struct audio_stream *stream)
 
int(*  set_sample_rate )(struct audio_stream *stream, uint32_t rate)
 
size_t(*  get_buffer_size )(const struct audio_stream *stream)
 
audio_channel_mask_t(*  get_channels )(const struct audio_stream *stream)
 
audio_format_t(*  get_format )(const struct audio_stream *stream)
 
int(*  set_format )(struct audio_stream *stream, audio_format_t format)
 
int(*  standby )(struct audio_stream *stream)
 
int(*  dump )(const struct audio_stream *stream, int fd)
 
audio_devices_t(*  get_device )(const struct audio_stream *stream)
 
int(*  set_device )(struct audio_stream *stream, audio_devices_t device)
 
int(*  set_parameters )(struct audio_stream *stream, const char *kv_pairs)
 
char *(*  get_parameters )(const struct audio_stream *stream, const char *keys)
 
int(*  add_audio_effect )(const struct audio_stream *stream, effect_handle_t effect)
 
int(*  remove_audio_effect )(const struct audio_stream *stream, effect_handle_t effect)
 

Detailed Description

Definition at line 170 of file audio.h .

Field Documentation

int(* add_audio_effect)(const struct audio_stream *stream, effect_handle_t effect)

Definition at line 246 of file audio.h .

int(* dump)(const struct audio_stream *stream, int fd)

dump the state of the audio input/output device

Definition at line 212 of file audio.h .

size_t(* get_buffer_size)(const struct audio_stream *stream)

Return size of input/output buffer in bytes for this stream - eg. 4800. It should be a multiple of the frame size. See also get_input_buffer_size.

Definition at line 186 of file audio.h .

audio_channel_mask_t(* get_channels)(const struct audio_stream *stream)

Return the channel mask - e.g. AUDIO_CHANNEL_OUT_STEREO or AUDIO_CHANNEL_IN_STEREO

Definition at line 192 of file audio.h .

audio_devices_t(* get_device)(const struct audio_stream *stream)

Return the set of device(s) which this stream is connected to

Definition at line 215 of file audio.h .

audio_format_t(* get_format)(const struct audio_stream *stream)

Return the audio format - e.g. AUDIO_FORMAT_PCM_16_BIT

Definition at line 197 of file audio.h .

char*(* get_parameters)(const struct audio_stream *stream, const char *keys)

Definition at line 244 of file audio.h .

uint32_t(* get_sample_rate)(const struct audio_stream *stream)

Return the sampling rate in Hz - eg. 44100.

Definition at line 175 of file audio.h .

int(* remove_audio_effect)(const struct audio_stream *stream, effect_handle_t effect)

Definition at line 248 of file audio.h .

int(* set_device)(struct audio_stream *stream, audio_devices_t device)

Currently unused - set_device() corresponds to set_parameters() with key AUDIO_PARAMETER_STREAM_ROUTING for both input and output. AUDIO_PARAMETER_STREAM_INPUT_SOURCE is an additional information used by input streams only.

Definition at line 223 of file audio.h .

int(* set_format)(struct audio_stream *stream, audio_format_t format)

Definition at line 202 of file audio.h .

int(* set_parameters)(struct audio_stream *stream, const char *kv_pairs)

set/get audio stream parameters. The function accepts a list of parameter key value pairs in the form: key1=value1;key2=value2;...

Some keys are reserved for standard parameters (See AudioParameter class)

If the implementation does not accept a parameter change while the output is active but the parameter is acceptable otherwise, it must return -ENOSYS.

The audio flinger will put the stream in standby and then change the parameter value.

Definition at line 238 of file audio.h .

int(* set_sample_rate)(struct audio_stream *stream, uint32_t rate)

Definition at line 180 of file audio.h .

int(* standby)(struct audio_stream *stream)

Put the audio hardware input/output into standby mode. Driver should exit from standby mode at the next I/O operation. Returns 0 on success and <0 on failure.

Definition at line 209 of file audio.h .


The documentation for this struct was generated from the following file:
  • hardware/libhardware/include/hardware/ audio.h