aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/avcodec.h
diff options
context:
space:
mode:
authorFabrice Bellard <fabrice@bellard.org>2001-09-23 17:16:51 +0000
committerFabrice Bellard <fabrice@bellard.org>2001-09-23 17:16:51 +0000
commita96b68b717ee7c93833eb7c07900456e055ef29d (patch)
tree0a1cd1f7e88f9a02bd11ccf80b044d70d21de97b /libavcodec/avcodec.h
parenta56c66a7efb603055381a916b1c7f05bc0b82275 (diff)
downloadffmpeg-a96b68b717ee7c93833eb7c07900456e055ef29d.tar.gz
added pcm codecs
Originally committed as revision 140 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/avcodec.h')
-rw-r--r--libavcodec/avcodec.h43
1 files changed, 39 insertions, 4 deletions
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 5155c8fd24..b423b889b4 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -1,3 +1,6 @@
+#ifndef AVCODEC_H
+#define AVCODEC_H
+
#include "common.h"
enum CodecID {
@@ -9,11 +12,20 @@ enum CodecID {
CODEC_ID_AC3,
CODEC_ID_MJPEG,
CODEC_ID_MPEG4,
- CODEC_ID_PCM,
CODEC_ID_RAWVIDEO,
CODEC_ID_MSMPEG4,
CODEC_ID_H263P,
CODEC_ID_H263I,
+
+ /* various pcm "codecs" */
+ CODEC_ID_PCM_S16LE,
+ CODEC_ID_PCM_S16BE,
+ CODEC_ID_PCM_U16LE,
+ CODEC_ID_PCM_U16BE,
+ CODEC_ID_PCM_S8,
+ CODEC_ID_PCM_U8,
+ CODEC_ID_PCM_MULAW,
+ CODEC_ID_PCM_ALAW,
};
enum CodecType {
@@ -30,6 +42,11 @@ enum PixelFormat {
PIX_FMT_YUV444P,
};
+/* currently unused, may be used if 24/32 bits samples ever supported */
+enum SampleFormat {
+ SAMPLE_FMT_S16 = 0, /* signed 16 bits */
+};
+
/* in bytes */
#define AVCODEC_MAX_AUDIO_FRAME_SIZE 18432
@@ -74,6 +91,7 @@ typedef struct AVCodecContext {
/* audio only */
int sample_rate; /* samples per sec */
int channels;
+ int sample_fmt; /* sample format, currenly unused */
/* the following data should not be initialized */
int frame_size; /* in samples, initialized when calling 'init' */
@@ -130,13 +148,28 @@ extern AVCodec mpeg_decoder;
extern AVCodec h263i_decoder;
extern AVCodec rv10_decoder;
extern AVCodec mjpeg_decoder;
+extern AVCodec mp3_decoder;
-/* dummy raw codecs */
-extern AVCodec pcm_codec;
+/* pcm codecs */
+#define PCM_CODEC(id, name) \
+extern AVCodec name ## _decoder; \
+extern AVCodec name ## _encoder;
+
+PCM_CODEC(CODEC_ID_PCM_S16LE, pcm_s16le);
+PCM_CODEC(CODEC_ID_PCM_S16BE, pcm_s16be);
+PCM_CODEC(CODEC_ID_PCM_U16LE, pcm_u16le);
+PCM_CODEC(CODEC_ID_PCM_U16BE, pcm_u16be);
+PCM_CODEC(CODEC_ID_PCM_S8, pcm_s8);
+PCM_CODEC(CODEC_ID_PCM_U8, pcm_u8);
+PCM_CODEC(CODEC_ID_PCM_ALAW, pcm_alaw);
+PCM_CODEC(CODEC_ID_PCM_MULAW, pcm_mulaw);
+
+#undef PCM_CODEC
+
+/* dummy raw video codec */
extern AVCodec rawvideo_codec;
/* the following codecs use external GPL libs */
-extern AVCodec mp3_decoder;
extern AVCodec ac3_decoder;
/* resample.c */
@@ -203,3 +236,5 @@ int avcodec_encode_video(AVCodecContext *avctx, UINT8 *buf, int buf_size,
int avcodec_close(AVCodecContext *avctx);
void avcodec_register_all(void);
+
+#endif /* AVCODEC_H */