summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2011-09-14 09:54:29 +0200
committerAnton Khirnov <anton@khirnov.net>2011-09-17 06:42:32 +0200
commit34d2bf30a082d489487493df40496cc18ca4300b (patch)
treeb414bd79cb069a733b977a2adf90773b6a402c27
parentd906f49aa8f36fc173cfa96580cbe29e88be5049 (diff)
pcmdec: use unique classes for all pcm demuxers.
-rw-r--r--libavformat/pcmdec.c16
-rw-r--r--libavformat/rawdec.c13
-rw-r--r--libavformat/rawdec.h1
3 files changed, 15 insertions, 15 deletions
diff --git a/libavformat/pcmdec.c b/libavformat/pcmdec.c
index 343bbf0ae2..90799dd664 100644
--- a/libavformat/pcmdec.c
+++ b/libavformat/pcmdec.c
@@ -22,6 +22,8 @@
#include "avformat.h"
#include "rawdec.h"
#include "pcm.h"
+#include "libavutil/log.h"
+#include "libavutil/opt.h"
#define RAW_SAMPLES 1024
@@ -46,7 +48,19 @@ static int raw_read_packet(AVFormatContext *s, AVPacket *pkt)
return ret;
}
+static const AVOption pcm_options[] = {
+ { "sample_rate", "", offsetof(RawAudioDemuxerContext, sample_rate), FF_OPT_TYPE_INT, {.dbl = 0}, 0, INT_MAX, AV_OPT_FLAG_DECODING_PARAM },
+ { "channels", "", offsetof(RawAudioDemuxerContext, channels), FF_OPT_TYPE_INT, {.dbl = 0}, 0, INT_MAX, AV_OPT_FLAG_DECODING_PARAM },
+ { NULL },
+};
+
#define PCMDEF(name, long_name, ext, codec) \
+static const AVClass name ## _demuxer_class = {\
+ .class_name = #name " demuxer",\
+ .item_name = av_default_item_name,\
+ .option = pcm_options,\
+ .version = LIBAVUTIL_VERSION_INT,\
+};\
AVInputFormat ff_pcm_ ## name ## _demuxer = {\
#name,\
NULL_IF_CONFIG_SMALL(long_name),\
@@ -59,7 +73,7 @@ AVInputFormat ff_pcm_ ## name ## _demuxer = {\
.flags= AVFMT_GENERIC_INDEX,\
.extensions = ext,\
.value = codec,\
- .priv_class = &ff_rawaudio_demuxer_class,\
+ .priv_class = &name ## _demuxer_class,\
};
PCMDEF(f64be, "PCM 64 bit floating-point big-endian format",
diff --git a/libavformat/rawdec.c b/libavformat/rawdec.c
index f0d487bd6f..0b9a0824ff 100644
--- a/libavformat/rawdec.c
+++ b/libavformat/rawdec.c
@@ -167,19 +167,6 @@ fail:
/* Note: Do not forget to add new entries to the Makefile as well. */
-static const AVOption audio_options[] = {
- { "sample_rate", "", offsetof(RawAudioDemuxerContext, sample_rate), FF_OPT_TYPE_INT, {.dbl = 0}, 0, INT_MAX, AV_OPT_FLAG_DECODING_PARAM },
- { "channels", "", offsetof(RawAudioDemuxerContext, channels), FF_OPT_TYPE_INT, {.dbl = 0}, 0, INT_MAX, AV_OPT_FLAG_DECODING_PARAM },
- { NULL },
-};
-
-const AVClass ff_rawaudio_demuxer_class = {
- .class_name = "rawaudio demuxer",
- .item_name = av_default_item_name,
- .option = audio_options,
- .version = LIBAVUTIL_VERSION_INT,
-};
-
#define OFFSET(x) offsetof(FFRawVideoDemuxerContext, x)
#define DEC AV_OPT_FLAG_DECODING_PARAM
static const AVOption video_options[] = {
diff --git a/libavformat/rawdec.h b/libavformat/rawdec.h
index 76e8053f6d..73bfb4abc4 100644
--- a/libavformat/rawdec.h
+++ b/libavformat/rawdec.h
@@ -38,7 +38,6 @@ typedef struct FFRawVideoDemuxerContext {
char *framerate; /**< String describing framerate, set by a private option. */
} FFRawVideoDemuxerContext;
-extern const AVClass ff_rawaudio_demuxer_class;
extern const AVClass ff_rawvideo_demuxer_class;
int ff_raw_read_header(AVFormatContext *s, AVFormatParameters *ap);