alsa-audio.h File Reference

ALSA input and output: definitions and structures. More...

#include <alsa/asoundlib.h>
#include "config.h"
#include "libavutil/log.h"
#include "timefilter.h"
#include "avdevice.h"
Include dependency graph for alsa-audio.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  AlsaData
 

Macros

#define DEFAULT_CODEC_ID   AV_NE(AV_CODEC_ID_PCM_S16BE, AV_CODEC_ID_PCM_S16LE)
 
#define ALSA_BUFFER_SIZE_MAX   65536
 

Typedefs

typedef void(* ff_reorder_func) (const void *, void *, int)
 
typedef struct AlsaData AlsaData
 

Functions

int ff_alsa_open (AVFormatContext *s, snd_pcm_stream_t mode, unsigned int *sample_rate, int channels, enum AVCodecID *codec_id)
 Open an ALSA PCM. More...
 
int ff_alsa_close (AVFormatContext *s1)
 Close the ALSA PCM. More...
 
int ff_alsa_xrun_recover (AVFormatContext *s1, int err)
 Try to recover from ALSA buffer underrun. More...
 
int ff_alsa_extend_reorder_buf (AlsaData *s, int size)
 

Detailed Description

ALSA input and output: definitions and structures.

Author
Luca Abeni ( lucabe72 email it )
Benoit Fouet ( benoit fouet free fr )

Definition in file alsa-audio.h.

Macro Definition Documentation

#define ALSA_BUFFER_SIZE_MAX   65536

Definition at line 46 of file alsa-audio.h.

Referenced by ff_alsa_open().

#define DEFAULT_CODEC_ID   AV_NE(AV_CODEC_ID_PCM_S16BE, AV_CODEC_ID_PCM_S16LE)

Definition at line 42 of file alsa-audio.h.

Referenced by ff_alsa_open().

Typedef Documentation

typedef struct AlsaData AlsaData
typedef void(* ff_reorder_func) (const void *, void *, int)

Definition at line 44 of file alsa-audio.h.

Function Documentation

int ff_alsa_close ( AVFormatContext s1)

Close the ALSA PCM.

Parameters
s1media file handle
Returns
0

Definition at line 299 of file alsa-audio-common.c.

int ff_alsa_extend_reorder_buf ( AlsaData s,
int  size 
)

Definition at line 331 of file alsa-audio-common.c.

Referenced by audio_write_packet().

int ff_alsa_open ( AVFormatContext s,
snd_pcm_stream_t  mode,
unsigned int *  sample_rate,
int  channels,
enum AVCodecID codec_id 
)

Open an ALSA PCM.

Parameters
smedia file handle
modeeither SND_PCM_STREAM_CAPTURE or SND_PCM_STREAM_PLAYBACK
sample_ratein: requested sample rate; out: actually selected sample rate
channelsnumber of channels
codec_idin: requested AVCodecID or AV_CODEC_ID_NONE; out: actually selected AVCodecID, changed only if AV_CODEC_ID_NONE was requested
Returns
0 if OK, AVERROR_xxx on error

Definition at line 167 of file alsa-audio-common.c.

Referenced by audio_read_header(), and audio_write_header().

int ff_alsa_xrun_recover ( AVFormatContext s1,
int  err 
)

Try to recover from ALSA buffer underrun.

Parameters
s1media file handle
errerror code reported by the previous ALSA call
Returns
0 if OK, AVERROR_xxx on error

Definition at line 310 of file alsa-audio-common.c.

Referenced by audio_read_packet(), and audio_write_packet().