27 #include <soundcard.h>
29 #include <sys/soundcard.h>
34 #include <sys/ioctl.h>
36 #include "libavutil/log.h"
38 #include "libavcodec/avcodec.h"
40 #include "libavformat/avformat.h"
45 const char *audio_device)
50 char *
flip = getenv(
"AUDIO_FLIP_LEFT");
61 if (flip && *flip ==
'1') {
67 fcntl(audio_fd, F_SETFL, O_NONBLOCK);
72 err = ioctl(audio_fd, SNDCTL_DSP_GETFMTS, &tmp);
75 if (tmp & AFMT_S16_BE) {
77 }
else if (tmp & AFMT_S16_LE) {
83 if (tmp & AFMT_S16_LE) {
85 }
else if (tmp & AFMT_S16_BE) {
104 err=ioctl(audio_fd, SNDCTL_DSP_SETFMT, &tmp);
111 err = ioctl(audio_fd, SNDCTL_DSP_STEREO, &tmp);
118 err = ioctl(audio_fd, SNDCTL_DSP_SPEED, &tmp);
#define OSS_AUDIO_BLOCK_SIZE
void av_log(void *avcl, int level, const char *fmt,...) av_printf_format(3
Send the specified message to the log if the level is less than or equal to the current av_log_level...
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 * priv_data
Format private data.
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)
int ff_oss_audio_close(OSSAudioData *s)