summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-09-27 21:19:24 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-10-05 18:58:26 +0200
commit7abe0a396cb4672435b409c205c08f8d90ac3f2a (patch)
tree091a2bd49696f0b7cf86531297d02dee17af1d29
parentbdfdb255f1e20b494e0dde467dfe6ea86f497144 (diff)
avfilter/vf_normalize: Use formats list instead of query function
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
-rw-r--r--libavfilter/vf_normalize.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/libavfilter/vf_normalize.c b/libavfilter/vf_normalize.c
index e185cd998c..55cb76ef2d 100644
--- a/libavfilter/vf_normalize.c
+++ b/libavfilter/vf_normalize.c
@@ -386,10 +386,8 @@ static void normalize(NormalizeContext *s, AVFrame *in, AVFrame *out)
// doc/writing_filters.txt for descriptions of what these interface functions
// are expected to do.
-// Set the pixel formats that our filter supports. We should be able to process
+// The pixel formats that our filter supports. We should be able to process
// any 8-bit RGB formats. 16-bit support might be useful one day.
-static int query_formats(AVFilterContext *ctx)
-{
static const enum AVPixelFormat pixel_fmts[] = {
AV_PIX_FMT_RGB24,
AV_PIX_FMT_BGR24,
@@ -408,11 +406,6 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_GBRAP, AV_PIX_FMT_GBRAP10, AV_PIX_FMT_GBRAP12, AV_PIX_FMT_GBRAP16,
AV_PIX_FMT_NONE
};
- // According to filter_design.txt, using ff_set_common_formats() this way
- // ensures the pixel formats of the input and output will be the same. That
- // saves a bit of effort possibly needing to handle format conversions.
- return ff_set_common_formats_from_list(ctx, pixel_fmts);
-}
// At this point we know the pixel format used for both input and output. We
// can also access the frame rate of the input video and allocate some memory
@@ -533,7 +526,7 @@ const AVFilter ff_vf_normalize = {
.uninit = uninit,
FILTER_INPUTS(inputs),
FILTER_OUTPUTS(outputs),
- FILTER_QUERY_FUNC(query_formats),
+ FILTER_PIXFMTS_ARRAY(pixel_fmts),
.flags = AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL,
.process_command = ff_filter_process_command,
};