30 #include <sys/ioctl.h>
31 #include <sys/soundcard.h>
41 const char *audio_device)
46 char *
flip = getenv(
"AUDIO_FLIP_LEFT");
63 if (fcntl(audio_fd, F_SETFL, O_NONBLOCK) < 0) {
70 #define CHECK_IOCTL_ERROR(event) \
72 av_log(s1, AV_LOG_ERROR, #event ": %s\n", av_err2str(AVERROR(errno)));\
80 err = 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);
118 tmp = (
s->channels == 2);
119 err = ioctl(audio_fd, SNDCTL_DSP_STEREO, &
tmp);
122 tmp =
s->sample_rate;
123 err = ioctl(audio_fd, SNDCTL_DSP_SPEED, &
tmp);
125 s->sample_rate =
tmp;
132 #undef CHECK_IOCTL_ERROR
Libavcodec external API header.
Main libavdevice API header.
#define av_err2str(errnum)
Convenience macro, the return value should be used only directly in function arguments but never stan...
#define AV_LOG_WARNING
Something somehow does not look correct.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static void flip(AVCodecContext *avctx, AVFrame *frame)
int avpriv_open(const char *filename, int flags,...)
A wrapper for open() setting O_CLOEXEC.
int ff_oss_audio_open(AVFormatContext *s1, int is_output, const char *audio_device)
int ff_oss_audio_close(OSSAudioData *s)
#define CHECK_IOCTL_ERROR(event)
#define OSS_AUDIO_BLOCK_SIZE