Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefano Sabatini <stefasab@gmail.com>2013-02-23 03:17:17 +0400
committerStefano Sabatini <stefasab@gmail.com>2013-12-25 21:25:04 +0400
commit7619a87cc8b9a1ac6ea6cf03b674f5a74b1ac90c (patch)
tree5af33f57d98b0678f5e8706651684662d46ed33c /libavfilter/af_volume.h
parent239a0543a66b6b4a67ec5b96081cfa2ec5776da6 (diff)
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.h28
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;