40 #include <alsa/asoundlib.h> 52 unsigned int sample_rate;
59 res =
ff_alsa_open(s1, SND_PCM_STREAM_PLAYBACK, &sample_rate,
63 "sample rate %d not available, nearest is %d\n",
90 while ((res = snd_pcm_writei(s->
h, buf, size)) < 0) {
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
av_log(ac->avr, AV_LOG_TRACE, "%d samples - audio_convert: %s to %s (%s)\, len, av_get_sample_fmt_name(ac->in_fmt), av_get_sample_fmt_name(ac->out_fmt), use_generic ? ac->func_descr_generic :ac->func_descr)
AVOutputFormat ff_alsa_muxer
ALSA input and output: definitions and structures.
AVStream ** streams
A list of all streams in the file.
static av_cold int audio_write_header(AVFormatContext *s1)
int ff_alsa_extend_reorder_buf(AlsaData *s, int min_size)
AVCodecID
Identify the syntax and semantics of the bitstream.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
static int audio_write_packet(AVFormatContext *s1, AVPacket *pkt)
common internal API header
void(* reorder_func)(const void *, void *, int)
int ff_alsa_xrun_recover(AVFormatContext *s1, int err)
Try to recover from ALSA buffer underrun.
static void write_packet(OutputFile *of, AVPacket *pkt, OutputStream *ost)
av_cold int ff_alsa_close(AVFormatContext *s1)
Close the ALSA PCM.
int sample_rate
Audio only.
void * priv_data
Format private data.
static void write_header(FFV1Context *f)
int frame_size
preferred size for reads and writes
AVCodecParameters * codecpar
This structure stores compressed data.
int reorder_buf_size
in frames
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.