lavfi: move ff_parse_pixel_format() to vf_format, its only caller

The only thing this function does beyond calling av_get_pix_fmt() is
falling back onto parsing the argument as a number. No other filters
should need to do this.
This commit is contained in:
Anton Khirnov
2024-08-15 22:00:50 +02:00
parent 1afe42852b
commit f4bfdf7893
3 changed files with 16 additions and 27 deletions

View File

@ -939,21 +939,6 @@ int ff_default_query_formats(AVFilterContext *ctx)
/* internal functions for parsing audio format arguments */
int ff_parse_pixel_format(enum AVPixelFormat *ret, const char *arg, void *log_ctx)
{
char *tail;
int pix_fmt = av_get_pix_fmt(arg);
if (pix_fmt == AV_PIX_FMT_NONE) {
pix_fmt = strtol(arg, &tail, 0);
if (*tail || !av_pix_fmt_desc_get(pix_fmt)) {
av_log(log_ctx, AV_LOG_ERROR, "Invalid pixel format '%s'\n", arg);
return AVERROR(EINVAL);
}
}
*ret = pix_fmt;
return 0;
}
int ff_parse_sample_rate(int *ret, const char *arg, void *log_ctx)
{
char *tail;