27 #include <soundcard.h> 29 #include <sys/soundcard.h> 34 #include <sys/ioctl.h> 45 const char *audio_device)
50 char *
flip = getenv(
"AUDIO_FLIP_LEFT");
62 if (flip && *flip ==
'1') {
68 fcntl(audio_fd, F_SETFL, O_NONBLOCK);
72 #define CHECK_IOCTL_ERROR(event) \ 74 av_strerror(AVERROR(errno), errbuff, sizeof(errbuff)); \ 75 av_log(s1, AV_LOG_ERROR, #event ": %s\n", errbuff); \ 83 (
void) ioctl(audio_fd, SNDCTL_DSP_GETFMTS, &tmp);
86 if (tmp & AFMT_S16_BE) {
88 }
else if (tmp & AFMT_S16_LE) {
94 if (tmp & AFMT_S16_LE) {
96 }
else if (tmp & AFMT_S16_BE) {
115 err=ioctl(audio_fd, SNDCTL_DSP_SETFMT, &tmp);
119 err = ioctl(audio_fd, SNDCTL_DSP_STEREO, &tmp);
123 err = ioctl(audio_fd, SNDCTL_DSP_SPEED, &tmp);
132 #undef CHECK_IOCTL_ERROR
#define CHECK_IOCTL_ERROR(event)
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)
int avpriv_open(const char *filename, int flags,...)
A wrapper for open() setting O_CLOEXEC.
#define OSS_AUDIO_BLOCK_SIZE
int ff_oss_audio_open(AVFormatContext *s1, int is_output, const char *audio_device)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static void flip(AVCodecContext *avctx, AVFrame *frame)
Libavcodec external API header.
static void(WINAPI *cond_broadcast)(pthread_cond_t *cond)
int ff_oss_audio_close(OSSAudioData *s)
void * priv_data
Format private data.