76 static double val(
void *priv,
double ch)
85 #define OFFSET(x) offsetof(EvalContext, x)
86 #define FLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
90 {
"nb_samples",
"set the number of samples per requested frame",
OFFSET(nb_samples),
AV_OPT_TYPE_INT, {.i64 = 1024}, 0, INT_MAX,
FLAGS },
91 {
"n",
"set the number of samples per requested frame",
OFFSET(nb_samples),
AV_OPT_TYPE_INT, {.i64 = 1024}, 0, INT_MAX,
FLAGS },
104 int expected_nb_channels)
108 char *expr, *last_expr, *
buf;
109 double (*
const *
func1)(
void *, double) = NULL;
126 #define ADD_EXPRESSION(expr_) do { \
127 if (!av_dynarray2_add((void **)&eval->expr, &eval->nb_channels, \
128 sizeof(*eval->expr), NULL)) { \
129 ret = AVERROR(ENOMEM); \
132 eval->expr[eval->nb_channels-1] = NULL; \
133 ret = av_expr_parse(&eval->expr[eval->nb_channels - 1], expr_, \
134 var_names, func1_names, func1, \
135 NULL, NULL, 0, ctx); \
143 eval->
expr[i] = NULL;
149 while (expr =
av_strtok(buf,
"|", &buf)) {
155 for (i = eval->
nb_channels; i < expected_nb_channels; i++)
158 if (expected_nb_channels > 0 && eval->
nb_channels != expected_nb_channels) {
160 "Mismatch between the specified number of channel expressions '%d' "
161 "and the number of expected output channels '%d' for the specified channel layout\n",
217 eval->
expr[i] = NULL;
237 "sample_rate:%d chlayout:%s duration:%"PRId64
"\n",
272 for (i = 0; i < eval->
nb_samples; i++, eval->
n++) {
282 samplesref->
pts = eval->
pts;
289 #if CONFIG_AEVALSRC_FILTER
309 .priv_class = &aevalsrc_class,
314 #define OFFSET(x) offsetof(EvalContext, x)
315 #define FLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
396 #define TS2T(ts, tb) ((ts) == AV_NOPTS_VALUE ? NAN : (double)(ts)*av_q2d(tb))
416 for (i = 0; i < nb_samples; i++, eval->
n++) {
423 for (j = 0; j < outlink->
channels; j++) {
434 #if CONFIG_AEVAL_FILTER
456 .description =
NULL_IF_CONFIG_SMALL(
"Filter audio signal according to a specified expression."),
463 .priv_class = &aeval_class,