0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 03:52:22 +02:00
Commit Graph

231 Commits

Author SHA1 Message Date
Kacper Michajłow
d59a606cbd meson: add -fno-trapping-math to default flags
It is safe to enable for mpv, we don't check or care about floating
point exceptions. Allow the compiler to ignore them too.
2024-06-07 20:12:40 +02:00
Kacper Michajłow
3f84969b21 meson: add -fno-signed-zeros to default flags
It is safe to enable. Even FFmpeg enables this by default.
0415bb74c8/configure (L7521)
2024-06-07 20:12:40 +02:00
Kacper Michajłow
a8d95fd51a bstr: use memchr and memrchr for bstrchr and bstrrchr
May be faster to use optimized variants instead of simple loop.
2024-06-06 21:42:58 +02:00
Kacper Michajłow
0fd4c84a5e meson: clear flags used for build
Some were duplicated between GCC and Clange. Others were missing in
Clang case. Instead test all the flags and don't make assumptions that
will get invalid over time. Testing flags is almost free.
2024-06-05 19:07:58 +02:00
Kacper Michajłow
0c716e762f test/meson: remove unneded sources 2024-06-03 19:18:06 +02:00
Dudemanguy
056b03f9ed build: dynamically generate mpv.desktop file protocols
If we can run the built mpv binary, then it is possible to use a custom
target that reads the protocols we have available in mpv and write the
mpv.desktop file based on the output. For cases where this is not
possible (e.g. cross compiling), then just install the unmodified
mpv.desktop file like before. Fixes #8731 and fixes #14124.
2024-05-22 20:10:52 +00:00
Kacper Michajłow
b11f236eb9 meson: limit concurrent link jobs to 16
Statically linking, especially with LTO can use a lot of memory. Limit
to 16 jobs by default, which is more than enough. Only fuzzers are
affected as we don't produce that much binaries otherwise.
2024-05-20 18:25:05 +02:00
Kacper Michajłow
89ed75e63e meson: assume vkCreateDisplayPlaneSurfaceKHR is available when internal
When Vulkan loader is build internally, let's assume it is available.
2024-05-18 23:22:18 +02:00
sfan5
a33fd3b4cf Revert "stream: don't try to read from all-sparse/no-data files"
The stream layer is just not the right place to make this change
since it's also used for completely unrelated purposes such as reading
configs.

This reverts commit bb7a485c09.
2024-05-12 18:06:21 +02:00
Kacper Michajłow
d79aef1425 meson: add link flags also to cpp
If subprojects are used, linking language of mpv might be upgraded to C++
add our flags there too.
2024-05-10 21:42:10 +02:00
Kacper Michajłow
5009e13431 player/loadfile: match language and subcodes 2024-05-09 17:12:55 +02:00
Kacper Michajłow
40ba63405f Revert "misc: add language-matching utilities"
This reverts commit 8c8d97c26c.
2024-05-09 17:12:55 +02:00
Mohammad AlSaleh
bb7a485c09 stream: don't try to read from all-sparse/no-data files
```
 dd if=/dev/zero of=/tmp/10g.empty bs=1 seek=10G count=0
 dd if=/dev/zero of=/tmp/10m.empty bs=1 seek=10M count=0
 time mpv /tmp/10{g,m}.empty
 ```

 I keep files with the name format `${name}-${hash}.${ext}.empty`
 around, where the original is removed, and a sparse file with
 the size of the original is created instead.

 A lot of time is wasted on such files when going through
 playlists/directories that include some of them.

 This admittedly may not be that common of a use-case.

Signed-off-by: Mohammad AlSaleh <CE.Mohammad.AlSaleh@gmail.com>
2024-05-07 12:22:09 +02:00
Kacper Michajłow
e1e09938c5 meson: add defines for Windows build to avoid warnings
See:
https://learn.microsoft.com/cpp/c-runtime-library/compatibility
https://learn.microsoft.com/cpp/c-runtime-library/security-features-in-the-crt
2024-05-06 22:01:17 +02:00
Kacper Michajłow
94eb07e3ea meson: remove Windows subsystem version, it is 6.0 by default 2024-05-06 22:01:17 +02:00
Kacper Michajłow
053d971507 misc/path_utils: normalize win32 paths 2024-05-05 19:37:57 +02:00
der richter
8a61929eb8 cocoa-cb: add support for macOS color space transformation (EDR/HDR)
by default utilises the color space of the screen on which the window is
located. if a specific value is defined, it will instead be utilised.

depending on the chosen color space the macOS EDR (HDR) support is
activated and that OS's transformation (tone mapping) is used.

Fixes #7341
2024-05-05 19:02:50 +02:00
Kacper Michajłow
47dbc3a74e fuzzers: add new fuzzer targets
fuzzer_set_property.c:

fuzz mpv_set_property in both initialized and non-initialized state.
Useful for user provided values sanitization test. I've already seen
some memory leaks in parsing code, good to drill it.

fuzzer_loadfile.c:

mpv_command "loadfile" test. Good for testing demuxers, decoding and
playback loop. Sadly in headless mode we can't really test AO and VO,
but at least all the code around can be fuzzed. Especially our custom
demuxers like demux_mkv.

fuzzer_loadfile_direct.c:

Similar to loadfile above, but instead of saving the data to file, it
passes the fuzz input in the command. Generated protocol specific
versions (mf:// and memory:// for now) and generic one.

Nothing really complex, but good start and even those few targets should
give good coverage of the most common code paths in libmpv.
2024-04-27 02:47:47 +02:00
Shreesh Adiga
d9c5aef98d vf_gpu: vulkan and egl implementations
Abstract out EGL, and allow choosing between EGL and vulkan at runtime.
vf_gpu_egl.c contains GL specific context and creation/destroy code,
vf_gpu_vulkan.c contains Vulkan specific. This allows vf_gpu being
built in systems where EGL is not available and where Vulkan is
available.
2024-04-27 01:08:22 +02:00
Robert Kopaczewski
578b9dade2 ao/audiounit: fix building for iOS 2024-04-20 00:44:46 +02:00
Kacper Michajłow
1a495451ab d3d11: disable IDXGIInfoQueue usage if dxgidebug.h is incomplete
Older MinGW-w64 doesn't define IDXGIInfoQueue in dxgidebug.h.
2024-04-19 03:32:29 +02:00
Kacper Michajłow
19a9164e24 d3d11: use IDXGIInfoQueue instead ID3D11InfoQueue
DXGI debug interface encapsulate multiple message queues, which allows
to get validation not only for D3D11 calls, but also DXGI ones.

Also this makes leak detector not report self debug interface as alive
like it was before. And same as with validation, it has ability to
detect more alive objects, not being limited to D3D11.
2024-04-19 03:32:29 +02:00
der richter
ee6794225d mac/vulkan: add support for frame timing via presentation feedback 2024-04-10 19:14:20 +02:00
Shuanglei Tao
3c1e983351 vo: add win32 context menu support 2024-04-06 08:24:06 +02:00
der richter
7619cceb87 mac/app: rewrite App c main function, startup and termination in swift
also move main invocation into AppHub and completely delete the old
Application c implementation.
2024-04-01 22:13:39 +02:00
der richter
b7c5b26d35 mac/app: rewrite Application class in swift 2024-04-01 22:13:39 +02:00
Misaki Kasumi
1ed8607292 ao_avfoundation: initial avfoundation ao support 2024-03-29 13:46:59 +01:00
sfan5
52638a4cac meson: refine dependencies of many feature checks 2024-03-26 12:59:59 +01:00
sfan5
af69b268c2 meson: remove some unneeded features from list
There's no practical use in knowing that e.g. mpv was linked
to libm and these are not used for HAVE_* tests either.
2024-03-26 12:59:59 +01:00
der richter
7e07e1a087 mac/apphub: migrate remaining events functionality to new AppHub
add new app_bridge objc file for bridging between mpv core and app
functionality. replace old EventsResponder singleton with AppHub.

another step to clean up all App functionality and have one central
place for it.
2024-03-24 23:03:48 +01:00
der richter
deb9d30e90 mac/event: add helper to subscribe to mpv events and property changes
preparation to remove duplicate code from all classes that implement
their own observer loops.
2024-03-24 23:03:48 +01:00
der richter
dc5059d027 mac/option: move option functionality from mpv helper to option helper
delete now empty mpv helper
2024-03-21 18:33:15 +01:00
der richter
283d0877c4 mac/type: move c<>swift type bridging into a dedicated type helper 2024-03-21 18:33:15 +01:00
sfan5
1d8f28cea7 meson: conditionalize searching for ANGLE's EGL 2024-03-21 18:27:08 +01:00
sfan5
a392f91170 meson: get rid of 'egl-helpers' feature
This was just redundant because it's always present together with 'egl'.
2024-03-21 18:27:08 +01:00
sfan5
3679d18b54 meson: fix EGL version check 2024-03-21 18:27:08 +01:00
nanahi
8c1117b2cb meson: remove winmm dependency for win32 desktop target
Not needed anymore as timeBeginPeriod() is removed.
2024-03-19 20:23:25 +01:00
nanahi
aff376e066 win32: increase hires timer resolution
timeBeginPeriod() only allows setting minimum timer resolution
to 1 ms. However, modern x86 platforms support a minimum timer
resolution of 0.5 ms. Use NtSetTimerResolution() instead for
the increased resolution, which can be set with MPV_HRT_RES.

Additionally, change the units of mp_start_hires_timers(),
mp_end_hires_timer(), MPV_HRT_RES, and MPV_HRT_MAX to nanoseconds,
in accordance with other functions used in timer.h.
2024-03-19 20:23:25 +01:00
nanahi
b2c1e55e5d meson: bump warning level to 2
Ignore a few noisy warnings for now.
2024-03-19 08:58:18 +01:00
der richter
c8088d801a mac/touchbar: rewrite touch bar in swift 2024-03-18 20:29:27 +01:00
der richter
f3e5fea4f5 mac/events: move input ctx related functionality into new input helper
preparation for mac/events cleanup and single responsibility principle.
all functions are thread safe.
2024-03-14 23:33:15 +01:00
Robert Kopaczewski
fbf3ae5a84 meson: fix ios-gl hwdec build 2024-03-12 14:36:30 +00:00
owl0w1
0d33394955 meson: remove main function from libmpv build
Only include a main function in cplayer build, not libmpv build. This shaves off 40 bytes from libmpv build.
2024-03-07 14:20:44 +01:00
der richter
fe35baa88e mac/menu: rewrite menu bar in swift 2024-03-07 01:03:52 +01:00
der richter
86fa9b18a3 osdep/mac: make mac naming of files, folders and function consistent
rename all macOS namings (osx, macosx, macOS, macos, apple) to mac, to
make naming consistent.
2024-02-28 15:52:47 +01:00
der richter
218d9e26d2 meson: add custom target for macOS App bundling
Fixes #10879
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
nanahi
84015959cc osdep/io: move I/O utility functions to misc/io_utils
The purpose of osdep/io is to provide a wrapper for POSIX I/O functions
on Windows. The last 2 functions are utility functions which don't serve
this purpose.
Move them to a separate file.
2024-02-23 21:35:57 +01:00
llyyr
a85efa64f0 meson: set default options for libplacebo if using subproject
This will prevent building demos and link statically with libplacebo by
default if system libplacebo is not found or isn't new enough and a
sufficiently new enough libplacebo exists in `subprojects/libplacebo`.
2024-02-12 11:04:22 +01:00
Dudemanguy
343a5fd345 player: remove all rpi-specific code
vo_rpi and its related code has pretty much historically been a
disaster in mpv. The build regularly gets broken and since nobody uses
it, it takes months for anyone to notice. There was also that time where
fullscreen was broken for about a year and a half. Also building in waf
was entirely broken for about a couple of years or so due to mysterious
reasons no one ever figured out (meson magically fixed it).

Anyways, once again the build is broken due to rpi being forgotten about
again, but instead of pretending to support this crap. Just drop it all.
Nowadays, mmal hwdec is a relic since these devices are better off using
the v4l2m2m ffmpeg fork instead which actually uses KMS properly. RPI 1
and 2 probably can't do this and will remain broken but oh well blame
Broadcom for being special snowflakes and not using standard APIs (my
rockpro worked out of the box; just saying). RPI 2 is nearly 10 years
old anyways, so I think you can afford a new SBC by now. If we were
nicer, there would be a deprecation period, but this is broken in the
last major release anyway so too late.

Closes #13402.
2024-02-05 17:41:06 +00:00