summaryrefslogtreecommitdiff
path: root/libavfilter/vf_crop.c
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/vf_crop.c
parent24de0edbd589b7cb0da51260073a1a28bb6a2619 (diff)
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/vf_crop.c')
-rw-r--r--libavfilter/vf_crop.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/libavfilter/vf_crop.c b/libavfilter/vf_crop.c
index 1a92082396..4e793c9a32 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]);