audio_stream_in Struct Reference

audio_stream_in Struct Reference

#include < audio.h >

Data Fields

struct audio_stream   common
 
int(*  set_gain )(struct audio_stream_in *stream, float gain)
 
ssize_t(*  read )(struct audio_stream_in *stream, void *buffer, size_t bytes)
 
uint32_t(*  get_input_frames_lost )(struct audio_stream_in *stream)
 
int(*  get_capture_position )(const struct audio_stream_in *stream, int64_t *frames, int64_t *time)
 

Detailed Description

Definition at line 404 of file audio.h .

Field Documentation

struct audio_stream common

Common methods of the audio stream in. This must be the first member of audio_stream_in as users of this structure will cast a audio_stream to audio_stream_in pointer in contexts where it's known the audio_stream references an audio_stream_in .

Definition at line 410 of file audio.h .

int(* get_capture_position)(const struct audio_stream_in *stream, int64_t *frames, int64_t *time)

Return a recent count of the number of audio frames received and the clock time associated with that frame count.

frames is the total frame count received. This should be as early in the capture pipeline as possible. In general, frames should be non-negative and should not go "backwards".

time is the clock MONOTONIC time when frames was measured. In general, time should be a positive quantity and should not go "backwards".

The status returned is 0 on success, -ENOSYS if the device is not ready/available, or -EINVAL if the arguments are null or otherwise invalid.

Definition at line 449 of file audio.h .

uint32_t(* get_input_frames_lost)(struct audio_stream_in *stream)

Return the amount of input frames lost in the audio driver since the last call of this function. Audio driver is expected to reset the value to 0 and restart counting upon returning the current value by this function call. Such loss typically occurs when the user space process is blocked longer than the capacity of audio driver buffers.

Unit: the number of input audio frames

Definition at line 433 of file audio.h .

ssize_t(* read)(struct audio_stream_in *stream, void *buffer, size_t bytes)

Read audio buffer in from audio driver. Returns number of bytes read, or a negative status_t. If at least one frame was read prior to the error, read should return that byte count and then return an error in the subsequent call.

Definition at line 420 of file audio.h .

int(* set_gain)(struct audio_stream_in *stream, float gain)

set the input gain for the audio driver. This method is for for future use

Definition at line 414 of file audio.h .


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