aboutsummaryrefslogtreecommitdiffhomepage
path: root/osdep
Commit message (Collapse)AuthorAge
* input: rework how input sources are addedGravatar wm42013-12-21
| | | | | | | | | | | | | | Until now, there were two functions to add input sources (stuff like stdin input, slave mode, lirc, joystick). Unify them to a single function (mp_input_add_fd()), and make sure the associated callbacks always have a context parameter. Change the lirc and joystick code such that they take store their state in a context struct (probably worthless), and use the new mp_msg replacements (the point of this refactoring). Additionally, get rid of the ugly USE_FD0_CMD_SELECT etc. ifdeffery in the terminal handling code.
* osdep/priority: drop message output when setting priorityGravatar wm42013-12-21
|
* terminal: abstract terminal color handlingGravatar wm42013-12-20
| | | | | | | | Instead of making msg.c an ifdef hell for unix vs. windows code, move the code to separate functions defined in terminal-unix.c/terminal- win.c. Drop the code that selects random colors for --msgmodule prefixes.
* terminal: move SIGTTOU signal handler setup codeGravatar wm42013-12-19
| | | | | | This comes with a real change in behavior: now the signal handler is set only when the terminal input code is active (e.g. not with --no-consolecontrols), but this should be ok.
* Rename getch2....c/h to terminal....c/hGravatar wm42013-12-19
| | | | | "getch2" really tells nothing about what the heck this code does. It'd be even worse when moving the rest of terminal handling code there.
* Reduce recursive config.h inclusions in headersGravatar wm42013-12-18
| | | | | | In my opinion, config.h inclusions should be kept to a minimum. MPlayer code really liked including config.h everywhere, though, even in often used header files. Try to reduce this.
* stream: move O_BINARY dummy definitionGravatar wm42013-12-18
|
* Fix OSX build; remove all remaining mpvcore referencesGravatar 11rcombs2013-12-17
|
* Split mpvcore/ into common/, misc/, bstr/Gravatar wm42013-12-17
|
* Merge mp_talloc.h into ta/ta_talloc.hGravatar wm42013-12-17
|
* Move options/config related files from mpvcore/ to options/Gravatar wm42013-12-17
| | | | | | | | | Since m_option.h and options.h are extremely often included, a lot of files have to be changed. Moving path.c/h to options/ is a bit questionable, but since this is mainly about access to config files (which are also handled in options/), it's probably ok.
* Move mpvcore/input/ to input/Gravatar wm42013-12-17
|
* Replace mp_tmsg, mp_dbg -> mp_msg, remove mp_gtext(), remove set_osd_tmsgGravatar wm42013-12-16
| | | | | | | | | The tmsg stuff was for the internal gettext() based translation system, which nobody ever attempted to use and thus was removed. mp_gtext() and set_osd_tmsg() were also for this. mp_dbg was once enabled in debug mode only, but since we have log level for enabling debug messages, it seems utterly useless.
* macosx_events: fix null dereference on uninitGravatar Stefano Pigozzi2013-12-07
| | | | | | | Bug introduced by commit 6fb020f5. It doesn't always happen, since it is caused by the playloop and cocoa UI code running in separate threads. Fixes #398.
* options: add option to disable using right Alt key as Alt GrGravatar Vivek Jain2013-12-02
| | | | | | | | | mpv was hardcoded to always consider the right Alt key as Alt Gr, but there are parituclar combinations of platforms and keyboard layouts where it's more convenient to treat the right Alt as a keyboard modifier just like the left one. Fixes #388
* osdep/io: also include unistd.hGravatar wm42013-11-30
| | | | Might be needed by fcntl() usage.
* Use O_CLOEXEC when creating FDsGravatar wm42013-11-30
| | | | | | | | | | | | | | This is needed so that new processes (created with fork+exec) don't inherit open files, which can be important for a number of reasons. Since O_CLOEXEC is relatively new (POSIX.1-2008, before that Linux specific), we #define it to 0 in io.h to prevent compilation errors on older/crappy systems. At least this is the plan. input.c creates a pipe. For that, add a mp_set_cloexec() function (which is based on Weston's code in vo_wayland.c, but more correct). We could use pipe2() instead, but that is Linux specific. Technically, we have a race condition, but it won't matter.
* build: make pthreads mandatoryGravatar wm42013-11-28
| | | | | | | | | | | pthreads should be available anywhere. Even if not, for environment without threads a pthread wrapper could be provided that can't actually start threads, thus disabling features that require threads. Make pthreads mandatory in order to simplify build dependencies and to reduce ifdeffery. (Admittedly, there wasn't much complexity, but maybe we will use pthreads more in the future, and then it'd become a real bother.)
* switch the build system to wafGravatar Stefano Pigozzi2013-11-21
| | | | | | | | | | | | | | | | | | | | | | | This commit adds a new build system based on waf. configure and Makefile are deprecated effective immediately and someday in the future they will be removed (they are still available by running ./old-configure). You can find how the choice for waf came to be in `DOCS/waf-buildsystem.rst`. TL;DR: we couldn't get the same level of abstraction and customization with other build systems we tried (CMake and autotools). For guidance on how to build the software now, take a look at README.md and the cross compilation guide. CREDITS: This is a squash of ~250 commits. Some of them are not by me, so here is the deserved attribution: - @wm4 contributed some Windows fixes, renamed configure to old-configure and contributed to the bootstrap script. Also, GNU/Linux testing. - @lachs0r contributed some Windows fixes and the bootstrap script. - @Nikoli contributed a lot of testing and discovered many bugs. - @CrimsonVoid contributed changes to the bootstrap script.
* osdep/io.c: include config.hGravatar wm42013-11-20
| | | | | This possibly enables code that has never been tested before (accidentally), so let's hope this works out ok.
* stream: split out pthread helper functionGravatar wm42013-11-17
| | | | Also split the function itself into 3.
* osdep: handle SIGTERMGravatar wm42013-11-06
| | | | | | There's no reason why we should e.g. handle SIGQUIT, but not SIGTERM. Note that sending SIGTERM twice still kills the player.
* osx: fix -Wshadow warnings on platform specific codeGravatar Stefano Pigozzi2013-11-04
|
* configure: uniform the defines to #define HAVE_xxx (0|1)Gravatar Stefano Pigozzi2013-11-03
| | | | | | | | | | | | | | | | | | | | | The configure followed 5 different convetions of defines because the next guy always wanted to introduce a new better way to uniform it[1]. For an hypothetic feature 'hurr' you could have had: * #define HAVE_HURR 1 / #undef HAVE_DURR * #define HAVE_HURR / #undef HAVE_DURR * #define CONFIG_HURR 1 / #undef CONFIG_DURR * #define HAVE_HURR 1 / #define HAVE_DURR 0 * #define CONFIG_HURR 1 / #define CONFIG_DURR 0 All is now uniform and uses: * #define HAVE_HURR 1 * #define HAVE_DURR 0 We like definining to 0 as opposed to `undef` bcause it can help spot typos and is very helpful when doing big reorganizations in the code. [1]: http://xkcd.com/927/ related
* getch2: assume EOF when input file descriptor is invalidGravatar wm42013-10-28
| | | | | | | | | | | | | When starting mpv with nohup, file descriptor 0 seems to be invalid for some reason. (I'm not quite sure why it should be... /proc/pid/fd/0 seems to indicate it's just /dev/null, and using /dev/null explicitly shows that it works just fine.) select() will always immediately return, and this causes mpv to burn CPU without reason. Fix this by treating it as EOF when read() returns EBADF. Also add EINVAL to this condition, because it seems like a good idea.
* getch2: move global state to file scope variablesGravatar wm42013-10-28
| | | | | Using static variables for mutable state inside functions is a bad idea, because it's not immediately obvious that it is what it is.
* cocoa: fix opening quarantined files on 10.9 with the bundle [2]Gravatar Stefano Pigozzi2013-10-25
| | | | Fixup commit for bbc146927
* cocoa: fix opening quarantined files on 10.9 with the bundleGravatar Stefano Pigozzi2013-10-24
| | | | | | | It looks like on Mavericks the Finder is passing different arguments to mpv depending on whether the opened file is quarantined or not. Fixes #285
* cocoa: fix race condition with input context creationGravatar Stefano Pigozzi2013-10-24
| | | | | | | | | | This seems to be a problem only in OS X 10.9. I guess they improved the general speed of the Cocoa startup and suddenly mpv core takes more time than the Cocoa thread to initialize. Fixes #285 (hopefully!)
* getch2: remove pointless ifdefferyGravatar wm42013-10-17
| | | | | Apparently this was for MorphOS. If you really want to use that, ask the devs to provide dummy headers and declarations for ioctl() instead.
* Copyright, LICENSE: switch to GPL version 2 or laterGravatar wm42013-10-13
| | | | | | | | | | | | | | | Now that talloc has been removed, the license can be switched back to GPLv2+. Actually, there never was a GPLv2+ licensed MPlayer (fork or not) until now, but removal of some GPLv2-only code makes this possible now. Rewrite the Copyright file to explain the reasons for the licenses MPlayer and forks use. The old Copyright file didn't contain anything interesting anymore, and all information it contained is available at other places in the source tree. The reason for the license change itself is that it should improve interoperability with differently licensed code in general. This essentially reverts commit 1752808.
* osx: fix buildGravatar wm42013-09-27
| | | | | | Or at least I hope it fixes it, since I can't test. Broken by commit 0d90dd0.
* win32: edit resource files, in particular set CompanyNameGravatar wm42013-09-23
| | | | | | | Setting CompanyName (probably) helps with issue #256. Update some other fields as well, because why not. (They're full of MPlayer remnants.)
* macosx_application: fix regression causing crashGravatar Stefano Pigozzi2013-09-19
| | | | | 95a2151d1 introduced a crash on systems lower than 10.9 when opening files with a single argument.
* osdep/path: remove ifdefsGravatar wm42013-09-18
| | | | They're not really needed, so kill them.
* macosx: move bundle path stuff to path-macosx.mGravatar Stefano Pigozzi2013-09-18
| | | | This makes the code uniform to how stuff was handled for Windows in 1cb55ceb.
* path, win32: redo user configfile path handlingGravatar wm42013-09-18
| | | | | | | | | | | | | | | | | Remove the ifdef hell from mp_find_user_config_file(). Move the win32 specific code (for MinGW and Cygwin) to path-win.c. The behavior should be about the same, but I can't be sure due to lack of testing and because the old path.c code was hard to follow. (I expect those who care about windows will fix things, should issues pop up - sorry.) One difference is that the new code will always force MPV_HOME. It looks like the old code preferred the mpv config dir in the exe dir if it exists. Also, make sure MP_PATH_MAX has enough space, even if the equivalent wchar_t string is not 0-terminated with PATH_MAX (because apparently the winapi doesn't require this). (Actually, maybe we should just kill all uses of PATH_MAX/MP_PATH_MAX.)
* win32: add getenv() UTF-8 variantGravatar wm42013-09-18
| | | | | | | This is a bit "hard", because getenv() returns a static string, and we can't just return an allocated string. We also want getenv() to be thread-safe if possible. (If the mpv core is going to be more threaded, we sure do want the lower layers to be thread-safe as well.)
* HIDRemote: remove OS X version checksGravatar Stefano Pigozzi2013-09-17
| | | | | | Turns out that these checks were for versions of OS X that mpv doesn't even support anymore. So just remove the checks since they cause a deprecation warning.
* macosx_application: remove deprecation warning on OS X 10.9Gravatar Nyx0uf2013-09-16
| | | | | | | | | | | | GetCurrentProcess() is deprecated on 10.9. Make a universal solution by checking OS version number. get_system_version() function is the recommended Apple way of getting the OS version, since Gestalt is also deprecated (and does pretty much the same thing anyway) Updating HIDRemote.m to use a similar function would allow to get rid of the 2 other warnings.
* macosx_application: fix file opening on 10.9 (for real this time)Gravatar Stefano Pigozzi2013-09-13
| | | | | | | | I did commit 86c05655d by thinking `mpv` already removed the `mpv` from argc/argv. It actually is still there, so the argc must be 1 to check for no arguments. Thanks to @Nyx0uf for pointing out the bug and for testing on 10.9!
* macosx_application: fix file opening on OS X 10.9 (hopefully)Gravatar Stefano Pigozzi2013-09-12
| | | | | | | | File opening through Finder, apparently drops `--psn` arguments on Mavericks and just uses no args. Modify the code to account for that case. This wasn't tested on 10.9 itself (I don't have a paid dev account), but it *should* work if I understood the problem correctly.
* macosx_application: handle mpv:// linksGravatar Stefano Pigozzi2013-09-07
| | | | | | | Pretty useful for people writing userscripts for web browsers. Links starting with 'mpv://' are forwarded to the mpv OSX bundle. The leading 'mpv://' is stripped from the recived url and the rest of the string is inserted as is in the playlist.
* macosx_application: handle URL events as fileopen eventsGravatar Stefano Pigozzi2013-09-07
| | | | | This allows to open URLs directly with mpv. This is useful for streaming and libquvi supported sites.
* macosx_events: fix modifiers handling with media keysGravatar Stefano Pigozzi2013-09-05
| | | | | | This was caused by a typo. Regression from add7c2955df. Fixes #213
* macosx_events: send a `release all` after key up eventsGravatar Stefano Pigozzi2013-09-02
| | | | | | | | This prevents keys to become stuck due to changing keyboard modifiers during the key down. Not the prettiest approach but event `x11_common` does it like this. Fixes #210
* macosx_events: remove duplicationGravatar Stefano Pigozzi2013-09-02
| | | | refactoring: extract method `handleMPKey:withMask:`
* cocoa: enqueue events only if input context is presentGravatar Stefano Pigozzi2013-09-01
|
* osx: use MP_KEY_* instead of MK_* for media keysGravatar Stefano Pigozzi2013-09-01
| | | | | In 213ad5d6c I added `MK_*` key bindings overlooking the fact that mpv already has `MP_KEY_*` for media keys.
* cocoa: let the core handle key repeatsGravatar Stefano Pigozzi2013-08-30
| | | | | Report key down and key up modifiers to the core so that it can issue it's own key repeats (instead of relying on Cocoa's ones).