summaryrefslogtreecommitdiffstats
path: root/osdep
Commit message (Collapse)AuthorAgeFilesLines
* osdep/main-fn-win: fix implicit conversion warningnanahi2024-03-191-1/+1
|
* osdep/threads: fix warning: initializer element is not constantnanahi2024-03-192-2/+2
|
* mac/touchbar: simplify item and view creationder richter2024-03-181-70/+53
|
* mac/touchbar: optimise time item updateder richter2024-03-181-6/+3
|
* mac/touchbar: optimise constraint calculationder richter2024-03-181-5/+3
|
* mac/touchbar: use DateComponentsFormatter for time formattingder richter2024-03-181-9/+5
|
* mac/touchbar: simplify update items logicder richter2024-03-181-27/+8
|
* mac/touchbar: take playback speed into account for rate limitingder richter2024-03-181-1/+4
|
* mac/touchbar: rewrite touch bar in swiftder richter2024-03-184-397/+344
|
* various: use static assertions where appropriatesfan52024-03-171-1/+1
|
* mac/input: optimise scroll wheel event handlingder richter2024-03-161-35/+18
|
* mac/input: move scroll wheel event handling into input helperder richter2024-03-161-5/+40
|
* mac/input: optimise mouse movement enabled checkder richter2024-03-161-2/+3
|
* mac/input: fix switched mouse forward and back buttonder richter2024-03-161-2/+2
|
* mac/input: move mouse event handling into input helperder richter2024-03-161-0/+28
|
* mac/input: add missing special keysder richter2024-03-141-0/+2
|
* mac/input: add simplified mp_keymap initder richter2024-03-142-52/+32
|
* mac/input: remove wrongly mapped modifier keysder richter2024-03-141-3/+0
|
* mac/event: move key event handling to input helper and optimise itder richter2024-03-147-165/+128
|
* mac/input: define AltGr mask as static NSEvent.ModifierFlags variableder richter2024-03-142-2/+8
| | | | | this makes it possible to properly test for those modifiers in a proper swift like way.
* mac/events: remove redundant functions and optimise input helper usageder richter2024-03-1410-109/+29
| | | | some redundant functions that jump through hoops.
* mac/helper: move input ctx related functionality into new input helperder richter2024-03-143-95/+76
| | | | also make functions thread safe.
* mac/events: move input ctx related functionality into new input helperder richter2024-03-143-31/+79
| | | | | preparation for mac/events cleanup and single responsibility principle. all functions are thread safe.
* mac/menu: add explicit menu type instead of an inferred typeder richter2024-03-071-45/+49
| | | | | with the use of an explicit type we can removed inferred type checks like separators/services menu by name or menus by sub configs.
* mac/menu: make menu creation recursive to allow nested submenusder richter2024-03-071-31/+31
| | | | also makes menu creation cleaner and more obvious.
* mac/menu: move conditional Bundle menu items into configder richter2024-03-071-11/+6
| | | | | | only add the "Show log File…" menu item config when invoked from the bundle, instead of testing on menu item creation. this is similar to the touch bar menu items now.
* mac/menu: keep track of menu items with dynamic actionsder richter2024-03-071-14/+8
| | | | | | keeping track of the dynamic menu items lets us directly access them by key. we don't need to search in the config array for the right config and menu item.
* mac/menu: merge file and url config propertiesder richter2024-03-071-15/+11
| | | | | a file path is basically an URL. both are also handled as URL objects in our code.
* mac/menu: properly guard playlist array accessder richter2024-03-071-2/+2
|
* mac/menu: attach menu config to menu item for direct accessder richter2024-03-071-27/+21
| | | | | add a config property to the menu items, so we don't need to search in the config array for the right config.
* mac/menu: replace app.command usage with event.commandder richter2024-03-071-2/+2
|
* mac/menu: fix touch bar menu itemder richter2024-03-071-6/+0
| | | | | | the check broke when the runtime check was removed, eg the menu item was never added to the menu. since we only add the menu item to the config when touch bar support is available the check is completely unnecessary.
* mac/menu: rename Preferences to Settings for consistency with macOSder richter2024-03-071-4/+4
|
* mac/menu: remove duplicate key assignment Undo/Zoomder richter2024-03-071-1/+1
| | | | this key is already assigned to Undo.
* mac/menu: optimise loading files functionder richter2024-03-071-7/+3
| | | | don't save files in a temporary array and use an in place mapping.
* mac/menu: replace deprecated openFile() usageder richter2024-03-071-8/+8
|
* mac/menu: remove unnecessary alert config fields and alertder richter2024-03-071-43/+10
| | | | | | | the config folder is created by mpv if it does not exist, so the last alert is unnecessary. also change config path priority.
* mac/menu: rewrite menu bar in swiftder richter2024-03-078-910/+472
|
* mac/app: remove unused functionder richter2024-03-072-7/+0
|
* osdep/mac: make mac naming of files, folders and function consistentder richter2024-02-2828-45/+45
| | | | | rename all macOS namings (osx, macosx, macOS, macos, apple) to mac, to make naming consistent.
* build: fix build when disabling cocoa-cbder richter2024-02-272-2/+2
| | | | | | | | | | the swift obj-c bridging header is only included when cocoa-cb is enabled. cocoa-cb is not the only swift feature anymore and disabling cocoa-cb leads to a runtime error that specific swift classes could not be found. include the swift obj-c bridging header in the case swift features are enabled.
* cocoa-cb: remove pre-allocation and initialise only when usedder richter2024-02-274-9/+24
| | | | | | | | | | | | | | | | | | | | | cocoa-cb was always pre-allocated in the Application itself because libmpv needs to be set up before usage, an opengl context has to be set and because it was decided mac specific code should be kept out of libmpv. this means that a completely working libmpv and opengl renderer was set up even if it wasn't used. leading to unnecessary log message, resources being used or reserved on the system that might not be used, triggering of dedicated GPU unnecessarily and many other things. even if not optimal, this wasn't the biggest problem since we only had that one working vo on macOS. though now that we have a vulkan gpu(-next) backend on macOS that was made the default, we always have that dangling cocoa-cb instance, which is completely unnecessary. move the cocoa-cb initialisation into libmpv preinit function and only init cocoa-cb when we are a standalone App and cocoa-cb support is build into.
* osdep/io: add mp_unlink()nanahi2024-02-252-0/+10
| | | | | | | | unlink() was never wrapped in win32, so all usages of it were referring the ANSI version of the function. This doesn't work properly for Windows versions before 1903 (where the UTF-8 codepage is requested). Fix this by adding mp_unlink() which wraps over _wunlink().
* mac: code consistency changesder richter2024-02-241-4/+0
|
* osdep/io: move I/O utility functions to misc/io_utilsnanahi2024-02-232-58/+0
| | | | | | | 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.
* osdep/io: ignore 'x' mode for mp_fopennanahi2024-02-231-2/+1
| | | | | | fopen() with 'x' mode is a non-portable glibc extension, is currently unused, and should not be used in order to maintain POSIX compatibility. Thus there is no need for the Windows wrapper mp_fopen() to support it.
* various: make mentions of macOS consistentder richter2024-02-212-2/+2
| | | | | change all mentions and variations of OSX, OS X, MacOSX, MacOS X, etc consistent. use the official naming macOS.
* osdep/threads-posix: fix headers for OpenBSD buildJose Maldonado aka Yukiteru2024-02-151-0/+5
| | | | | In OpenBSD the compilation fail because osdep/threads-posix.h need include pthread_np.h
* mac/remote: simplify cover retrievalder richter2024-02-151-3/+1
|
* mac/remote: remove unnecessary nowPlayingInfo variableder richter2024-02-151-14/+7
| | | | | no need to keep track of the nowPlayingInfo, MPNowPlayingInfoCenter already provides the current info.
* mac/remote: add album and artist infoder richter2024-02-152-3/+12
|
* mac/remote: add seek supportder richter2024-02-151-2/+14
| | | | Fixes #11233
* mac/remote: add chapter title infoder richter2024-02-153-4/+8
|
* mac/remote: add media-title infoder richter2024-02-152-3/+7
| | | | Fixes #11233
* mac/remote: add playback rate infoder richter2024-02-152-2/+6
| | | | also rate limit the position to update at max once per second.
* mac/remote: add duration and current position infoder richter2024-02-152-8/+26
| | | | Fixes #11233
* mac/remote: remove make current observer when stoppedder richter2024-02-151-0/+6
| | | | | | | | | | the observer is registered on every call of the start function. this could lead to several registered observers for the same event and several calls to the make current function, even though we only need it once per event. properly remove the observer on stop, so we only ever have one observer registered.
* mac/remote: replace command handler with generic handler function configder richter2024-02-151-15/+17
| | | | | preparation for the upcoming changes for new functionality not related to key handling.
* mac/remote: simplify repeatable key logicder richter2024-02-151-6/+2
|
* mac/remote: move configs to initialiser for new MediaPlayer shorthandsder richter2024-02-151-53/+56
|
* mac/remote: move class local struct and enum definition to extensionder richter2024-02-151-1/+3
| | | | | the class local struct and enum are moved to an extension to separate their definition and usage.
* mac/remote: use explicit struct instead of generic array for configsder richter2024-02-151-48/+31
| | | | | making the config explicit gets rid of some optional unwrapping. also rename some variables to better represent their values.
* osdep: fix infinite loop when cancelling subprocesssfan52024-02-111-1/+3
| | | | | Due to the state of the other fds/pipes it cannot safely be assumed that the loop breaks on its own.
* various: replace dead links in commentsnanahi2024-02-111-2/+4
| | | | | Replace various dead links with live replacements or archives. Less friction for anyone who wants to look up these references.
* io: add mp_save_fileKacper Michajłow2024-01-312-0/+30
| | | | Move from vo_gpu_next.c to io.c and return result.
* osdep/timer: update documentation and test for mp_time_nsKacper Michajłow2024-01-261-1/+1
| | | | No longer true after 8bbcc87feea7abf256a6c7f511244d09f5520c17.
* osdep/io: expand path before LoadLibraryKacper Michajłow2024-01-221-3/+17
| | | | | | Fixes compatibility with loading scripts from relative config paths. Fixes #13212
* terminal: don't print escape sequence if not ttyKacper Michajłow2024-01-151-2/+4
|
* terminal-unix: don't install handler before pipeNRK2024-01-151-4/+5
|
* terminal-unix: move all processing out of sighandlerNRK2024-01-151-23/+16
| | | | | | | | | | | | | | | | | | | commit fa9e1f06f tried to move signal unsafe operations out of signal handlers but mistakenly introduced a race. before, sigtstop would process the following in order: 0. do_deactivate_getch2(); 1. raise(SIGTSTP) that commit moved 0 out of the signal handler (due to it being unsafe) but kept 1 in there. this may mess up the ordering of these operations. this commit moves everything out of the handler so that things happen in proper order. since things are now moved out of the handler, SA_RESETHAND is no longer being applied to SIGTSTP. since that can result in races if multiple signals are delivered faster than we can respond to them.
* terminal-unix: don't set `SA_RESETHAND` for SIGTERM/SIGQUITllyyr2024-01-141-2/+2
| | | | | | | | | | | | | | | | | | | | This can cause mpv to abruptly quit without following the proper uninit process when a second `SIGTERM` or `SIGQUIT` is sent and mpv didn't quit on the first one already. This is because the default action for these signals is to terminate the program immediately, similar to `SIGKILL`, and `SA_RESETHAND` resets the `quit_request_sighandler` to `SIG_DFL` for the default action. Also keep the `SA_RESETHAND` flag for SIGINT because the current behavior is to quit after receiving two Ctrl+C no matter what, this is probably convenient and worth keeping. This change is because some tools (e.g. GNU timeout) send SIGTERM twice after the timeout period. An easy way to reproduce is with `timeout 1 mpv [...]` where mpv would quit abruptly anywhere from half the time to once every 50 attempts depending on your luck.
* various: use correct PATH_MAX for win32sfan52023-12-274-11/+28
| | | | | | | | In commit c09245cdf2491211f3e0bfe47f28cc0e0a2e05c8 long-path support was enabled for mpv without actually making sure that there was no code left that used the old limit (260 Unicode chars) for buffer sizes. This commit fixes all but one case.
* osdep: clarify and rename a constant on win32sfan52023-12-271-3/+5
| | | | This is about the maximum filename not path length.
* various: fix capitalization of 'GitHub'Ikko Eltociear Ashimine2023-12-271-1/+1
|
* win32: opt in to the windows segment heapAndarwinux2023-12-221-0/+1
| | | | | | | ref: https://learn.microsoft.com/en-us/windows/win32/sbscs/application-manifests#heaptype Improves demuxer cache recycling speed at the cost of a slight CPU usage increase. SegmentHeap is supported in Windows 10, version 2004 (build 19041) and later.
* win32: support long file pathsstax762023-12-211-0/+1
|
* terminal-unix: enable the cursor after ctrl+zGuido Cella2023-12-181-0/+2
| | | | | | | 24270b8587 disabled the cursor while mpv is running, but if you send mpv to the background, it is not re-enabled until you run bg, and not even after that if mpv is paused. Fix this by enabling the cursor from the SIGTSTP handler.
* mac: add support for drag-and-drop optionder richter2023-12-152-0/+15
|
* win32: properly handle WM_XBUTTONUP and WM_XBUTTONDOWNnanahi2023-12-061-0/+2
| | | | | | | | | | | | | | | | According to MS documentation, an application should return TRUE from WM_XBUTTONUP and WM_XBUTTONDOWN if it processes these messages. DefWindowProc generates the WM_APPCOMMAND message when it processes the WM_XBUTTONUP message, so if an application properly handles WM_XBUTTONUP messages, extra WM_APPCOMMAND messages won't be generated. Because mpv doesn't properly handle these messages, WM_XBUTTONUP causes APPCOMMAND_BROWSER_BACKWARD to be generated, resulting in duplicated keys and improper fix 438ead7a, which prevents the processing of the appcommand from sources other than mouse clicks. Fix this by following the documentation, and the back and forward appcommands can be added.
* mac: report modifier keys on precise scrollingder richter2023-12-021-2/+23
| | | | | | modifier keys weren't reported when using the trackpad to scroll. Fixes #11195
* Reapply "osdep/meson: add libplacebo include dir to swift compile"Dudemanguy2023-11-271-1/+3
| | | | | | | It's not actually related to libplacebo wrap stuff and the swift compile command needs this to get the right libplacebo include path. This reverts commit b9d392ecd9543aecdfd6e6a06aa2f9585950ac27.
* Revert "osdep/meson: add libplacebo include dir to swift compile"Dudemanguy2023-11-271-3/+1
| | | | | | | This is not needed since we removed the libplacebo wrap not too long after this commit. This reverts commit 4de76ce87a545cd86ef493129b4cfeafe10e8e98.
* mac: fix libmpv usage without embeddingder richter2023-11-254-20/+9
| | | | | | | | | | | NSApp is only an Application when initialised from mpv itself. when used via libmpv an Application is never initialised and mpv would always immediately exit. make the retrieval of the vo and mac options static so they can be retrieved in all cases. Fixes #12518
* mac: cleanup some unused and unneeded cod