]> git.sesse.net Git - ffmpeg/blobdiff - libavdevice/alsa-audio.h
avio: avio: avio_ prefixes for put_* functions
[ffmpeg] / libavdevice / alsa-audio.h
index 9547f790af00f453d5b2f16ef47c55d1ef195a4e..949383157efc820fe7030f95731a3379c2060e3e 100644 (file)
@@ -21,7 +21,7 @@
  */
 
 /**
- * @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;
@@ -46,7 +46,7 @@ typedef struct {
 } 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
@@ -59,11 +59,12 @@ typedef struct {
  *
  * @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
  *
@@ -72,7 +73,7 @@ int ff_alsa_open(AVFormatContext *s, int mode, unsigned int *sample_rate,
 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