summaryrefslogtreecommitdiffstats
path: root/sub/draw_bmp.c
diff options
context:
space:
mode:
authorDudemanguy <random342@airmail.cc>2023-02-25 21:50:08 -0600
committerDudemanguy <random342@airmail.cc>2023-03-02 15:45:27 +0000
commit9db818279aa63d071f2bca369235285314444dcd (patch)
tree9aafc5cf73e19ae8ea69751c060cab9766a6b9a4 /sub/draw_bmp.c
parent61532421571f972f076b3700d7ae468c0a0438c0 (diff)
downloadmpv-9db818279aa63d071f2bca369235285314444dcd.tar.bz2
mpv-9db818279aa63d071f2bca369235285314444dcd.tar.xz
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.
Diffstat (limited to 'sub/draw_bmp.c')
-rw-r--r--sub/draw_bmp.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/sub/draw_bmp.c b/sub/draw_bmp.c
index 78ce773822..8ed104fdf8 100644
--- a/sub/draw_bmp.c
+++ b/sub/draw_bmp.c
@@ -840,6 +840,14 @@ struct mp_draw_sub_cache *mp_draw_sub_alloc(void *ta_parent, struct mpv_global *
return c;
}
+// For tests.
+struct mp_draw_sub_cache *mp_draw_sub_alloc_test(struct mp_image *dst)
+{
+ struct mp_draw_sub_cache *c = talloc_zero(NULL, struct mp_draw_sub_cache);
+ reinit_to_video(c);
+ return c;
+}
+
bool mp_draw_sub_bitmaps(struct mp_draw_sub_cache *p, struct mp_image *dst,
struct sub_bitmap_list *sbs_list)
{