diff options
author | Stefano Sabatini <stefasab@gmail.com> | 2013-02-23 00:17:17 +0100 |
---|---|---|
committer | Stefano Sabatini <stefasab@gmail.com> | 2013-12-25 18:25:04 +0100 |
commit | 7619a87cc8b9a1ac6ea6cf03b674f5a74b1ac90c (patch) | |
tree | 5af33f57d98b0678f5e8706651684662d46ed33c /libavfilter/af_volume.h | |
parent | 239a0543a66b6b4a67ec5b96081cfa2ec5776da6 (diff) | |
download | ffmpeg-7619a87cc8b9a1ac6ea6cf03b674f5a74b1ac90c.tar.gz |
lavfi/volume: support volume expression and per-frame expression evaluation
The eval mode allows to evaluate the expression per-frame or just at
init.
In particular, address ticket #3234.
Diffstat (limited to 'libavfilter/af_volume.h')
-rw-r--r-- | libavfilter/af_volume.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/libavfilter/af_volume.h b/libavfilter/af_volume.h index bd7932e4d4..10ef6fbda3 100644 --- a/libavfilter/af_volume.h +++ b/libavfilter/af_volume.h @@ -25,6 +25,7 @@ #define AVFILTER_AF_VOLUME_H #include "libavutil/common.h" +#include "libavutil/eval.h" #include "libavutil/float_dsp.h" #include "libavutil/opt.h" #include "libavutil/samplefmt.h" @@ -35,10 +36,37 @@ enum PrecisionType { PRECISION_DOUBLE, }; +enum EvalMode { + EVAL_MODE_ONCE, + EVAL_MODE_FRAME, + EVAL_MODE_NB +}; + +enum VolumeVarName { + VAR_N, + VAR_NB_CHANNELS, + VAR_NB_CONSUMED_SAMPLES, + VAR_NB_SAMPLES, + VAR_POS, + VAR_PTS, + VAR_SAMPLE_RATE, + VAR_STARTPTS, + VAR_STARTT, + VAR_T, + VAR_TB, + VAR_VOLUME, + VAR_VARS_NB +}; + typedef struct VolumeContext { const AVClass *class; AVFloatDSPContext fdsp; enum PrecisionType precision; + enum EvalMode eval_mode; + const char *volume_expr; + AVExpr *volume_pexpr; + double var_values[VAR_VARS_NB]; + double volume; int volume_i; int channels; |