libavdevice/alsa-audio-dec.c File Reference

ALSA input and output: input. More...

#include <alsa/asoundlib.h>
#include "libavutil/opt.h"
#include "avdevice.h"
#include "alsa-audio.h"

Go to the source code of this file.


static av_cold int audio_read_header (AVFormatContext *s1, AVFormatParameters *ap)
static int audio_read_packet (AVFormatContext *s1, AVPacket *pkt)


static const AVOption options []
static const AVClass alsa_demuxer_class
AVInputFormat ff_alsa_demuxer

Detailed Description

ALSA input and output: input.

Luca Abeni ( lucabe72 email it )

Benoit Fouet ( benoit fouet free fr )

Nicolas George ( nicolas george normalesup org )

This avdevice decoder allows to capture audio from an ALSA (Advanced Linux Sound Architecture) device.

The filename parameter is the name of an ALSA PCM device capable of capture, for example "default" or "plughw:1"; see the ALSA documentation for naming conventions. The empty string is equivalent to "default".

The capture period is set to the lower value available for the device, which gives a low latency suitable for real-time capture.

The PTS are an Unix time in microsecond.

Due to a bug in the ALSA library (, this decoder does not work with certain ALSA plugins, especially the dsnoop plugin.

Definition in file alsa-audio-dec.c.

Function Documentation

static av_cold int audio_read_header ( AVFormatContext s1,
AVFormatParameters ap 
) [static]

Definition at line 54 of file alsa-audio-dec.c.

static int audio_read_packet ( AVFormatContext s1,
AVPacket pkt 
) [static]

Definition at line 122 of file alsa-audio-dec.c.

Variable Documentation

const AVClass alsa_demuxer_class [static]

Initial value:

    .class_name     = "ALSA demuxer",
    .item_name      = av_default_item_name,
    .option         = options,
    .version        = LIBAVUTIL_VERSION_INT,

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

Initial value:

    NULL_IF_CONFIG_SMALL("ALSA audio input"),
    .flags = AVFMT_NOFILE,
    .priv_class = &alsa_demuxer_class,

Definition at line 174 of file alsa-audio-dec.c.

const AVOption options[] [static]

Initial value:

    { "sample_rate", "", 0x42, FF_OPT_TYPE_INT, {.dbl = 48000}, 1, INT_MAX, AV_OPT_FLAG_DECODING_PARAM },
    { "channels",    "", 0x42,    FF_OPT_TYPE_INT, {.dbl = 2},     1, INT_MAX, AV_OPT_FLAG_DECODING_PARAM },
    { NULL },

Definition at line 161 of file alsa-audio-dec.c.

Generated on Fri Oct 26 02:38:19 2012 for FFmpeg by  doxygen 1.5.8