Commit Graph

1104 Commits

Author SHA1 Message Date
der richter 45c1c58680 mac/compat: fix compatibility for deployment targets lower than SDK ver
the swift parts can't be nicely encapsulated in the compat file because
it lags proper target version compile time checks.

Fixes #15292
2024-11-18 19:28:35 +01:00
der richter 91d4e6f937 mac/type: change never mutated variable to let 2024-11-05 18:34:15 +01:00
der richter c80757d782 videotoolbox: silence OpenGL deprecation warnings 2024-11-05 18:34:15 +01:00
der richter 84adbd9d35 ao_coreaudio: fix CoreAudio deprecations 2024-11-05 18:34:15 +01:00
der richter 6f009a91a6 mac/common: fix light sensor deprecations 2024-11-05 18:34:15 +01:00
averne 32bcaf865b osdep/terminal: fix dummy implementation
c2ed2e7 introduced the terminal_set_mouse_input function to various terminal
backends, but overlooked the dummy backend.
This causes linking errors when trying to build on platforms with no terminal,
as vo_kitty and vo_tct are unconditionally enabled and make use of that
function.
2024-11-02 20:05:11 +01:00
Guido Cella 99e4979b01 mac/menu: use show-text instead of old osc script messages
1a558bf5c2 made osc-*list script messages aliases to show-texting the
relative properties, so use show-text directly in the menu. Also
increase the duration to be the same as the OSC buttons because the
default of 1 second is too short.
2024-10-26 20:09:57 +02:00
Kacper Michajłow 4045fac980 osdep/io: remove duplicated code for error to string conversion
This also removes \n from the end of the string, which shouldn't be
present in this string.
2024-10-22 18:53:18 +02:00
der richter 37159a8ee0 mac/remote: show external covers in Now Playing Info Center 2024-10-19 17:20:43 +02:00
der richter 8cc3160f71 mac/event: add MPV_FORMAT_NODE handler 2024-10-19 17:20:43 +02:00
der richter f866893c9c mac/type: add mpv_node type conversion helpers 2024-10-19 17:20:43 +02:00
der richter 61a09501d6 mac/app: add option to adjust Bundle PATH variable
App Bundles operate in their own shell environment that is different
from the one in the terminal. the default PATH variable for all Bundles
is /usr/bin:/bin:/usr/sbin:/sbin. because of that mpv can not find
binaries installed by package manager that might be used in scripts for
example.

add an option to prepend paths to the Bundle PATH. we prepend to make
the order fully configurable, opposed to appending where the default
Bundle binaries would always take precedence.
2024-10-19 17:18:29 +02:00
Kacper Michajłow 5fed98e0ee various: use mp_tprintf_buf wrapper to work around mingw garbage
Look it up if you really care but basically z as a format specifier
often doesn't work in mingw because reasons. Our CI was working by
accident because of meson previously ignoring the CFLAGS variable. Use
our wrapper instead for these places.
2024-10-18 14:02:51 +00:00
Kacper Michajłow f33b89ca29 osdep/subprocess: log subprocess error as verbose if killed by us
Fixes: https://github.com/po5/thumbfast/issues/133#issuecomment-2413618437
2024-10-15 19:15:20 +02:00
der richter d6aef54adb mac/app: add homebrew ARM install paths to the bundle PATH environment
since the bundle operates in a different shell environment than the one
from the terminal, it only has a few default paths set.

add the homebrew ARM default install paths to the PATH environment
variable, so the bundle can also find the needed binaries like yt-dl.
2024-10-15 00:45:51 +02:00
Misaki Kasumi 6fadaf66c8 osdep: remove semaphore-mac
It is only used in one place in ao_coreaudio_utils.c,
and can be replaced by condvar.
Removing it can reduce the maintenance burden.
2024-10-12 17:26:39 +02:00
Kacper Michajłow e09278cfb9 win32: set consoleAllocationPolicy to detached in the manifest
This essentially obsoletes the console wrapper (mpv.com), which is no
longer needed. The console is attached depending on the context in which
mpv.exe is run.

Add an option to control which subsystem is targeted. Keep the GUI
application as the default to preserve compatibility with Windows
versions prior to 24H2.

For more information about the new console handling, see:
4386bf07fd/doc/specs/%237335%20-%20Console%20Allocation%20Policy.md
2024-10-10 00:44:15 +02:00
der richter 94d034ed99 mac/swift: fix typo in mpv_event_id string representation
this didn't break anything but might be confusing in log outputs.
2024-10-06 21:53:08 +02:00
der richter 2fb8b00ac9 mac/app: fix building with swift disabled
Fixes #14931
2024-10-06 21:52:35 +02:00
Andreas Klauer c365e2f7b1 misc/random: seed using libavutil/random_seed
When starting multiple processes of `mpv --shuffle` in parallel,
sometimes the random seed happens to be identical, so files are
played in the same random order.

mp_rand_seed(0) now uses a random seed provided by libavutil,
and only falls back to time in case of failure.
2024-09-28 14:11:56 +02:00
Kacper Michajłow a73c73255b osdep/timer-win32: remove unnecessary compatibility defines
No longer needed after 9f8b4b38c9.
2024-09-24 00:21:19 +02:00
Kacper Michajłow 01383c606c osdep/terminal-win: remove unnecessary compatibility defines
No longer neeeded after 9f8b4b38c9.
2024-09-24 00:21:19 +02:00
Kacper Michajłow 4ad3db855a osdep/main-fn-win: remove unnecessary compatibility defines
No longer needed after 9f8b4b38c9.
2024-09-24 00:21:19 +02:00
nanahi b440821d18 osdep/terminal-win: reset tmp_buffers_key when uninit
To prevent potential undefined results when using a freed value.
2024-09-15 17:03:33 +02:00
Kacper Michajłow 1ecfb29932 osdep/io: redefine off_t for Windows build
off_t is long (4 bytes) on Windows, regardless of _FILE_OFFSET_BITS,
which is not supported there.

Fixes: #14790
2024-09-04 03:51:56 +02:00
nanahi f3a00ea131 various: handle numpad add/subtract/multiply/divide keycodes 2024-08-11 15:08:42 +02:00
Philip Langdale 7bbf132e20 vo: hwdec: add AVHWDeviceType property to hwdecs
As the first step towards handling scenarios where the are multiple hwdecs for
a given image format but backed by different AVHWDeviceTypes, let us annotate
the hwdecs with their corresponding device types.

From this, we can also see how all the existing hwdecs which match the same
image format also match the same device type.
2024-08-10 14:24:36 -07:00
Kacper Michajłow 6f619d5ef4 vo_libmpv: don't steal pointer provided by the API user
It won't be TA allocated and would fail on header check. Also
documentation doesn't mention that ownership is transfered to mpv, so it
is unexpected.

This will cause existing clients of this API leak this memory, but I
doubt anyone really used it in this broken state.

Fixes: #14633
2024-08-06 20:17:35 +02:00
Kacper Michajłow 6a43514097 win32/smtc: add thumbnail support 2024-07-29 21:38:19 +02:00
Kacper Michajłow 5fed12e025 win32: add Media Control support
Add support for SystemMediaTransportControls interface. This allows to
control mpv from Windows media control ui.
2024-07-29 21:38:19 +02:00
Kacper Michajłow c430420840 osdep/threads-win32: cast function type directly to avoid warnings 2024-07-29 21:38:19 +02:00
Kacper Michajłow 0aebcbcc19 player/{command,scripting}: log subprocess execution
Useful for debugging purposes and sanity checks.

Remove unused function while at it.
2024-07-12 22:40:02 +02:00
Kacper Michajłow c505f77dda player/core: add core thread handle to MPContext
This change removes convoluted core thread extraction through dispatch
added in 500ce69a06.

Currently we fully control this thread, create it and join, there is no
reason not to keep the handle of it in the player context.

As a bonus to code simplification this also fixes thread handle leak on
Windows.

Fixes: #14472
2024-07-11 21:55:21 +02:00
der richter 88db2d0b61 mac/menu: add option to disable default shortcuts
Fixes #14305
2024-06-25 20:14:38 +02:00
Kacper Michajłow 7fb7e1dd73 various: add more format specifiers checks 2024-06-25 05:29:46 +02:00
Guido Cella 82ffe8f425 loadfile: update the format of terminal track information
Stop making unselected tracks and editions grey because they can be hard
to read over a dark background (\033[2m would be hard to differentiate
from regular text with a light theme instead), and because there is no
way to not print the escape sequences in --log-file.

Just use the same circles as the OSD and OSC. We need to print the empty
circles for alignment on mlterm with East Asian fonts (we could also
make them invisible with \033[8m but it would still get added to log
files).

Add back the space before tracks and editions when printed after
"Playing..." or "Track switched" and similar, so they look like a
sub-section of it, consistently with the metadata which starts with
space which makes it look like a sub-section of the "File tags" line.

Leave 2 spaces between track columns.

Make the lang options only as long as the longest language.

Place hls-bitrate within the same parentheses as the other data.

Replace the incomprehensible (*) (f) and [P] with textual descriptions
within []. Also place external there.

Stop converting Hz to kHz for consistency with other log messages, e.g.
AO: [pipewire] 48000Hz stereo 2ch floatp

Remove the space in "2 ch" so it doesn't look like 2 separate values (We
considered using mp_chmap_to_str(&s->codec->channels) but it prints
values like "unknown2").
2024-06-24 16:19:31 +02:00
der richter 55241da4ad cocoa-cb: guard color spaces that are only available on 10.15.4 upwards 2024-06-18 19:30:07 +02:00
der richter e3a290b618 mac/compat: fix broken CGColorSpace declaration on SDK 11 only
seems like apple missed those two colour spaces and didn't add a obj-c
to swift redeclaration of the CFStringRef kCGColorSpace* global
variables.
2024-06-18 19:30:07 +02:00
der richter 0f9630f28d mac/event: remove swift 5.6 language feature that is mandatory with 6.0
this can be tested with -enable-upcoming-feature ExistentialAny
2024-06-18 19:30:07 +02:00
der richter 1364c80e64 mac/compat: add withLock fallback for xcode older than 14
withLock is available for macOS versions starting from 10.10 but can
only be used on xcode 14+. xcode 14 introduced swift 5.7, so we guard it
behind a swift version check.
2024-06-18 19:30:07 +02:00
der richter b390ade709 mac/log: properly guard logger usage behind platform version check 2024-06-18 19:30:07 +02:00
Kacper Michajłow b4bbc27d9c input: map Num 5 to distinct value when numlock is off
Until now both numlock on and off were mapped to KP5.
2024-06-13 20:42:24 +02:00
Guido Cella d49879f1f7 loadfile: improve the format of terminal track information
Print vlang if present.

Make unselected tracks and editions grey instead of adding (+) before
selected tracks. Mark them with the same circles as show-text
${track-list} and script-message osc-tracklist when not outputting to a
TTY.

Don't print a different symbol with --sub-forced-events-only because
nobody uses this option, and subtitles are very unlikely to mix forced
and non-forced events.

Align 2-digit track IDs.

Align languages of up to 7 characters (the length of zh-Hans).

Leave spaces when a track has no language but at least another track
does to align the following track data with the other tracks.

Add a space between values and their units.

Convert Hz to kHz.

Pretty print FPS and kHz with mp_format_double().

Don't print images' FPS because it's just a bogus value taken from
--mf-fps.

Co-authored-by: Kacper Michajłow <kasper93@gmail.com>
2024-06-07 22:24:25 +02:00
Kacper Michajłow a32674bb29 terminal-win: use proper NTAPI callback for FLS
Fixes crash when FLS data is attempted to be cleared.

This affects only 32-bit build where the calling convention were not
matching the expected one. It has to be __stdcall in this case.

Fixes: 3372e17d
2024-06-06 21:42:12 +02:00
Kacper Michajłow 8e4dcb15ce osdep/endian: add missing byte order defines 2024-06-05 19:07:58 +02:00
Kacper Michajłow d31543a7e6 osdep/path-win: fix leak of portable_path 2024-05-20 18:18:42 +02:00
Kacper Michajłow 9ffbc1eef9 osdep/io: fix leak of environment strings on win32 2024-05-20 18:18:42 +02:00
nanahi f11002cef3 various: fix tabs in code 2024-05-07 11:23:08 +02:00
Kacper Michajłow 4d5642887d win32: add WinMain 2024-05-06 22:01:17 +02:00
Kacper Michajłow 9fc2343512 osdep/mpv.rc: fix encoding of MPVCOPYRIGHT
llvm-rc doesn't allow multi-byte codes in narrow utf-8.
2024-05-06 22:01:17 +02:00