From: Anton Khirnov <anton@khirnov.net>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Subject: Re: [FFmpeg-devel] [PATCH 5/5] fftools/ffmpeg: add special syntax for loading filter options from files
Date: Mon, 23 Jan 2023 12:34:32 +0100
Message-ID: <167447367219.4503.1890244457637866011@lain.khirnov.net> (raw)
In-Reply-To: <20230120193132.21597-5-anton@khirnov.net>
Quoting Anton Khirnov (2023-01-20 20:31:32)
> +static int filter_opt_apply(AVFilterContext *f, const char *key, const char *val)
> +{
> + const AVOption *o;
> + int ret;
> +
> + ret = av_opt_set(f, key, val, AV_OPT_SEARCH_CHILDREN);
> + if (ret >= 0)
> + return 0;
> +
> + if (ret == AVERROR_OPTION_NOT_FOUND && key[0] == '/')
> + o = av_opt_find(f, key + 1, NULL, 0, AV_OPT_SEARCH_CHILDREN);
> + if (!o)
> + goto err_apply;
> +
> + // key is a valid option name prefixed with '/'
> + // interpret value as a path from which to load the actual option value
> + key++;
> +
> + if (o->type == AV_OPT_TYPE_BINARY) {
> + uint8_t *data;
> + int len;
> +
> + ret = read_binary(val, &data, &len);
> + if (ret < 0)
> + goto err_load;
> +
> + ret = av_opt_set_bin(f, key, data, len, AV_OPT_SEARCH_CHILDREN);
> + av_freep(&data);
> + } else {
> + char *data = file_read(val);
> + if (!val) {
should be s/val/data/
fixed locally
--
Anton Khirnov
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
next prev parent reply other threads:[~2023-01-23 11:34 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-20 19:31 [FFmpeg-devel] [PATCH 1/5] lavfi/avfilter: export process_options() Anton Khirnov
2023-01-20 19:31 ` [FFmpeg-devel] [PATCH 2/5] lavfi/avfilter: track whether a filter has been initialized Anton Khirnov
2023-01-20 19:31 ` [FFmpeg-devel] [PATCH 3/5] lavfi: add a new filtergraph parsing API Anton Khirnov
2023-01-30 12:59 ` Nicolas George
2023-02-01 7:02 ` Anton Khirnov
2023-02-03 9:14 ` [FFmpeg-devel] [PATCH] " Anton Khirnov
2023-02-10 9:49 ` Anton Khirnov
2023-01-20 19:31 ` [FFmpeg-devel] [PATCH 4/5] lavfi/graphparser: reimplement avfilter_graph_parse* using new API Anton Khirnov
2023-01-20 20:47 ` Nicolas George
2023-01-20 21:11 ` Jean-Baptiste Kempf
2023-01-20 21:32 ` Nicolas George
2023-01-20 21:39 ` Nicolas George
2023-01-23 12:29 ` James Almer
2023-01-30 13:04 ` Nicolas George
2023-01-24 21:51 ` Paul B Mahol
2023-01-20 22:36 ` Anton Khirnov
2023-05-30 21:09 ` Marton Balint
2023-05-31 14:39 ` Paul B Mahol
2023-06-03 10:02 ` Anton Khirnov
2023-01-20 19:31 ` [FFmpeg-devel] [PATCH 5/5] fftools/ffmpeg: add special syntax for loading filter options from files Anton Khirnov
2023-01-23 11:34 ` Anton Khirnov [this message]
2023-01-27 16:47 ` [FFmpeg-devel] [PATCH 1/5] lavfi/avfilter: export process_options() Anton Khirnov
2023-01-27 16:48 ` Nicolas George
2023-01-27 16:51 ` Anton Khirnov
2023-01-27 16:53 ` Nicolas George
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=167447367219.4503.1890244457637866011@lain.khirnov.net \
--to=anton@khirnov.net \
--cc=ffmpeg-devel@ffmpeg.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git