40 #include <alsa/asoundlib.h>
49 unsigned int sample_rate;
56 res =
ff_alsa_open(s1, SND_PCM_STREAM_PLAYBACK, &sample_rate,
60 "sample rate %d not available, nearest is %d\n",
87 while ((res = snd_pcm_writei(s->
h, buf, size)) < 0) {
void(* reorder_func)(const void *, void *, int)
av_cold int ff_alsa_close(AVFormatContext *s1)
Close the ALSA PCM.
int ff_alsa_extend_reorder_buf(AlsaData *s, int min_size)
AVCodecID
Identify the syntax and semantics of the bitstream.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
void av_log(void *avcl, int level, const char *fmt,...)
AVCodecContext * codec
Codec context associated with this stream.
av_cold int ff_alsa_open(AVFormatContext *ctx, snd_pcm_stream_t mode, unsigned int *sample_rate, int channels, enum AVCodecID *codec_id)
Open an ALSA PCM.
static av_cold int audio_write_header(AVFormatContext *s1)
int sample_rate
samples per second
AVOutputFormat ff_alsa_muxer
int ff_alsa_xrun_recover(AVFormatContext *s1, int err)
Try to recover from ALSA buffer underrun.
static int audio_write_packet(AVFormatContext *s1, AVPacket *pkt)
int channels
number of audio channels
void * priv_data
Format private data.
static void write_header(FFV1Context *f)
int frame_size
preferred size for reads and writes
ALSA input and output: definitions and structures.
This structure stores compressed data.
int reorder_buf_size
in frames