1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-23 07:12:39 +00:00
mpv/test/scale_test.h
Dudemanguy 9db818279a test: integrate unittests with meson
This reworks all of mpv's unit tests so they are compiled as separate
executables (optional) and run via meson test. Because most of the tests
are dependant on mpv's internals, existing compiled objects are
leveraged to create static libs and used when necessary. As an aside, a
function was moved into video/out/gpu/utils for sanity's sake (otherwise
most of vo would have been needed). As a plus, meson multithreads
running tests automatically and also the output no longer pollutes the
source directory. There are tests that can break due to ffmpeg changes,
so they require a specific minimum libavutil version to be built.
2023-03-02 15:45:27 +00:00

31 lines
782 B
C

#pragma once
#include "img_utils.h"
#include "test_utils.h"
#include "video/mp_image.h"
struct scale_test_fns {
bool (*scale)(void *ctx, struct mp_image *dst, struct mp_image *src);
bool (*supports_fmts)(void *ctx, int imgfmt_dst, int imgfmt_src);
};
struct scale_test {
// To be filled in by user.
const struct scale_test_fns *fns;
void *fns_priv;
const char *test_name;
const char *refdir;
const char *outdir;
// Private.
struct mp_image *img_repack_rgb8;
struct mp_image *img_repack_rgba8;
struct mp_image *img_repack_rgb16;
struct mp_image *img_repack_rgba16;
struct mp_sws_context *sws;
int fail;
};
// Test color repacking between packed formats (typically RGB).
void repack_test_run(struct scale_test *stest);