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 OSS_AUDIO_BLOCK_SIZE
int avpriv_open(const char *filename, int flags,...)
A wrapper for open() setting O_CLOEXEC.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
void av_log(void *avcl, int level, const char *fmt,...)
#define CHECK_IOCTL_ERROR(event)
Libavcodec external API header.
static void(WINAPI *cond_broadcast)(pthread_cond_t *cond)
static void close(AVCodecParserContext *s)
int ff_oss_audio_open(AVFormatContext *s1, int is_output, const char *audio_device)
static void flip(AVCodecContext *avctx, AVPicture *picture)
void * priv_data
Format private data.
int ff_oss_audio_close(OSSAudioData *s)