aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-09-25 23:38:26 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-09-26 12:29:59 +0200
commitaff855148a098c70c0a55c58aeb1205d839ed516 (patch)
tree10c99b1033f7bbbabc23a328de8d675759f83b98
parent7b5df3b545a3829459b9980d632f3002a28948b6 (diff)
downloadffmpeg-aff855148a098c70c0a55c58aeb1205d839ed516.tar.gz
avfilter/vf_swaprect: Use ff_formats_pixdesc_filter()
Reviewed-by: Nicolas George <george@nsup.org> Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
-rw-r--r--libavfilter/vf_swaprect.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/libavfilter/vf_swaprect.c b/libavfilter/vf_swaprect.c
index 4a5f4a12a6..fff9b53dc4 100644
--- a/libavfilter/vf_swaprect.c
+++ b/libavfilter/vf_swaprect.c
@@ -22,7 +22,6 @@
#include "libavutil/eval.h"
#include "libavutil/imgutils.h"
#include "libavutil/opt.h"
-#include "libavutil/pixdesc.h"
#include "avfilter.h"
#include "formats.h"
@@ -59,16 +58,13 @@ AVFILTER_DEFINE_CLASS(swaprect);
static int query_formats(AVFilterContext *ctx)
{
AVFilterFormats *pix_fmts = NULL;
- int fmt, ret;
-
- for (fmt = 0; av_pix_fmt_desc_get(fmt); fmt++) {
- const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(fmt);
- if (!(desc->flags & AV_PIX_FMT_FLAG_PAL ||
- desc->flags & AV_PIX_FMT_FLAG_HWACCEL ||
- desc->flags & AV_PIX_FMT_FLAG_BITSTREAM) &&
- (ret = ff_add_format(&pix_fmts, fmt)) < 0)
- return ret;
- }
+ int ret;
+
+ ret = ff_formats_pixdesc_filter(&pix_fmts, 0, AV_PIX_FMT_FLAG_PAL |
+ AV_PIX_FMT_FLAG_HWACCEL |
+ AV_PIX_FMT_FLAG_BITSTREAM);
+ if (ret < 0)
+ return ret;
return ff_set_common_formats(ctx, pix_fmts);
}