summaryrefslogtreecommitdiffstats
path: root/libavfilter/vf_aspect.c
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2017-10-21 15:27:03 -0300
committerJames Almer <jamrial@gmail.com>2017-10-21 15:27:03 -0300
commit0ed61546c4594480b7c09a0c79da24d78968fbf0 (patch)
tree60791ccb8343a46db69efe6e89d53c66dfadd06b /libavfilter/vf_aspect.c
parentea049ad862a4b2b398bbdade5af36291d786e02d (diff)
parent88fd836a015a5f3380df74592e440e7d1e5b8000 (diff)
downloadffmpeg-streaming-0ed61546c4594480b7c09a0c79da24d78968fbf0.zip
ffmpeg-streaming-0ed61546c4594480b7c09a0c79da24d78968fbf0.tar.gz
Merge commit '88fd836a015a5f3380df74592e440e7d1e5b8000'
* commit '88fd836a015a5f3380df74592e440e7d1e5b8000': lavfi: Drop deprecated way of passing options for a few filters Merged-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavfilter/vf_aspect.c')
-rw-r--r--libavfilter/vf_aspect.c46
1 files changed, 0 insertions, 46 deletions
diff --git a/libavfilter/vf_aspect.c b/libavfilter/vf_aspect.c
index bf30824..4c93639 100644
--- a/libavfilter/vf_aspect.c
+++ b/libavfilter/vf_aspect.c
@@ -61,35 +61,9 @@ typedef struct AspectContext {
AVRational dar;
AVRational sar;
int max;
-#if FF_API_OLD_FILTER_OPTS
- float aspect_den;
-#endif
char *ratio_expr;
} AspectContext;
-static av_cold int init(AVFilterContext *ctx)
-{
-#if FF_API_OLD_FILTER_OPTS
- AspectContext *s = ctx->priv;
- int ret;
-
- if (s->ratio_expr && s->aspect_den > 0) {
- double num;
- av_log(ctx, AV_LOG_WARNING,
- "num:den syntax is deprecated, please use num/den or named options instead\n");
- ret = av_expr_parse_and_eval(&num, s->ratio_expr, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, 0, ctx);
- if (ret < 0) {
- av_log(ctx, AV_LOG_ERROR, "Unable to parse ratio numerator \"%s\"\n", s->ratio_expr);
- return AVERROR(EINVAL);
- }
- s->sar = s->dar = av_d2q(num / s->aspect_den, s->max);
- }
-#endif
-
- return 0;
-}
-
static int filter_frame(AVFilterLink *link, AVFrame *frame)
{
AspectContext *s = link->dst->priv;
@@ -159,14 +133,8 @@ static int setdar_config_props(AVFilterLink *inlink)
AVRational old_sar = inlink->sample_aspect_ratio;
int ret;
-#if FF_API_OLD_FILTER_OPTS
- if (!(s->ratio_expr && s->aspect_den > 0)) {
-#endif
if ((ret = get_aspect_ratio(inlink, &s->dar)))
return ret;
-#if FF_API_OLD_FILTER_OPTS
- }
-#endif
if (s->dar.num && s->dar.den) {
av_reduce(&s->sar.num, &s->sar.den,
@@ -191,9 +159,6 @@ static const AVOption setdar_options[] = {
{ "dar", "set display aspect ratio", OFFSET(ratio_expr), AV_OPT_TYPE_STRING, { .str = "0" }, .flags = FLAGS },
{ "ratio", "set display aspect ratio", OFFSET(ratio_expr), AV_OPT_TYPE_STRING, { .str = "0" }, .flags = FLAGS },
{ "r", "set display aspect ratio", OFFSET(ratio_expr), AV_OPT_TYPE_STRING, { .str = "0" }, .flags = FLAGS },
-#if FF_API_OLD_FILTER_OPTS
- { "dar_den", NULL, OFFSET(aspect_den), AV_OPT_TYPE_FLOAT, { .dbl = 0 }, 0, FLT_MAX, FLAGS },
-#endif
{ "max", "set max value for nominator or denominator in the ratio", OFFSET(max), AV_OPT_TYPE_INT, {.i64=100}, 1, INT_MAX, FLAGS },
{ NULL }
};
@@ -221,7 +186,6 @@ static const AVFilterPad avfilter_vf_setdar_outputs[] = {
AVFilter ff_vf_setdar = {
.name = "setdar",
.description = NULL_IF_CONFIG_SMALL("Set the frame display aspect ratio."),
- .init = init,
.priv_size = sizeof(AspectContext),
.priv_class = &setdar_class,
.inputs = avfilter_vf_setdar_inputs,
@@ -239,14 +203,8 @@ static int setsar_config_props(AVFilterLink *inlink)
AVRational old_dar, dar;
int ret;
-#if FF_API_OLD_FILTER_OPTS
- if (!(s->ratio_expr && s->aspect_den > 0)) {
-#endif
if ((ret = get_aspect_ratio(inlink, &s->sar)))
return ret;
-#if FF_API_OLD_FILTER_OPTS
- }
-#endif
inlink->sample_aspect_ratio = s->sar;
@@ -263,9 +221,6 @@ static const AVOption setsar_options[] = {
{ "sar", "set sample (pixel) aspect ratio", OFFSET(ratio_expr), AV_OPT_TYPE_STRING, { .str = "0" }, .flags = FLAGS },
{ "ratio", "set sample (pixel) aspect ratio", OFFSET(ratio_expr), AV_OPT_TYPE_STRING, { .str = "0" }, .flags = FLAGS },
{ "r", "set sample (pixel) aspect ratio", OFFSET(ratio_expr), AV_OPT_TYPE_STRING, { .str = "0" }, .flags = FLAGS },
-#if FF_API_OLD_FILTER_OPTS
- { "sar_den", NULL, OFFSET(aspect_den), AV_OPT_TYPE_FLOAT, { .dbl = 0 }, 0, FLT_MAX, FLAGS },
-#endif
{ "max", "set max value for nominator or denominator in the ratio", OFFSET(max), AV_OPT_TYPE_INT, {.i64=100}, 1, INT_MAX, FLAGS },
{ NULL }
};
@@ -293,7 +248,6 @@ static const AVFilterPad avfilter_vf_setsar_outputs[] = {
AVFilter ff_vf_setsar = {
.name = "setsar",
.description = NULL_IF_CONFIG_SMALL("Set the pixel sample aspect ratio."),
- .init = init,
.priv_size = sizeof(AspectContext),
.priv_class = &setsar_class,
.inputs = avfilter_vf_setsar_inputs,
OpenPOWER on IntegriCloud