diff options
author | Nicolas George <nicolas.george@normalesup.org> | 2013-03-16 21:03:31 +0100 |
---|---|---|
committer | Nicolas George <nicolas.george@normalesup.org> | 2013-03-20 21:13:56 +0100 |
commit | 6202cf5dd8095abbdf1930faf09900edecafcda4 (patch) | |
tree | 52b6b4063bfd92ff517652a536dbbcbf7be6844c /libavfilter/vf_crop.c | |
parent | e9ca55aeddc41ee692431492572dc862ad3a7db7 (diff) | |
download | ffmpeg-6202cf5dd8095abbdf1930faf09900edecafcda4.tar.gz |
lavfi/vf_crop: use standard options parsing.
Diffstat (limited to 'libavfilter/vf_crop.c')
-rw-r--r-- | libavfilter/vf_crop.c | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/libavfilter/vf_crop.c b/libavfilter/vf_crop.c index 17487a29cc..f99d1a7ce9 100644 --- a/libavfilter/vf_crop.c +++ b/libavfilter/vf_crop.c @@ -107,24 +107,12 @@ static const AVOption crop_options[] = { AVFILTER_DEFINE_CLASS(crop); -static av_cold int init(AVFilterContext *ctx, const char *args) -{ - CropContext *crop = ctx->priv; - static const char *shorthand[] = { "w", "h", "x", "y", "keep_aspect", NULL }; - - crop->class = &crop_class; - av_opt_set_defaults(crop); - - return av_opt_set_from_string(crop, args, shorthand, "=", ":"); -} - static av_cold void uninit(AVFilterContext *ctx) { CropContext *crop = ctx->priv; av_expr_free(crop->x_pexpr); crop->x_pexpr = NULL; av_expr_free(crop->y_pexpr); crop->y_pexpr = NULL; - av_opt_free(crop); } static int query_formats(AVFilterContext *ctx) @@ -348,6 +336,8 @@ static const AVFilterPad avfilter_vf_crop_outputs[] = { { NULL } }; +static const char *const shorthand[] = { "w", "h", "x", "y", "keep_aspect", NULL }; + AVFilter avfilter_vf_crop = { .name = "crop", .description = NULL_IF_CONFIG_SMALL("Crop the input video to width:height:x:y."), @@ -355,10 +345,10 @@ AVFilter avfilter_vf_crop = { .priv_size = sizeof(CropContext), .query_formats = query_formats, - .init = init, .uninit = uninit, .inputs = avfilter_vf_crop_inputs, .outputs = avfilter_vf_crop_outputs, .priv_class = &crop_class, + .shorthand = shorthand, }; |