summaryrefslogtreecommitdiffstats
path: root/osdep
Commit message (Collapse)AuthorAgeFilesLines
* osx: drop support for OS X 10.7 and earlierAkemi2017-02-272-31/+0
|
* cocoa: fix dragging out of focus windowAkemi2017-02-211-0/+1
| | | | | | | | | | fffab30 introduced a small regression where the cursor couldn't be unhidden after refocusing. the problem is that no mouseUp event was reported in our events_view. work around this with a separate event monitor. this also fixes another regression when the window is being dragged from the title bar. #4174
* osx: improve bundle handlingAkemi2017-02-161-50/+5
| | | | | | | | | | | | | | | | | we have two problems here. first when mpv is started from the bundle it uses its own environment variables and possibly can't find for example the youtube-dl binary for our youtube-dl hook. second we couldn't reliable determine when mpv was started from the bundle, which led to the pseudo-gui usage even when the binary was invoked from a shell. to prevent this we will wrap the bundle binary with a shell script, which will only be called when we start mpv from the bundle. this way we can get the same environment variables, like $PATH, for our bundle and additional we can set the pseudo-gui only when started through this script. it is also possible to detect the bundle usage properly and accurately through the usage of another environment var. Fixes #2061
* cocoa: gracefully quit from the Dock's context menuAkemi2017-02-161-4/+10
| | | | | | | | | | | | quitting mpv from the Dock's context menu leaves the shell in a bad state where you can't see your input any more and other weirdnesses. in a big refactor (afdc9c4) the method to handle this case was actually copied over but the the code to register the event itself was removed or forgotten by accident, leaving some lines of dead code. i re-added the event and slightly adjusted the function. the function was slightly changed so the head of it is consistent with our other events and it is associated with this commit and functionality in the future.
* atomic: remove __atomic builtin usagewm42017-02-131-30/+7
| | | | | | | | Using these was a temporary solution while some compilers implemented the underlying atomic mechanisms, but not the C11 language parts (or that's what I guess). Not really useful for us anymore. Also, there is the slight risk of having subtly incorrect semantics by using potentially changing compiler internals and such.
* vo_opengl: angle: rewrite with custom swap chainJames Ross-Gowan2017-02-071-0/+8
| | | | | | | | | | | | | This replaces the old backend that exclusively used EGL windowing with one that can also use ANGLE's ability to render to directly to a texture. The advantage of this is that it allows mpv to create the swap chain itself and this allows mpv to use a flip-mode swap chain on a HWND (which avoids problems with DirectComposition) and to use a longer swap chain that has six backbuffers by default (which reportedly fixes problems with rendering 24fps video on 24Hz monitors.) Also, "screenshot window" should now work on DXGI 1.2 and up (Windows 8 and up.)
* win32: add COM-specific SAFE_RELEASE to windows_utils.hJames Ross-Gowan2017-01-301-0/+4
| | | | | | | | | | | | | | | See: https://msdn.microsoft.com/en-us/library/windows/desktop/dd743946.aspx Microsoft example code often uses a SAFE_RELEASE macro like the one in the above link. This makes it easier to avoid errors when releasing COM interfaces. It also reduces noise in COM-heavy code. ao_wasapi.h also had a macro called SAFE_RELEASE, though unlike the version above, its SAFE_RELEASE macro accepted a second parameter which allowed it to destroy arbitrary objects other than just COM interfaces. This renames ao_wasapi's SAFE_RELEASE to SAFE_DESTROY, which should more accurately reflect what it does and prevent confusion with the Microsoft version.
* atomic: drop __sync builtinswm42017-01-271-19/+0
| | | | | | | | | | The correctness of the stdatomic.h emulation via the __sync builtins is questionable, and we've been relying on exact stdatomic semantics for a while, so just get rid of it. Compilers which support __sync but not stdatomic.h will use to the slow mutex fallback. Not sure about the __atomic builtins. It doesn't seem to harm either, so leave it for now.
* Update copyright yearwm42017-01-011-1/+1
| | | | What kind of bullshit forces you to do this every year anyway.
* cocoa: cosmetic fixesAkemi2016-12-162-6/+11
|
* cocoa: fullscreen refactoringAkemi2016-12-151-0/+1
| | | | | | | | | | this replaces the old fullscreen with the native macOS fullscreen. additional the --fs-black-out-screens was removed since the new API doesn't support it in a way the old one did. it can possibly be re-added if done manually. Fixes #2857 #3272 #1352 #2062 #3864
* cocoa: support append file to paylist on dropAkemi2016-12-141-1/+4
| | | | | | | | | When dropping a file on mpv, either on the window or the App bundle icon, while holding the shift key the dropped files will be appended to the playlist. Fixes #2166
* osx: update the menu and remove conflicting itemAkemi2016-12-121-7/+5
| | | | | | | | | | | Remove 'Quit mpv & remember playback position' from the menu because it conflicts with the global logout shortcut. add separator between 'Hide' and 'Quit' for consistency with other Apps. also rename the 'Movie' menu to 'Video'. it's a bit more generic. Fixes #3865
* win32: fix some Clang warningsJames Ross-Gowan2016-11-171-3/+3
| | | | | | | | - win32-console-wrapper.c was inconsistently using the explicit Unicode versions of some Windows API functions and structures. - vo.c should use llabs for int64_t, since long is 32-bit on Windows. - vo_direct3d.c had a potential use of an uninitialized variable if it took the first goto error_exit.
* build: fix compilation with mingw-w64/ClangJames Ross-Gowan2016-11-171-1/+1
| | | | | | | | | | This fixes the build in mingw-w64/Clang on MSYS2. It also disables the use of gnu_printf in Clang, which was what was causing most of the warnings. The Clang-compiled mpv binary appears to work, but there are no guarantees yet, since until now mpv has only been tested with mingw-w64/GCC on Windows. Fixes #3800
* terminal-win: support modifier keys in console inputJames Ross-Gowan2016-10-141-2/+14
| | | | | | | | | | | | | | | | | Keyboard input in the console still isn't quite as flexible as it is in the video window. Ctrl+<letter> and Ctrl+LEFT/RIGHT work, but Ctrl+Alt+<letter> and Ctrl+<number> do not. Also, in the new Windows 10 console, a bunch of Ctrl keystrokes including Ctrl+UP/DOWN are handled by the console window and not passed to the application. Unlike in w32_common.c, we can't really translate keyboaard input ourselves because the keyboard layout of the console window (in conhost.exe) doesn't necessarily match the keyboard layout of mpv's console input thread, however, using ToUnicode as a fallback when the console doesn't return a unicode value could be a possible future improvement. Fixes #3625
* terminal-win: clean up console inputJames Ross-Gowan2016-10-141-49/+33
| | | | | | | | | | | | | | | | | | | | | | The original version of this code in getch2-win.c fetched 128 console events at once. This was probably to maximize the chance of getting a key event if there were other events in the buffer, because it returned the value of the first key event it found and ignored all others. Since that code was written, it has been modified to receive console input in an event-based way using an input thread, so it is probably not necessary to fetch so many events at once any more. Also, I'm not sure what it would have done if there were more than 128 events in the console input buffer. It's possible that fetching multiple events at a time also had performance advantages, but I can't find any other programs that do this. Even libuv just fetches one console event at a time. Change read_input() to fetch only one event at a time and to consume all available events before returning to WaitForMultipleObjects. Also remove some outdated comments and pass the console handle through to the input thread instead of calling GetStdHandle multiple times (I think this is theoretically more correct because it is possible for the handles returned by GetStdHandle to be changed by other threads.)
* win32: build with -DINITGUIDJames Ross-Gowan2016-09-281-1/+0
| | | | | | | | | | | | We always want to use __declspec(selectany) to declare GUIDs, but manually including <initguid.h> in every file that used GUIDs was error-prone. Since all <initguid.h> does is define INITGUID and include <guiddef.h>, we can remove all references to <initguid.h> and just compile with -DINITGUID to get the same effect. Also, this partially reverts 622bcb0 by re-adding libuuid.a to the build, since apparently some GUIDs (such as GUID_NULL) are not declared in the source file, even when INITGUID is set.
* player: do not let pseudo-gui override user config settingswm42016-09-231-2/+4
| | | | | | | | Seems like this confused users quite often. Instead of --profile=pseudo-gui, --player-operation-mode=pseudo-gui now has to be used to invoke pseudo GUI mode. The old way still works, and still behaves in the old way.
* cocoa: fix macOS 10.12 deprecation warningsAkemi2016-09-223-9/+42
|
* player: make --terminal freetly settable at runtimewm42016-09-192-4/+3
| | | | | | | | | | | | | | | | | | | So client API users don't have to care about whether to set this before or after mpv_initialize(). We still don't enable terminal at any point before mpv_initialize(), because reasons. This also subtly changes some behavior how terminal options are applied while parsing. This essentially reverts the behavior as it was reported in issue #2588. Originally, I was hoping to get rid of the pre-parse option pass, but it seems this is absolutely not possible due to the way config and command line parsing are entangled. Command line options take priority over configfile options, so they have to be applied later - but we also want to apply logging and terminal options as specified on the command-line, but _before_ parsing the config files. It has to be this way to see config file error messages on the terminal, or to hide them if --no-terminal is used. libmpv considerations also factor into this.
* terminal-unix: don't send quit command on terminal_uninit()wm42016-09-191-4/+8
| | | | | | | | | | | | Until now, the terminal thread always sent a quit command if the terminal thread was torn down (whether it happened via terminal_uninit() or a quit signal). This is not so good if we want to enable toggling terminal use at runtime, since disabling the terminal would always make the player quit. So we want terminal_uninit() not to send quit. This can be easily fixed by using the "death byte" sent to the pipe used for thread tear-down to indicate whether it was caused by a signal or terminal_uninit().
* osdep: rename atomics.h to atomic.hwm42016-09-072-3/+3
| | | | | The standard header is stdatomic.h, so the extra "s" freaks me out every time I look at it.
* atomics: readd some emulationwm42016-09-061-0/+43
| | | | | | | | | | | This time it's emulation that's supposed to work (not just dummied out). Unlike the previous emulation, no mpv code has to be disabled, and everything should work (albeit possibly a bit slowly). On the other hand, it's not possible to implement this kind of emulation without compiler support. We use GNU statement expressions and __typeof__ in this case. This code is inactive if stdatomic.h is available.
* build: always require atomicswm42016-08-051-21/+8
| | | | | | | | | | | | | | | Always require them, instead of just for some components which have hard requirements on correct atomic semantics. They should be widely available, and are supported by all recent gcc and clang compiler versions. We even have the fallbacks builtins, which should keep this working on very old gcc releases. In particular, w32_common.c recently added a hard requirement on atomics, but checking this properly in the build system would have been messy. This commit makes sure it always works. The fallback where weak atomic semantics are always fine is in theory rather questionable as well.
* osdep/io: introduce mp_flush_wakeup_pipe()Rostislav Pehlivanov2016-07-302-0/+9
| | | | Makes a fairly common occurence with wakeup_pipes easier to handle.
* Use - as command-name separator everywhereTimotej Lazar2016-07-141-1/+1
| | | | | | | Old-style commands using _ as separator (e.g. show_progress) were still used in some places, including documentation and configuration files. This commit updates all such instances to the new style (show-progress) so that commands are easier to find in the manual.
* win32: mpv.rc: re-add version infoJames Ross-Gowan2016-07-121-7/+25
| | | | | | | | | | | | | | | | For some reason, the lack of version info was preventing mpv from appearing in the Default Programs dialog. Re-add it, but don't set the string version numbers from version.h, because that's what was causing trouble when the version info was removed. Like the binary version numbers, these are now hardcoded to 2.0.0.0, which probably doesn't matter. The new version info block is also slightly different to the old one. It fills out all the binary VERSIONINFO fields and makes better use of macros. It also removes the \000 line terminators from the string version info, since as far as I can tell, this was just cargo-culting for an old broken version of the Microsoft resource compiler, and binutils' windres terminates the strings properly without them.
* subprocess: add a callback to ignore outputBen Boeckel2016-07-052-0/+6
| | | | This callback is equivalent to shoving data into /dev/null.
* Fix misspellingsstepshal2016-06-262-5/+5
|
* build: silence -Wunused-resultNiklas Haas2016-06-071-3/+3
| | | | | | | | For clang, it's enough to just put (void) around usages we are intentionally ignoring the result of. Since GCC does not seem to want to respect this decision, we are forced to disable the warning globally.
* win32: pthread: use SRW locks by defaultwm42016-05-242-20/+33
| | | | | | | | | SRW locks are available since Windows Vista. They work essentially like Linux futexes. In particular, they can be statically initialized, and do not require deinitialization. This makes them ideal for implementing PTHREAD_MUTEX_INITIALIZER. We still need CRITICAL_SECTION for recursive mutexes.
* mpv.rc: remove most contentswm42016-03-141-21/+0
| | | | In particular remove version.h to deal with my temporary build problem.
* glob-win: relicense to LGPLJames Ross-Gowan2016-02-181-7/+7
| | | | | | This file was rewritten from scratch in 0cef033, so it should be okay. As mentioned in #730, it's a complete rewrite referencing only MSDN and POSIX, rather than the original code.
* windows_utils: try and use FormatMessage for errors.Kevin Mitchell2016-02-172-3/+23
| | | | | | This is useful in particular for GetLastError, unfortunately, it's stil pretty dumb with regards to WASAPI or D3D specific errors, so keep the hresult_to_string switch.
* dxva2: use mp_HESULT_to_str on FAILED(hr)Kevin Mitchell2016-02-161-0/+35
|
* cocoa: fix charcode retrieving for accented charactersAlexis Nootens2016-02-151-1/+2
| | | | | The handler was retrieving an invalid charcode for accented characters, thus ignoring them.
* Initial Android supportJan Ekström2016-02-103-0/+102
| | | | | * Adds an 'android' feature, which is automatically detected. * Android has a broken strnlen, so a wrapper is added from FreeBSD.
* build: make posix_spawn optionalwm42016-02-081-0/+12
| | | | OK, Android doesn't support it.
* Relicense some non-MPlayer source files to LGPL 2.1 or laterwm42016-01-1912-84/+85
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This covers source files which were added in mplayer2 and mpv times only, and where all code is covered by LGPL relicensing agreements. There are probably more files to which this applies, but I'm being conservative here. A file named ao_sdl.c exists in MPlayer too, but the mpv one is a complete rewrite, and was added some time after the original ao_sdl.c was removed. The same applies to vo_sdl.c, for which the SDL2 API is radically different in addition (MPlayer supports SDL 1.2 only). common.c contains only code written by me. But common.h is a strange case: although it originally was named mp_common.h and exists in MPlayer too, by now it contains only definitions written by uau and me. The exceptions are the CONTROL_ defines - thus not changing the license of common.h yet. codec_tags.c contained once large tables generated from MPlayer's codecs.conf, but all of these tables were removed. From demux_playlist.c I'm removing a code fragment from someone who was not asked; this probably could be done later (see commit 15dccc37). misc.c is a bit complicated to reason about (it was split off mplayer.c and thus contains random functions out of this file), but actually all functions have been added post-MPlayer. Except get_relative_time(), which was written by uau, but looks similar to 3 different versions of something similar in each of the Unix/win32/OSX timer source files. I'm not sure what that means in regards to copyright, so I've just moved it into another still-GPL source file for now. screenshot.c once had some minor parts of MPlayer's vf_screenshot.c, but they're all gone.
* mpv_talloc.h: rename from talloc.hDmitrij D. Czarkoff2016-01-115-5/+5
| | | | This change helps avoiding conflict with talloc.h from libtalloc.
* ao_wasapi: move out some utility functionswm42016-01-112-0/+126
| | | | | | Note that hresult_to_str() (coming from wasapi_explain_err()) is mostly wasapi-specific, but since HRESULT error codes are unique, it can be extended for any other use.
* win32: fix fd://James Ross-Gowan2016-01-071-0/+7
| | | | | | | | Windows definitely supports Unix-style fd inheritance. This mostly worked when launched from mpv.exe, though mpv should change the file mode to O_BINARY. When launched from mpv.com, the wrapper must pass the list of handles (stored in the undocumented lpReserved2 and cbReserved2 fields) to the mpv process.
* Update copyright yearwm42016-01-011-1/+1
| | | | Merry christmas, or whatever the fuck is going on right now.
* path-win: include initguid.hKevin Mitchell2015-12-201-0/+1
| | | | cygwin was giving undefined reference to `FOLDERID_Desktop' at link time
* win32: add Windows 10 compatibility GUIDJames Ross-Gowan2015-12-201-0/+2
| | | | | This suppresses the Program Compatibility Assistant on Windows 10. mpv is regularly tested on Windows 10, so this should be okay.
* win32: path: use Known Folder IDsJames Ross-Gowan2015-12-201-7/+9
| | | | | | CSIDLs have been deprecated in Windows Vista and are not recommended for use in new code. They have been replaced with Known Folder IDs, which are pretty much the same thing, except they use GUIDs.
* win32: use PIPE_REJECT_REMOTE_CLIENTSJames Ross-Gowan2015-12-201-1/+2
| | | | | This partially reverts c670488. mpv only supports Vista and up, so this flag is fine.
* win32: remove ProcThreadAttributeList dynamic loadingJames Ross-Gowan2015-12-201-36/+6
| | | | | These are always available in supported Windows versions, as is the EXTENDED_STARTUPINFO_PRESENT flag.
* win32: remove SetDllDirectoryW dynamic loadingJames Ross-Gowan2015-12-201-4/+1
| | | | All Windows versions we support have this API.
* win32: fix console output with raw stdio functionsJames Ross-Gowan2015-12-061-8/+7
| | | | | | | | | | | | | | | | reopen_console_handle() was never properly tested because mpv overrides printf in most source files. Turns out that when there's no console on startup, the CRT sets the fds of stdout and stderr to -2, so the old method of using dup2 to manipulate these fds didn't work. As far as I can tell, the only way to give stdout and stderr valid fds is to use freopen, so this uses freopen to set them both to the console output. This also uses dup2 to change STDOUT_FILENO and STDERR_FILENO, so low- level functions like isatty still work. Note that this means fileno(stdout) != STDOUT_FILENO. I don't think this will cause any problems. This should fix MPV_LEAK_REPORT on the Windows console.
* input: add append argument to file drop eventKevin Mitchell2015-08-301-1/+1
| | | | | | This puts in place the machinery to merely append dropped file to the playlist instead of replacing the existing playlist. In this commit, all front-ends set this to false preserving the existing behaviour.
* atomics: cleanup HAVE_ATOMICS definewm42015-08-131-5/+0
| | | | | | | The waf build system generates this already. No point in redoing it in the header file. The legacy build system (which we really should drop) didn't; fix it.
* terminal: disable terminal foreground state pollingwm42015-08-011-2/+1
| | | | | | | This was originally done for zsh; but zsh can manage the terminal state correctly when foregrounding/backgrounding applications if you enable it with "ttyctl -f". So I see no reason to wake up the mpv process once every second anymore.
* win32: revert wchar_t changeswm42015-08-014-21/+21
| | | | | | | | | | | Revert "win32: more wchar_t -> WCHAR replacements" Revert "win32: replace wchar_t with WCHAR" Doing a "partial" port of this makes no sense anymore from my perspective. Revert the changes, as they're confusing without context, maintenance, and progress. These changes were a bit premature anyway, and might actually cause other issues (locale neutrality etc. as it was pointed out).
* win32: more wchar_t -> WCHAR replacementswm42015-07-301-1/+1
| | | | | | | | | | | | | This was essentially missing from commit 0b52ac8a. Since L"..." string literals have the type wchar_t[], we can't use them for UTF-16 strings. Use C11 u"..." string literals instead. These have the type char16_t[], but we simply assume char16_t is the same underlying type as WCHAR. In practice, they're both unsigned short. For this reason use -std=c11 on Windows. Since Windows is a "special" environment (we require either MinGW or Cygwin), we don't need to worry too much about compiler compatibility.
* win32: replace wchar_t with WCHARwm42015-07-293-20/+20
| | | | | | | |