From 56cac2be465d1ca5798ab55eed448393f07ad548 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 13 Apr 2020 15:57:05 +0200 Subject: test: add list of zimg/sws conversions Generic statement about how this is not really appropriate, etc., and only useful for temporary debugging things, and how I commit it anyway despite violating my own principles (and how I'd reject this change if it came from you). --- test/scale_zimg.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'test/scale_zimg.c') diff --git a/test/scale_zimg.c b/test/scale_zimg.c index d5a352a8eb..e4ab1caa05 100644 --- a/test/scale_zimg.c +++ b/test/scale_zimg.c @@ -1,4 +1,7 @@ +#include + #include "scale_test.h" +#include "video/fmt-conversion.h" #include "video/zimg.h" static bool scale(void *pctx, struct mp_image *dst, struct mp_image *src) @@ -32,6 +35,22 @@ static void run(struct test_ctx *ctx) talloc_free(stest); talloc_free(zimg); + + FILE *f = test_open_out(ctx, "zimg_formats.txt"); + init_imgfmts_list(); + for (int n = 0; n < num_imgfmts; n++) { + int imgfmt = imgfmts[n]; + fprintf(f, "%15s%7s%7s%7s%8s |\n", mp_imgfmt_to_name(imgfmt), + mp_zimg_supports_in_format(imgfmt) ? " Zin" : "", + mp_zimg_supports_out_format(imgfmt) ? " Zout" : "", + sws_isSupportedInput(imgfmt2pixfmt(imgfmt)) ? " SWSin" : "", + sws_isSupportedOutput(imgfmt2pixfmt(imgfmt)) ? " SWSout" : ""); + + } + fclose(f); + + assert_text_files_equal(stest->ctx, "zimg_formats.txt", "zimg_formats.txt", + "This can fail if FFmpeg/libswscale adds or removes pixfmts."); } const struct unittest test_repack_zimg = { -- cgit v1.2.3