Go to the documentation of this file.
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) {
117 err=ioctl(audio_fd, SNDCTL_DSP_SETFMT, &
tmp);
120 tmp = (
s->channels == 2);
121 err = ioctl(audio_fd, SNDCTL_DSP_STEREO, &
tmp);
124 tmp =
s->sample_rate;
125 err = ioctl(audio_fd, SNDCTL_DSP_SPEED, &
tmp);
127 s->sample_rate =
tmp;
134 #undef CHECK_IOCTL_ERROR
#define AV_LOG_WARNING
Something somehow does not look correct.
int ff_oss_audio_open(AVFormatContext *s1, int is_output, const char *audio_device)
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
int ff_oss_audio_close(OSSAudioData *s)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
int avpriv_open(const char *filename, int flags,...)
A wrapper for open() setting O_CLOEXEC.
#define OSS_AUDIO_BLOCK_SIZE
static void flip(AVCodecContext *avctx, AVFrame *frame)
#define av_err2str(errnum)
Convenience macro, the return value should be used only directly in function arguments but never stan...
static void close(AVCodecParserContext *s)
#define CHECK_IOCTL_ERROR(event)
void * priv_data
Format private data.