Commit Graph

214 Commits

Author SHA1 Message Date
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
Kacper Michajłow 57d6826249 meson: bump libplacebo required version to 6.338.2 2024-01-31 15:38:21 +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
karelrooted ea0e9b74a3 meson: use subprocess-dummy.c fallback when fork func doesn't exist 2023-12-03 22:28:45 +01:00
sfan5 67b75a3b34 meson: fix check for dvbin availability 2023-11-29 20:36:37 +01:00
Dudemanguy 60a31a8a28 build: only directly link shaderc and spirv-cross on windows
See 1b035402a6. This is only relevant if
you are using d3d11 on --vo=gpu which is windows-only. For all other
platforms, vulkan uses libplacebo which uses shaderc. mpv itself doesn't
need it in those cases.
2023-11-28 21:47:13 +00:00
Kacper Michajłow aea8a82478 meson: move mpv.com target after mpv.exe to avoid meson version warning
meson is able to detect blocks of code that are guarded with version
checks, but we did that in reverse order and mpv.exe was complaining.
2023-11-27 20:43:04 +00:00
Dudemanguy 0ea374b1c7 meson: generate .com in the same place as the .exe if possible
Meson was pretty strict about target ids and generating the mpv.com in
the same directory as mpv.exe wasn't possible. So as a workaround we
tucked it away in a subdirectory, but that's not really intuitive at
all. Well as of meson 1.3.0, this is now possible so leverage it since
it makes way more sense. We still keep the old workaround for anyone
using older meson versions.
2023-11-27 18:42:19 +00:00
Kacper Michajłow d0e609297f meson: add missing _GNU_SOURCE in check 2023-11-25 12:38:20 +01:00
Kacper Michajłow ed107c4116 meson: adjust win32 defines
- Don't define _GNU_SOURCE on Windows, no need
- Define WIN32_LEAN_AND_MEAN to strip some unneded headers from
  windows.h
- Define NOMINMAX and _USE_MATH_DEFINES as they are common for Windows
  headers
2023-11-25 12:38:20 +01:00
Kacper Michajłow dff48031a1 meson: don't define __USE_MINGW_ANSI_STDIO
It is defined automatically when needed, which is almost never we don't
support Windows XP.

See: bfd33f6c0e
2023-11-25 12:38:20 +01:00
Jan Beich e575ec4fc3 meson: also expose present_sync for VT-only after a96d04f19d
$ meson setup --auto-features=disabled -Ddrm=enabled -Degl=enabled -Dgbm=enabled -Degl-drm=enabled /tmp/mpv_build
$ meson compile -C /tmp/mpv_build
[...]
ld: error: undefined symbol: mp_present_initialize
>>> referenced by drm_common.c
>>>               libmpv.so.2.2.0.p/video_out_drm_common.c.o:(vo_drm_init)

ld: error: undefined symbol: present_sync_update_values
>>> referenced by drm_common.c
>>>               libmpv.so.2.2.0.p/video_out_drm_common.c.o:(drm_pflip_cb)

ld: error: undefined symbol: present_sync_swap
>>> referenced by drm_common.c
>>>               libmpv.so.2.2.0.p/video_out_drm_common.c.o:(drm_pflip_cb)

ld: error: undefined symbol: present_sync_get_info
>>> referenced by vo_drm.c
>>>               libmpv.so.2.2.0.p/video_out_vo_drm.c.o:(get_vsync)
2023-11-22 19:06:42 +00:00
Kacper Michajłow 67deebc5b5 vaapi: add support for vaapi-win32
Only vaapi-copy variant as nothing can map D3D12 resources currently.

And even if we would add resource sharing to D3D11 it would invoke copy
at some point, so there is no point really. Maybe in the future when
libplacebo get smarter about resource sharing on Windows, but practical
advantages are really small. I've tested it with Vulkan <-> D3D11
sharing and GPU <-> GPU copy is still invoked. Better than CPU memcpy,
something for the future.
2023-11-22 11:43:20 +01:00
rcombs ca45b71edc hwdec: support videotoolbox with libplacebo 2023-11-16 09:48:20 -08:00
der richter fc4db187d0 cocoa: remove OpenGL cocoa backend
the OpenGL cocoa backend was deprecated in 0.29, it has lot of bugs, is
completely unmaintained and can't properly playback anything anymore on
the newest macOS. it is time to remove it.
2023-11-10 14:54:37 +01:00
der richter 1c98ab6239 TOOLS/macos-sdk-version: remove legacy sdk version retrieval
older macOS dev tools were inconsistent with the way how SDK versions
were returned, some truncated the minor versions. in those cases the
SDK version had to be retrieved through the SDK build version.

recently the scheme for the SDK build version changed that our heuristic
for converting it to an SDK version produced wrong version strings.
the stride of the minor version changed from 1 to 2, so SDK versions
ended up higher than they actually were. furthermore macOS 11 was
hardcoded.

since Xcode 12 Apple fixed the SDK version retrieval and it is no longer
truncated when using Xcode as dev tools. Xcode 12 is also the latest
supported version on macOS 10.15, which is also our oldest supported
version. we can remove the old SDK build version conversation and use
the Xcode only tool to retrieve the SDK version in the case Xcode is
used as dev tools. furthermore this als keeps support for Xcode 11 where
the problem wasn't fixed yet, but is still a supported version on macOS
10.15.

Fixes #9907
2023-11-10 14:28:39 +01:00
Dudemanguy a5bf211e12 meson: remove several macos-10-* build options
These have been build options since the waf build, but that doesn't
really make sense. The build can detect whatever macOS sdk version is
available and then use that information to determine whether to enable
the features or not. Potentially disabling multiple sdk versions doesn't
really make any sense. Because f5ca11e12b
effectively made macOS 10.15 the minimum supported version, we can drop
all of these checks and bump the required sdk version to 10.15. The rest
of the build simplifies from there.
2023-11-09 18:12:25 +00:00
Kacper Michajłow add2f3c8c9 meson: add missing source file for UWP 2023-11-08 04:32:10 +00:00