diff mbox series

[FFmpeg-devel,059/218] avfilter/vf_codecview: Store format in filter, remove query function

Message ID PR3PR03MB6665E6123DA27CB3FE06F4FC8FAA9@PR3PR03MB6665.eurprd03.prod.outlook.com
State Accepted
Commit be26348153b8e60df1e04f97bca5ee174cb0a744
Headers show
Series [FFmpeg-devel,001/218] avfilter/f_reverse: Don't use redundant query_formats function | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
andriy/make_ppc success Make finished
andriy/make_fate_ppc success Make fate finished

Commit Message

Andreas Rheinhardt Sept. 30, 2021, 1:40 p.m. UTC
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavfilter/vf_codecview.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)
diff mbox series

Patch

diff --git a/libavfilter/vf_codecview.c b/libavfilter/vf_codecview.c
index 4226bab8d8..ae8c104d27 100644
--- a/libavfilter/vf_codecview.c
+++ b/libavfilter/vf_codecview.c
@@ -78,14 +78,6 @@  static const AVOption codecview_options[] = {
 
 AVFILTER_DEFINE_CLASS(codecview);
 
-static int query_formats(AVFilterContext *ctx)
-{
-    // TODO: we can probably add way more pixel formats without any other
-    // changes; anything with 8-bit luma in first plane should be working
-    static const enum AVPixelFormat pix_fmts[] = {AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE};
-    return ff_set_common_formats_from_list(ctx, pix_fmts);
-}
-
 static int clip_line(int *sx, int *sy, int *ex, int *ey, int maxx)
 {
     if(*sx > *ex)
@@ -319,7 +311,9 @@  const AVFilter ff_vf_codecview = {
     .priv_size     = sizeof(CodecViewContext),
     FILTER_INPUTS(codecview_inputs),
     FILTER_OUTPUTS(codecview_outputs),
-    FILTER_QUERY_FUNC(query_formats),
+    // TODO: we can probably add way more pixel formats without any other
+    // changes; anything with 8-bit luma in first plane should be working
+    FILTER_SINGLE_PIXFMT(AV_PIX_FMT_YUV420P),
     .priv_class    = &codecview_class,
     .flags         = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC,
 };