123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109 |
- #ifndef AVDEVICE_ALSA_H
- #define AVDEVICE_ALSA_H
- #include <alsa/asoundlib.h>
- #include "config.h"
- #include "libavutil/log.h"
- #include "timefilter.h"
- #include "avdevice.h"
- #define DEFAULT_CODEC_ID AV_NE(AV_CODEC_ID_PCM_S16BE, AV_CODEC_ID_PCM_S16LE)
- typedef void (*ff_reorder_func)(const void *, void *, int);
- #define ALSA_BUFFER_SIZE_MAX 131072
- typedef struct AlsaData {
- AVClass *class;
- snd_pcm_t *h;
- int frame_size;
- int period_size;
- int sample_rate;
- int channels;
- int last_period;
- TimeFilter *timefilter;
- void (*reorder_func)(const void *, void *, int);
- void *reorder_buf;
- int reorder_buf_size;
- int64_t timestamp;
- AVPacket *pkt;
- } AlsaData;
- av_warn_unused_result
- int ff_alsa_open(AVFormatContext *s, snd_pcm_stream_t mode,
- unsigned int *sample_rate,
- int channels, enum AVCodecID *codec_id);
- int ff_alsa_close(AVFormatContext *s1);
- av_warn_unused_result
- int ff_alsa_xrun_recover(AVFormatContext *s1, int err);
- av_warn_unused_result
- int ff_alsa_extend_reorder_buf(AlsaData *s, int size);
- av_warn_unused_result
- int ff_alsa_get_device_list(AVDeviceInfoList *device_list, snd_pcm_stream_t stream_type);
- #endif
|