mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-06 15:49:50 +08:00
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:
@ -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;
|
||||
|
Reference in New Issue
Block a user