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

1071 Commits

Author SHA1 Message Date
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
Kacper Michajłow
5cf0da2a6a various: remove unused sys/time.h include 2024-05-06 22:01:17 +02:00
Kacper Michajłow
323ed3cb10 osdep/compiler: clang also recognizes those attributes 2024-05-06 22:01:17 +02:00
Kacper Michajłow
041a925ada osdep/main-fn-win: add struct typedef for compatibility 2024-05-06 22:01:17 +02:00
Kacper Michajłow
419898267e osdep/semaphore: don't include files if they are not used 2024-05-06 22:01:17 +02:00
Kacper Michajłow
86abbb89a7 win32: fix platform checks 2024-05-06 22:01:17 +02:00
Kacper Michajłow
b647201795 osdep/dirent: add implementation for Windows SDK build 2024-05-06 22:01:17 +02:00
Kacper Michajłow
18ef834ef4 various: move unistd.h inclusion to common.h 2024-05-06 22:01:17 +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
der richter
4a686dac6f mac: properly handle regular expressions without force unwrap 2024-04-28 20:21:18 +02:00
der richter
8f1189341f mac: code cleanup and consistency changes, fix linting issues 2024-04-28 20:21:18 +02:00
der richter
984c890661 mac/helper: make wakeup callback declaration consistent 2024-04-28 20:21:18 +02:00
der richter
6df06e5dc5 mac/touchbar: use KVO block API instead of old obj-c instance method 2024-04-28 20:21:18 +02:00
der richter
2e03e0305c mac/input: add support for dead key reporting
dead keys like tilde and accents were not reported because they returned
an empty string from the NSEvent.

try to retrieve dead key with alternative Carbon API when an empty key
is reported.
2024-04-24 20:35:53 +02:00
der richter
f7a32b5f29 mac: make display-names unique to allow specific selection
the Screen property localizedName returns a none unique dynamic name
that doesn't allow a specific selection of a Screen on every OS boot.
the name consists of the vendor name and model name (eg DELL U2723QE).
if the same model display is connected to the system several times,
macOS starts to add numbers to the localizedName (eg DELL U2723QE (1)),
that may not be associated to the same Screen on every OS boot or
connecting the display. it also changes the name of the first connected
display by adding that numeration. this makes it impossible specify the
proper screen with the screen-name option every time.

to circumvent this we remove the enumeration from the name and instead
add the serial number to the display-names property. this makes the
actual Screen unique and none dynamic. furthermore the selection of a
screen by name will check for equality for the old localizedName, simple
name without enumeration, serial number and the combined name with
serial number. this makes it possible to select the screen by either of
those names and identifiers, and keeps backwards compatibility with the
old behaviour.

Examples:
localized name (System Settings name): DELL U2723QE, DELL U2723QE (1)
simple name: DELL U2723QE
serial number: 123456789
combined name: DELL U2723QE (123456789)
2024-04-24 20:35:38 +02:00
nanahi
7cfd369ffb terminal-win: support mouse input events
The mouse input information is available from the INPUT_RECORD
with MOUSE_EVENT event type.
2024-04-18 01:03:33 +02:00
nanahi
8a2892a68f terminal-win: implement terminal_get_size2
The size of the console font can be acquired with GetCurrentConsoleFont,
and the terminal size can be calculated from the rols, cols, and font
size.
2024-04-18 01:03:33 +02:00
nanahi
eff18a8a11 terminal-win: implement terminal_set_mouse_input 2024-04-18 01:03:33 +02:00
nanahi
c2ed2e7bc8 terminal: add terminal_set_mouse_input function
This function is used to enable/disable mouse input for win32 and unix.
2024-04-18 01:03:33 +02:00
nanahi
abc0b0e8c9 terminal-unix: style fix 2024-04-18 01:03:33 +02:00
nanahi
cbc3fb104d terminal-unix: ignore unhandled mouse CSI sequences
21d434d2db attempted to ignore unknown
CSI sequences with a specific termination rule. This however does not
apply to mouse CSI sequences which can have characters out of that
range. Fix this by throwing away the whole sequence when an unhandled
mouse sequence is detected.
2024-04-18 01:03:33 +02:00
nanahi
9ae58ba186 terminal-unix: support mouse escape codes
These 6-byte codes have the format of \e [ M <button> <xpos> <ypos>.
Support the first 3 mouse bottons + scroll up/down for now as
button numbers > 5 are pretty non-portable across terminals.
Pixel-based mouse position values are calculated and sent to the
input system.
2024-04-18 01:03:33 +02:00
der richter
e42a8d537f mac/log: fix use after free when freeing mpv handle
the mp_log is freed when the corresponding mpv_handle (ta_parent) is
freed in the EventHelper, though it could still be used from different
threads. instead don't use a ta_parent and manually free on manual
dereferencing. on app shutdown (memory cleanup) this is not called but
instead is freed by the usual cleanup and freeing.

the LogHelper is only able to be manually dereferenced in the AppHub,
so no race conditions are possible in all other cases (vo).in the AppHub
it's impossible to hit a race condition atm, because of how the init
process works and how/where the log is used. only manually forcing
logging in the exit process itself could theoretically trigger a use
after free.

Fixes #13823
2024-04-12 23:23:16 +02:00
der richter
ee6794225d mac/vulkan: add support for frame timing via presentation feedback 2024-04-10 19:14:20 +02:00
Kacper Michajłow
c389f9e75e win32: change fputs to fwrite wrapper
Removes mp_puts/mp_fputs and adds mp_fwrite.

In fact I wanted fwrite instead of puts, no need to make it more awkward
with the implicit new lines.

Fixes: fc55f355fc
2024-04-07 20:23:04 +02:00
Kacper Michajłow
6177aa7616 vo_tct: add synchronized output support
See-Also: https://gist.github.com/christianparpart/d8a62cc1ab659194337d73e399004036
2024-04-07 20:23:04 +02:00
Kacper Michajłow
0f85a380c3 terminal-win: add more control codes support in non-VT mode
And skip unsupported private sequences, instead of printing them.
2024-04-07 20:18:05 +02:00
der richter
2cbb13db9e mac/remote: use event type as key state for proper mapping in function
instead of using the MP_KEY events (Int32) and using a logical OR to
generate a key event for the mpv core, use the cocoa event type for key
states and pass those to the the function. in the function we properly
map those events to the right MP_KEY events.
2024-04-04 19:39:27 +02:00
der richter
70eba5e831 mac/apphub: fix opening several files at once via Finder or App icon
when dropping more than one file on the App icon or opening via Finder
the open(urls:) event might not pass all files at once in the array, but
may consecutivly call open(urls:) for each of the files or batched in
several arrays.

to fix this append any file passed to the open(urls:) event within 0.1
seconds of each other to the current playlist. the first event uses the
default behaviour.
2024-04-04 19:39:27 +02:00
der richter
fe1de116f3 mac/app: add some verbose logging for app startup and file handling 2024-04-01 22:13:39 +02:00
der richter
9c0fc83f45 mac/apphub: only instantiate log and option when in Application mode
when in libmpv mode there is no need to for logging and reading options.
this also prevents possible race conditions with the usage and deinit of
the mpv_handler.
2024-04-01 22:13:39 +02:00
der richter
67c48ed922 mac/menu: remove redundant quit func and use identical command func 2024-04-01 22:13:39 +02:00
der richter
3c51497954 mac/app: cleanup and optimise App launch and termination
NSApp.terminate() is not a requirement to properly shut down a cocoa
App since it only calls exit() internally. though when not used the
cocoa termination events won't trigger, which we don't need. this
prevented us to exit with a proper exit code.

rework the whole termination logic to end up at one point where we can
return the exit code from the mpv_main function.

Fixes #7456
2024-04-01 22:13:39 +02:00
der richter
d6c621b03b mac/apphub: move opening url into AppHub 2024-04-01 22:13:39 +02:00