Commit Graph

101 Commits

Author SHA1 Message Date
Dudemanguy b08822b8ce test/test_utils: add mp_msg_set_max_level stub
Needed since the previous commit.
2024-03-03 15:15:51 -06:00
der richter f9b8f156d7 test: add missing libplacebo dependency 2024-02-24 20:04:16 +01:00
nanahi 4e73602ae5 options/path: move path utility functions to misc/path_utils
These utility functions have nothing to do with user and config dir/file.
Move them to a separate file.
2024-02-23 21:35:57 +01:00
Kacper Michajłow 19a6b84915 osdep/timer: update documentation and test for mp_time_ns
No longer true after 8bbcc87fee.
2024-01-26 03:28:55 +00:00
Kacper Michajłow 66e451f4e6 csputils: replace mp_colorspace with pl_color_space 2024-01-22 14:54:55 +00:00
nanahi 7ffd947830 win32: move IME candidate window to video window
By default the IME candidate window appears on the top left corner
of the monitor. Move it to the video window for sane behavior.
2024-01-15 16:06:06 +00:00
Dudemanguy cf27152991 test: update ffmpeg format refs
These tests should really be rewritten to be less stupid so they don't
break everytime ffmpeg updates its formats, but that's too much effort
right now. Bump the required libavutil version as well.

8e1ef7c38f
2023-11-18 20:46:11 +00:00
Kacper Michajłow 73fbe09a49 ALL: use pl_hdr_metadata and nuke sig_peak
This commit replaces all uses of sig_peak and maps all HDR metadata.

Form notable changes mixed usage of maxCLL and max_luma is resolved and
not always max_luma is used which makes vo_gpu and vo_gpu_next behave
the same way.
2023-11-05 18:57:36 +01:00
Kacper Michajłow 71e888c2a0 timer: remove unused code 2023-11-05 17:36:17 +00:00
Kacper Michajłow f75fe33da7 threads: rename threads.c to threads-posix.c 2023-11-05 17:36:17 +00:00
Kacper Michajłow 56d35da180 mp_thread: add win32 implementation 2023-11-05 17:36:17 +00:00
Kacper Michajłow 1be0d0aa84 test: unbreak build when win32-internal-pthreads is disabled 2023-10-26 16:49:46 +00:00
Kacper Michajłow 2f5f15039d test/meson: add missing libplacebo dep 2023-10-24 01:30:22 +00:00
sfan5 dad4e61b68 test: add basic tests for timer code 2023-10-20 21:30:51 +02:00
Dudemanguy bb036c67f4 test: change test_utils stubs to ns variants
The functions now internally use the ns timer and not the us one.
2023-10-16 15:38:59 +00:00
Kacper Michajłow d263087713 meson: don't link pthreads when internal impl is used 2023-09-29 20:48:58 +00:00
Kacper Michajłow d0e4eabb4e meson: add missing gl-video test dependency 2023-09-29 20:48:58 +00:00
Kacper Michajłow 40e0fea6eb timer: rename mp_add_timeout to reflect what it actually does 2023-09-29 20:48:58 +00:00
Kacper Michajłow da4c4d2ebd timer: rename mp_time_us_to_timespec to reflect what it actually does 2023-09-29 20:48:58 +00:00
Jan Ekström 10087b4086 test/meson: add missing avutil dependency to chmap test
Found out with a CI image where FFmpeg is not located in the default
sysroot.
2023-08-06 20:36:12 +03:00
sfan5 38b59408c2 test: indicate test function ran in log 2023-08-06 18:49:54 +02:00
sfan5 b68491e9a6 test: enable log messages for libmpv test 2023-08-06 18:49:54 +02:00
sfan5 5d71f858c2 test: refactor helper methods to be universally usable 2023-08-06 18:49:54 +02:00
Dudemanguy af9eac654e test: bump libmpv test timeout
Get rid of the time during the while loop and just let this run forever
in case of a failure and also bump the timeout in meson to 60 seconds
since we know it is possible for msys to take a very long time on
occasion. That should be plenty of time for it to finish.
2023-08-01 15:04:36 +00:00
Dudemanguy bb17d44835 test: enhance libmpv test
We already have a libmpv test, but it's really basic and barely does
anything. In an effort to hopefully prevent future breakage, lets expand
this to do more stuff. First of all, it simply tests setting a bunch of
properties/options. Secondly, it tries to load a file (the mpv icon that
we already have in the source tree). And then finally it tries the
lavfi-complex filter since this is a known special case where weird
things can happen.
2023-07-27 14:48:09 +00:00
cvzi f5eb7ea1a9 json: unify json_parse depth to MAX_JSON_DEPTH=50 2023-07-08 11:36:15 +02:00
cloud11665 b45be3d6e9 test/meson: explicitly specify lavf dependency
Added stubs for mp_set_avdict().
2023-07-01 02:05:23 +00:00
Harri Nieminen 292a5868cb various: fix typos
Found by codespell
2023-03-28 19:29:44 +00:00
Dudemanguy e1727553f1 test: update format refs to ffmpeg 6
Major release means new formats and failing tests so just add the new
stuff to the ref again and bump the minimum libavutil version. The last
ffmpeg commit that added a new format and is the minimum required
version for these subset of tests is referenced below.

479747645f
2023-03-15 00:25:11 +02:00
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
Dudemanguy 3eae9d6c0f test: update ffmpeg format refs
A few formats were added recently, some were removed, and some flags
were changed. Maybe this should be better, but just update for now so
the tests stop failing.
2023-03-02 15:45:27 +00:00
Kacper Michajłow b5f62050ec test/repack.c: skip tests that exceeded maximum allowed ZIMG dimension
Fixes tests on 32-bit platforms
2023-01-28 01:03:12 +00:00
Philip Langdale 8ba4ace1f6 test: update to reflect that Vulkan is a generic format again
In the previous change, I removed the explicit mapping for Vulkan, so
it now shows up as [GENERIC].
2022-10-29 19:18:43 -07:00
Philip Langdale f221666ade f_hwtransfer: mp_image_pool: support HW -> HW mapping
Certain combinations of hardware formats require the use of hwmap to
transfer frames between the formats, rather than hwupload, which will
fail if attempted.

To keep the usage of vf_format for HW -> HW transfers as intuitive as
possible, we should detect these cases and do the map operation instead
of uploading.

For now, the relevant cases are moving between VAAPI and Vulkan, and
VAAPI and DRM Prime, in both directions. I have introduced the IMGFMT
entry for Vulkan here so that I can put in the complete mapping table.
It's actually not useless, as you can map to Vulkan, use a Vulkan
filter and then map back to VAAPI for display output.
2022-09-21 09:39:34 -07:00
Jan Ekström 8f274da066 test/chmap: start adding AVChannelLayout unit tests
The first set iterates through all standard FFmpeg layouts and
checks that those which fit MP_NUM_CHANNELS succeed.

The second set iterates through built-in named channel layouts,
and attempts to convert them to AVChannelLayouts.
2022-06-15 21:19:10 +03:00
Cœur bb5b4b1ba6 various: fix typos 2022-04-25 09:07:18 -04:00
Ripose 34cfe9d89b command: add secondary-sub-start and secondary-sub-end properties
Adds secondary-sub-start and secondary-sub-end properties by setting
the current_track index in the m_property's priv variable which later
gets accessed in get_times. Also adds a test of the secondary subtitle
time properties in tests/subtimes.js bound to 'T'.
2021-07-12 21:07:37 +00:00
wm4 0279a44d93 command: extend subprocess command
Add env and detach arguments. This means the command.c code must use the
"new" mp_subprocess2(). So also take this as an opportunity to clean up.
win32 support gets broken by it, because it never made the switch to the
newer function.

The new detach parameter makes the "run" command fully redundant, but I
guess we'll keep it for simplicity. But change its implementation to use
mp_subprocess2() (couldn't do this earlier, because win32).

Privately, I'm going to use the "env" argument to add a key binding that
starts a shell with a FILE environment variable set to the currently
playing file, so this is very useful to me.

Note: breaks windows, so for example youtube-dl on windows will not work
anymore. mp_subprocess2() has to be implemented. The old functions are
gone, and subprocess-win.c is not built anymore. It will probably work
on Cygwin.
2020-07-20 21:02:17 +02:00
wm4 2a89da0c85 zimg: add slice threading and use it by default
This probably makes it much faster (I wouldn't know, I didn't run any
benchmarks ). Seems to work as well (although I'm not sure, it's not
like I'd perform rigorous tests).

The scale_zimg test seems to mysteriously treat color in fully
transparent alpha differently, which makes no sense, and isn't visible
(but makes the test fail). I can't be bothered with investigating this
more. What do you do with failing tests? Correct, you disable them. Or
rather, you disable whatever appears to cause them to fail, which is the
threading in this case.

This change follows mostly the tile_example.cpp. The slice size uses a
minimum of 64, which was suggested by the zimg author. Some of this
commit is a bit inelegant and weird, such as recomputing the scale
factor for every slice, or the way slice_h is managed. Too lazy to make
this more elegant.

zimg git had a regressio around active_region (which is needed by the
slicing), which was fixed in commit 83071706b2e6bc634. Apparently, the
bug was never released, so just add a warning to the manpage.
2020-07-15 22:59:17 +02:00
wm4 1ffa83ea92 test: update to new ffmpeg pixfmts
Mainly, X2RGB10BE is added. Add our own unpack test for this format.
Also, swscale seems to have added support for GBRPF conversion.
2020-06-17 19:43:09 +02:00
wm4 320fa3bbe7 video: add AV_PIX_FMT_UYYVYY411 conversion support
It may be completely useless, and I can't verify it as no known samples
or other known/accessible software using it, but why not?

Putting this together with he 422 code requires making it slightly more
generic. I'm still staying with a "huge" if tree instead of a table to
select the scanline worker callback, because it's actually small and not
huge (although it not being generic still feels slightly painful).
2020-05-22 02:26:05 +02:00
wm4 086953a9da video: clean up pixel metadata stuff some more
A repeat of the previous useless commits.

Pondered whether to use separate fields or just a flags integer for
color and component types; the latter won for now.

Functions like mp_imgfmt_get_component_type() are now discouraged, and
mp_imgfmt_desc.flags is back for defining all information. Some days ago
I felt like the opposite would be the better design. Fortunately, it
doesn't matter.

With this, I think all image format properties that mpv needs are
exhaustively defined all in one place.
2020-05-20 18:38:15 +02:00
wm4 176f422213 video: shuffle imgfmt metadata code around
I guess I decided to stuff it all into mp_imgfmt_desc (the "old"
struct). This is probably a mistake. At first I was afraid that this
struct would get too fat (probably justified, and hereby happened), but
on the other hand mp_imgfmt_get_desc() (which builds the struct) calls
the former mp_imgfmt_get_layout(), and the separation doesn't make too
much sense anyway. Just merge them.

Still, try to keep out the extra info for packed YUV bullshit. I think
the result is OK, and there's as much information as there was before.

The test output changes a little. There's no independent bits[] array
anymore, so formats which did not previously have set this now show it.
(These formats are mpv-only and are still missing the metadata. To be
added later). Also, the output for the cursed packed formats changes.
2020-05-20 00:02:27 +02:00
wm4 2256a9e42b video: fix AV_PIX_FMT_UYYVYY411 allocation
My previous commit added support for this format, but it was still
broken, and prevented the allocation code from working. It's unknown
whether it's correct now (because this pixfmt is so obscure and useless,
there are no known samples around), but who cares.
2020-05-18 19:29:25 +02:00
wm4 27e5416c12 video: add pixel component location metadata
I thought I'd probably want something like this, so the hardcoded stuff
in repack.c can be removed eventually. Of course this has no purpose at
all, and will not have any. (For now, this provides only metadata, and
nothing uses it, apart from the "test" that dumps it as text.)

This adds full support for AV_PIX_FMT_UYYVYY411 (probably out of spite,
because the format is 100% useless). Support for some mpv-only formats
is missing, ironically.

The code goes through _lengths_ to try to make sense out of the FFmpeg
AVPixFmtDescriptor data. Which is even more amazing that the new
metadata basically mirrors pixdesc, and just adds to it. Considering
code complexity and speed issues (it takes time to crunch through all
this shit all the time), and especially the fact that pixdesc is very
_incomplete_, it would probably better to have our own table to all
formats. But then we'd not scramble every time FFmpeg adds a new format,
which would be annoying. On the other hand, by using pixdesc, we get the
excitement to see whether this code will work, or break everything in
catastrophic ways.

The data structure still sucks a lot. Maybe I'll redo it again. The text
dump is weirdly differently formatted than the C struct - because I'm
not happy with the representation. Maybe I'll redo it all over again.

In summary: this commit does nothing.
2020-05-18 01:54:59 +02:00
wm4 caee8748da video: clean up some imgfmt related stuff
Remove the vaguely defined plane_bits and component_bits fields from
struct mp_imgfmt_desc. Add weird replacements for existing uses. Remove
the bytes[] field, replace uses with bpp[].

Fix some potential alignment issues in existing code. As a compromise,
split mp_image_pixel_ptr() into 2 functions, because I think it's a bad
idea to implicitly round, but for some callers being slightly less
strict is convenient.

This shouldn't really change anything. In fact, it's a 100% useless
change. I'm just cleaning up what I started almost 8 years ago (see
commit 00653a3eb0). With this I've decided to keep mp_imgfmt_desc,
just removing the weird parts, and keeping the saner parts.
2020-05-18 01:54:59 +02:00
wm4 00ac63c37b test: explicitly test repacking for all packed RGB variants
This stuff is very annoying, so it's good to have full coverage.
2020-05-18 01:54:59 +02:00
wm4 baabd5fce3 draw_bmp: use command line options for any used scalers 2020-05-13 20:07:59 +02:00
wm4 0ff839d467 draw_bmp: add integer blending for 8 bit formats
Whatever it's worth. Instead of doing a pretty stupid conversion to
float, just blend it directly. This works for most RGB formats that are
8 bits per component or below (the latter because we expand packed
fringe RGB formats for simplicity). For higher bit depth RGB this would
need extra code.
2020-05-12 23:10:14 +02:00
wm4 c4b2ca83d6 draw_bmp: don't make strange decisions on broken iknput csp params
This checked params->color.space for being RGB. If the colorspace is
unset, this did dumb things because even if the imgfmt was a RGB one,
the colorspace was not set to RGB. This actually also happened to the
tests.

(Short-cutting RGB like this is actually wrong, since RGB could still
have strange gamma or primaries, which would warrant a full conversion.
So you'd need to check for these other parameters as well. To be fixed
later.)
2020-05-12 22:43:29 +02:00