summaryrefslogtreecommitdiff
path: root/libavcodec/ac3dec.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2011-05-20 22:37:59 +0200
committerAnton Khirnov <anton@khirnov.net>2011-07-10 17:07:12 +0200
commit9b83919f44eb1c87dc9431112944f0cccf6a599f (patch)
treed5dc047b684367ed16ec2124467bc4fc315dec04 /libavcodec/ac3dec.c
parenta67c061e0f3b55ffcc96f336fc0998e44b86c8e4 (diff)
ac3dec: add a drc_scale private option
Deprecate corresponding AVCodecContext option. This is the first test of decoder private options.
Diffstat (limited to 'libavcodec/ac3dec.c')
-rw-r--r--libavcodec/ac3dec.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/libavcodec/ac3dec.c b/libavcodec/ac3dec.c
index 42b62ef701..663acc0ac9 100644
--- a/libavcodec/ac3dec.c
+++ b/libavcodec/ac3dec.c
@@ -30,6 +30,7 @@
#include <string.h>
#include "libavutil/crc.h"
+#include "libavutil/opt.h"
#include "internal.h"
#include "aac_ac3_parser.h"
#include "ac3_parser.h"
@@ -1440,6 +1441,20 @@ static av_cold int ac3_decode_end(AVCodecContext *avctx)
return 0;
}
+#define OFFSET(x) offsetof(AC3DecodeContext, x)
+#define PAR (AV_OPT_FLAG_DECODING_PARAM | AV_OPT_FLAG_AUDIO_PARAM)
+static const AVOption options[] = {
+ { "drc_scale", "percentage of dynamic range compression to apply", OFFSET(drc_scale), FF_OPT_TYPE_FLOAT, {1.0}, 0.0, 1.0, PAR },
+ { NULL},
+};
+
+static const AVClass ac3_decoder_class = {
+ .class_name = "(E-)AC3 decoder",
+ .item_name = av_default_item_name,
+ .option = options,
+ .version = LIBAVUTIL_VERSION_INT,
+};
+
AVCodec ff_ac3_decoder = {
.name = "ac3",
.type = AVMEDIA_TYPE_AUDIO,
@@ -1452,6 +1467,7 @@ AVCodec ff_ac3_decoder = {
.sample_fmts = (const enum AVSampleFormat[]) {
AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE
},
+ .priv_class = &ac3_decoder_class,
};
#if CONFIG_EAC3_DECODER
@@ -1467,5 +1483,6 @@ AVCodec ff_eac3_decoder = {
.sample_fmts = (const enum AVSampleFormat[]) {
AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE
},
+ .priv_class = &ac3_decoder_class,
};
#endif