summaryrefslogtreecommitdiffstats
path: root/libavfilter
diff options
context:
space:
mode:
authorStefano Sabatini <stefano.sabatini-lala@poste.it>2010-11-08 14:06:49 +0000
committerStefano Sabatini <stefano.sabatini-lala@poste.it>2010-11-08 14:06:49 +0000
commitd2af7205a12afde34c916ef96ba8c7a26aa0813e (patch)
treef66721788b2a9ad55d83c74cc075761bf9a5eaea /libavfilter
parent24de0edbd589b7cb0da51260073a1a28bb6a2619 (diff)
downloadffmpeg-streaming-d2af7205a12afde34c916ef96ba8c7a26aa0813e.zip
ffmpeg-streaming-d2af7205a12afde34c916ef96ba8c7a26aa0813e.tar.gz
Use hierarchic names convention (prefix them with av_expr) for the
eval API. More grep-friendly and more consistent with the rest of the FFmpeg API. Originally committed as revision 25708 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavfilter')
-rw-r--r--libavfilter/vf_crop.c20
-rw-r--r--libavfilter/vf_setpts.c6
-rw-r--r--libavfilter/vf_settb.c2
-rw-r--r--libavfilter/vsrc_nullsrc.c2
4 files changed, 15 insertions, 15 deletions
diff --git a/libavfilter/vf_crop.c b/libavfilter/vf_crop.c
index 1a92082..4e793c9 100644
--- a/libavfilter/vf_crop.c
+++ b/libavfilter/vf_crop.c
@@ -125,8 +125,8 @@ static av_cold void uninit(AVFilterContext *ctx)
{
CropContext *crop = ctx->priv;
- av_free_expr(crop->x_pexpr); crop->x_pexpr = NULL;
- av_free_expr(crop->y_pexpr); crop->y_pexpr = NULL;
+ av_expr_free(crop->x_pexpr); crop->x_pexpr = NULL;
+ av_expr_free(crop->y_pexpr); crop->y_pexpr = NULL;
}
static inline int normalize_double(int *n, double d)
@@ -170,16 +170,16 @@ static int config_input(AVFilterLink *link)
crop->hsub = av_pix_fmt_descriptors[link->format].log2_chroma_w;
crop->vsub = av_pix_fmt_descriptors[link->format].log2_chroma_h;
- if ((ret = av_parse_and_eval_expr(&res, (expr = crop->ow_expr),
+ if ((ret = av_expr_parse_and_eval(&res, (expr = crop->ow_expr),
var_names, crop->var_values,
NULL, NULL, NULL, NULL, NULL, 0, ctx)) < 0) goto fail_expr;
crop->var_values[VAR_OUT_W] = crop->var_values[VAR_OW] = res;
- if ((ret = av_parse_and_eval_expr(&res, (expr = crop->oh_expr),
+ if ((ret = av_expr_parse_and_eval(&res, (expr = crop->oh_expr),
var_names, crop->var_values,
NULL, NULL, NULL, NULL, NULL, 0, ctx)) < 0) goto fail_expr;
crop->var_values[VAR_OUT_H] = crop->var_values[VAR_OH] = res;
/* evaluate again ow as it may depend on oh */
- if ((ret = av_parse_and_eval_expr(&res, (expr = crop->ow_expr),
+ if ((ret = av_expr_parse_and_eval(&res, (expr = crop->ow_expr),
var_names, crop->var_values,
NULL, NULL, NULL, NULL, NULL, 0, ctx)) < 0) goto fail_expr;
crop->var_values[VAR_OUT_W] = crop->var_values[VAR_OW] = res;
@@ -194,9 +194,9 @@ static int config_input(AVFilterLink *link)
crop->w &= ~((1 << crop->hsub) - 1);
crop->h &= ~((1 << crop->vsub) - 1);
- if ((ret = av_parse_expr(&crop->x_pexpr, crop->x_expr, var_names,
+ if ((ret = av_expr_parse(&crop->x_pexpr, crop->x_expr, var_names,
NULL, NULL, NULL, NULL, 0, ctx)) < 0 ||
- (ret = av_parse_expr(&crop->y_pexpr, crop->y_expr, var_names,
+ (ret = av_expr_parse(&crop->y_pexpr, crop->y_expr, var_names,
NULL, NULL, NULL, NULL, 0, ctx)) < 0)
return AVERROR(EINVAL);
@@ -243,9 +243,9 @@ static void start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
crop->var_values[VAR_T] = picref->pts == AV_NOPTS_VALUE ?
NAN : picref->pts * av_q2d(link->time_base);
crop->var_values[VAR_POS] = picref->pos == -1 ? NAN : picref->pos;
- crop->var_values[VAR_X] = av_eval_expr(crop->x_pexpr, crop->var_values, NULL);
- crop->var_values[VAR_Y] = av_eval_expr(crop->y_pexpr, crop->var_values, NULL);
- crop->var_values[VAR_X] = av_eval_expr(crop->x_pexpr, crop->var_values, NULL);
+ crop->var_values[VAR_X] = av_expr_eval(crop->x_pexpr, crop->var_values, NULL);
+ crop->var_values[VAR_Y] = av_expr_eval(crop->y_pexpr, crop->var_values, NULL);
+ crop->var_values[VAR_X] = av_expr_eval(crop->x_pexpr, crop->var_values, NULL);
normalize_double(&crop->x, crop->var_values[VAR_X]);
normalize_double(&crop->y, crop->var_values[VAR_Y]);
diff --git a/libavfilter/vf_setpts.c b/libavfilter/vf_setpts.c
index 8ce7d6a..0921df7 100644
--- a/libavfilter/vf_setpts.c
+++ b/libavfilter/vf_setpts.c
@@ -69,7 +69,7 @@ static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque)
SetPTSContext *setpts = ctx->priv;
int ret;
- if ((ret = av_parse_expr(&setpts->expr, args ? args : "PTS",
+ if ((ret = av_expr_parse(&setpts->expr, args ? args : "PTS",
var_names, NULL, NULL, NULL, NULL, 0, ctx)) < 0) {
av_log(ctx, AV_LOG_ERROR, "Error while parsing expression '%s'\n", args);
return ret;
@@ -111,7 +111,7 @@ static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *inpicref)
setpts->var_values[VAR_PTS ] = TS2D(inpicref->pts);
setpts->var_values[VAR_POS ] = inpicref->pos == -1 ? NAN : inpicref->pos;
- d = av_eval_expr(setpts->expr, setpts->var_values, NULL);
+ d = av_expr_eval(setpts->expr, setpts->var_values, NULL);
outpicref->pts = D2TS(d);
#ifdef DEBUG
@@ -133,7 +133,7 @@ static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *inpicref)
static av_cold void uninit(AVFilterContext *ctx)
{
SetPTSContext *setpts = ctx->priv;
- av_free_expr(setpts->expr);
+ av_expr_free(setpts->expr);
setpts->expr = NULL;
}
diff --git a/libavfilter/vf_settb.c b/libavfilter/vf_settb.c
index 1a8724b..b5b40bb 100644
--- a/libavfilter/vf_settb.c
+++ b/libavfilter/vf_settb.c
@@ -81,7 +81,7 @@ static int config_output_props(AVFilterLink *outlink)
outlink->w = inlink->w;
outlink->h = inlink->h;
- if ((ret = av_parse_and_eval_expr(&res, settb->tb_expr, var_names, settb->var_values,
+ if ((ret = av_expr_parse_and_eval(&res, settb->tb_expr, var_names, settb->var_values,
NULL, NULL, NULL, NULL, NULL, 0, NULL)) < 0) {
av_log(ctx, AV_LOG_ERROR, "Invalid expression '%s' for timebase.\n", settb->tb_expr);
return ret;
diff --git a/libavfilter/vsrc_nullsrc.c b/libavfilter/vsrc_nullsrc.c
index d93517d..1cd06e1 100644
--- a/libavfilter/vsrc_nullsrc.c
+++ b/libavfilter/vsrc_nullsrc.c
@@ -80,7 +80,7 @@ static int config_props(AVFilterLink *outlink)
priv->var_values[VAR_PI] = M_PI;
priv->var_values[VAR_AVTB] = av_q2d(AV_TIME_BASE_Q);
- if ((ret = av_parse_and_eval_expr(&res, priv->tb_expr, var_names, priv->var_values,
+ if ((ret = av_expr_parse_and_eval(&res, priv->tb_expr, var_names, priv->var_values,
NULL, NULL, NULL, NULL, NULL, 0, NULL)) < 0) {
av_log(ctx, AV_LOG_ERROR, "Invalid expression '%s' for timebase.\n", priv->tb_expr);
return ret;
OpenPOWER on IntegriCloud