*/
/**
- * @file alsa-audio.h
+ * @file
* ALSA input and output: definitions and structures
* @author Luca Abeni ( lucabe72 email it )
* @author Benoit Fouet ( benoit fouet free fr )
#ifndef AVDEVICE_ALSA_AUDIO_H
#define AVDEVICE_ALSA_AUDIO_H
+#include <alsa/asoundlib.h>
+#include "config.h"
+#include "libavformat/avformat.h"
+
/* XXX: we make the assumption that the soundcard accepts this format */
/* XXX: find better solution with "preinit" method, needed also in
other formats */
-#ifdef WORDS_BIGENDIAN
-#define DEFAULT_CODEC_ID CODEC_ID_PCM_S16BE
-#else
-#define DEFAULT_CODEC_ID CODEC_ID_PCM_S16LE
-#endif
+#define DEFAULT_CODEC_ID AV_NE(CODEC_ID_PCM_S16BE, CODEC_ID_PCM_S16LE)
typedef struct {
snd_pcm_t *h;
} AlsaData;
/**
- * Opens an ALSA PCM.
+ * Open an ALSA PCM.
*
* @param s media file handle
* @param mode either SND_PCM_STREAM_CAPTURE or SND_PCM_STREAM_PLAYBACK
*
* @return 0 if OK, AVERROR_xxx on error
*/
-int ff_alsa_open(AVFormatContext *s, int mode, unsigned int *sample_rate,
- int channels, int *codec_id);
+int ff_alsa_open(AVFormatContext *s, snd_pcm_stream_t mode,
+ unsigned int *sample_rate,
+ int channels, enum CodecID *codec_id);
/**
- * Closes the ALSA PCM.
+ * Close the ALSA PCM.
*
* @param s1 media file handle
*
int ff_alsa_close(AVFormatContext *s1);
/**
- * Tries to recover from ALSA buffer underrun.
+ * Try to recover from ALSA buffer underrun.
*
* @param s1 media file handle
* @param err error code reported by the previous ALSA call