summaryrefslogtreecommitdiffstats
path: root/osdep
Commit message (Collapse)AuthorAgeFilesLines
* terminal-win: support mouse input eventsnanahi26 hours1-29/+74
| | | | | The mouse input information is available from the INPUT_RECORD with MOUSE_EVENT event type.
* terminal-win: implement terminal_get_size2nanahi26 hours1-1/+21
| | | | | | 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.
* terminal-win: implement terminal_set_mouse_inputnanahi26 hours1-0/+7
|
* terminal: add terminal_set_mouse_input functionnanahi26 hours3-0/+13
| | | | This function is used to enable/disable mouse input for win32 and unix.
* terminal-unix: style fixnanahi26 hours1-2/+2
|
* terminal-unix: ignore unhandled mouse CSI sequencesnanahi26 hours1-0/+7
| | | | | | | | 21d434d2dbadf91d7bd2089ca1ca92c2d918b114 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.
* terminal-unix: support mouse escape codesnanahi26 hours2-2/+43
| | | | | | | | 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.
* mac/log: fix use after free when freeing mpv handleder richter6 days2-2/+8
| | | | | | | | | | | | | | | | | 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
* mac/vulkan: add support for frame timing via presentation feedbackder richter8 days6-5/+82
|
* win32: change fputs to fwrite wrapperKacper Michajłow11 days5-17/+24
| | | | | | | | | 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: fc55f355fc8225328cf0472e3deb4021eba96303
* vo_tct: add synchronized output supportKacper Michajłow11 days1-0/+2
| | | | See-Also: https://gist.github.com/christianparpart/d8a62cc1ab659194337d73e399004036
* terminal-win: add more control codes support in non-VT modeKacper Michajłow11 days1-6/+76
| | | | And skip unsupported private sequences, instead of printing them.
* mac/remote: use event type as key state for proper mapping in functionder richter2024-04-041-4/+3
| | | | | | | 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.
* mac/apphub: fix opening several files at once via Finder or App iconder richter2024-04-042-6/+12
| | | | | | | | | | | 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.
* mac/app: add some verbose logging for app startup and file handlingder richter2024-04-012-0/+8
|
* mac/apphub: only instantiate log and option when in Application modeder richter2024-04-011-4/+6
| | | | | | 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.
* mac/menu: remove redundant quit func and use identical command funcder richter2024-04-011-7/+2
|
* mac/app: cleanup and optimise App launch and terminationder richter2024-04-012-52/+26
| | | | | | | | | | | | 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
* mac/apphub: move opening url into AppHubder richter2024-04-012-11/+14
|
* mac/app: use new open url App event to simplify open file event handlingder richter2024-04-011-38/+12
| | | | | | | | | | | | | this event has several advantages, it unifies the mpv:// url handling, the dropping of files on the App icon and opening via finder into one event, and it also lets us remove the file open workaround. we had to keep track of opened files via the command line because the event was also triggered by passed files on the command line, leading to redundant load events. the new event doesn't trigger from files passed via the command line anymore.
* mac/log: fallback to system logger if no mp_log is yet availableder richter2024-04-012-1/+18
| | | | | | | | | | since cocoa is initialising mpv and does several things before the mpv core does anything and the mpv_handle was passed to the App, this can be used to log such things before the mpv logging is available. helpful for debugging especially bundle related things. the logger mapping looks a bit unintuitive but error is basically yellow what our warning is and fatal is red what our error is.
* mac/app: rewrite App c main function, startup and termination in swiftder richter2024-04-019-201/+96
| | | | | also move main invocation into AppHub and completely delete the old Application c implementation.
* mac/app: rewrite Application class in swiftder richter2024-04-013-99/+106
|
* mac: cleanup swift bridge header imports and unify themder richter2024-03-2911-65/+48
|
* mac/apphub: make DnD behaviour on bundle icon configurableder richter2024-03-291-0/+3
| | | | | we just need to add a OptionHelper to the AppHub, options were already tried to read from the optional OptionHelper.
* mac/log: rename log functions and cleanup classder richter2024-03-293-17/+17
|
* mac: use LogHelper directly instead of mp_logder richter2024-03-291-2/+2
|
* mac: rename mpvHandle to mpvder richter2024-03-292-9/+9
|
* mac: remove now unnecessary objective-c forwardingder richter2024-03-294-8/+7
|
* mac/apphub: move cocoa-cb into AppHubder richter2024-03-293-21/+9
|
* mac/apphub: move menu bar into AppHubder richter2024-03-294-11/+11
|
* mac/app: remove unused Application flagder richter2024-03-291-6/+0
|
* mac/apphub: move mac options into AppHubder richter2024-03-298-85/+91
|
* mac/apphub: move app icon into AppHubder richter2024-03-298-20/+44
| | | | | split up AppHub header in obj-c and c parts and make it a bidirectional bridging.
* mac: cleanup mac headers and include preprocessorsder richter2024-03-293-12/+2
|
* mac/event: only initialise an EventHelper when necessaryder richter2024-03-242-4/+12
|
* mac/touchbar: use AppHub directly instead of the singletonder richter2024-03-241-2/+3
|
* mac/remote: use AppHub directly instead of the singletonder richter2024-03-241-2/+3
|
* mac/touchbar: use EventHelper for event handlingder richter2024-03-244-66/+22
| | | | also remove remaining old event handling.
* mac/touchbar: move touch bar into AppHubder richter2024-03-242-1/+7
|
* mac/remote: use EventHelper for event handlingder richter2024-03-242-50/+37
|
* mac/touchbar: fix devision by 0der richter2024-03-241-1/+1
|
* mac/remote: fix devision by 0der richter2024-03-241-1/+1
|
* cocoa-cb: use EventHelper for event handlingder richter2024-03-242-18/+11
|
* cocoa-cb: use a separate mpv_handle for cocoa-cb to simplify shutdownder richter2024-03-243-22/+12
|
* mac/apphub: migrate remaining events functionality to new AppHubder richter2024-03-2410-219/+161
| | | | | | | | 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.
* mac/event: add helper to subscribe to mpv events and property changesder richter2024-03-242-0/+166
| | | | | preparation to remove duplicate code from all classes that implement their own observer loops.
* mac/libmpv: remove unused functionsder richter2024-03-211-37/+0
|
* mac/option: remove now unused computed option variablesder richter2024-03-211-1/+0
|
* mac/option: rename option structs to properly represent their contentder richter2024-03-214-35/+29
| | | | also optimise option cache setup.
* mac/libmpv: remove mac option handling in favour of option handlerder richter2024-03-211-14/+0
| | | | | | since the option handler is not optional anymore and available on init in cocoa-cb we don't need to duplicate this functionality in libmpv anymore.
* mac/option: make option helper none optionalder richter2024-03-211-1/+1
| | | | gets rid of some unwrapping boilerplate and nil coalescing operators.
* mac/option: make option helper vo struct independentder richter2024-03-211-6/+3
|
* mac/option: optimise option pointer accessder richter2024-03-211-3/+4
|
* mac/option: remove unused and obsolete variablesder richter2024-03-211-6/+1
|
* mac/option: move option functionality from mpv helper to option helperder richter2024-03-213-8/+8
| | | | delete now empty mpv helper
* mac/type: move c<>swift type bridging into a dedicated type helperder richter2024-03-216-70/+88
|
* win32: increase hires timer resolutionnanahi2024-03-193-21/+38
| | | | | | | | | | | 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.
* win32: avoid multi byte string to wide conversion if not neededKacper Michajłow2024-03-191-5/+18
|
* win32: add puts/fputs wrappersKacper Michajłow2024-03-195-14/+64
|
* win32: optimize mp_vfprintf a littleKacper Michajłow2024-03-194-23/+36
| | | | | | | | - remove redundant strlen/wcslen - reuse allocated temporary buffers The difference is not big, but it satisfies me to remove those redundancies.
* win32: cache GetConsoleMode state for stdout/stderrKacper Michajłow2024-03-193-31/+42
| | | | | | | GetConsoleMode() can be quite slow and in mpv the mode never changes, so we can just check it once. Fixes performance when writing lots of logs to terminal.
* win32: don't touch buffering optionsKacper Michajłow2024-03-191-1/+0
|
* win32-console-wrapper: fix printf specifiersKacper Michajłow2024-03-191-1/+1
| | | | | | | | | | | %s is evaluated as wchar_t only in "Windows classic" semantic. It is not C standard compliant. %ls is compatible with both and means the same wchar_t format. This commit fixes error output from mpv.com. See: https://devblogs.microsoft.com/oldnewthing/?p=102823
* win32: don't pass std handles if they are attached to consoleKacper Michajłow2024-03-191-15/+20
| | | | | | | | | | | This is default behavior to attach to existing console, passing custom handles is useful if we want to replace them, but in case they are already attached to console we want to attach to console directly. In theory, it should work out of the box because "console-like" handles should be managed by Windows internally, which works for INPUT and OUTPUT, but in certain cases, not for ERROR. This allows using VT features in those cases for stderr too.
* Revert "osdep/io: ignore 'x' mode for mp_fopen"nanahi2024-03-191-1/+2
| | | | | | | | | This flag is a GNU extension in C99, but was standardrized in C11, so mpv should be able to use it. fopen is wrapped on win32 so non-compliant MSVCRT.dll isn't a concern. Since the upcoming commit uses this feature it can be brought back. This reverts commit c36e051470dceb24c75d36316490e063a77dacba.
* win32: implement shell link target resolvingnanahi2024-03-192-0/+26
| | | | | Adds a function to resolve the target of a shell link (Windows shortcut) for use by other parts of mpv.
* 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
| | | | |