aboutsummaryrefslogtreecommitdiffhomepage
path: root/input
Commit message (Collapse)AuthorAge
* ipc: make sure --input-file=/dev/stdin always worksGravatar wm42014-11-07
| | | | It's not necessarily available on Unix systems other than Linux (sigh).
* ipc: make it possible to receive log messagesGravatar wm42014-11-01
| | | | | The receiving part was implemented, but since no messages are enabled by default, it couldn't be used.
* ipc: add a command to retrieve API versionGravatar wm42014-11-01
|
* ipc: verify resume/suspend commandsGravatar wm42014-11-01
| | | | | Calling mpv_resume() too often is considered an API usage violation, and will trigger an internal assertion somewhere.
* command: don't require whitespace before ';' or '#'Gravatar wm42014-10-31
| | | | | | | This change is probably too simplistic, but most things appear to work, so I don't care about that now. Fixes #1232.
* input: cascade-load input.confGravatar wm42014-10-29
| | | | | If there are several input.confs in the set of valid config paths, load them all.
* audio: add command/function to reload audio outputGravatar wm42014-10-27
| | | | | Anticipated use: simple solution for dealing with audio APIs which request configuration changes via events.
* input: resolve ~ and similar for --input-fileGravatar wm42014-10-24
| | | | Because why not.
* command: fix debug outputGravatar wm42014-10-24
| | | | It was a bit ugly/annoying.
* command: print executed commands with -vGravatar wm42014-10-23
|
* command: add a "cached" mode to sub_addGravatar wm42014-10-23
| | | | | This avoids reloading a subtitle if it was already added. In all cases, the subtitle is selected.
* command: make trailing sub_add actually optionalGravatar wm42014-10-22
| | | | This was always intended. Also fixes subtitle-file drag & drop.
* command: extend sub_add commandGravatar wm42014-10-21
|
* Set thread name for debuggingGravatar wm42014-10-19
| | | | | | | | | | Especially with other components (libavcodec, OSX stuff), the thread list can get quite populated. Setting the thread name helps when debugging. Since this is not portable, we check the OS variants in waf configure. old-configure just gets a special-case for glibc, since doing a full check here would probably be a waste of effort.
* ipc: skip empty and commented linesGravatar wm42014-10-19
|
* ipc: accept both JSON and "old" commandsGravatar wm42014-10-19
| | | | Minimizes the differences between --input-file and --input-unix-socket.
* ipc: fix minor error cleanup issuesGravatar wm42014-10-19
| | | | | | | | | | | | | | The ipc_thread can exit any time, and will free the mp_ipc_ctx when doing this, leaving a dangling pointer. This was somewhat handled in the original commit by setting mpctx->ipc_ctx to NULL when the thread exited, but that was still a race condition. Handle it by freeing most things after joining the ipc_thread. This means some resources will not be freed until player exit, but that should be ok (it's an exceptional error situation). Also, actually close the pipe FDs in mp_init_ipc() on another error path.
* ipc: decouple from MPContextGravatar wm42014-10-19
| | | | Just a minor refactor to keep unneeded dependencies on the core low.
* ipc: fix a small memory leakGravatar wm42014-10-17
|
* input: implement --input-file on unix using the IPC supportGravatar Alessandro Ghedini2014-10-17
|
* input: implement JSON-based IPC protocolGravatar Alessandro Ghedini2014-10-17
|
* input: don't add weird padding when formatting keycodeGravatar wm42014-10-17
| | | | No idea what this was for. It has no purpose and looks weird.
* command: add a mechanism to allow scripts to intercept file loadsGravatar wm42014-10-16
| | | | | | | | | | | | | | | | | | | | | | | A vague idea to get something similar what libquvi did. Undocumented because it might change a lot, or even be removed. To give an idea what it does, a Lua script could do the following: -- type ID priority mp.commandv("hook_add", "on_load", 0, 0) mp.register_script_message("hook_run", function(param, param2) -- param is "0", the user-chosen ID from the hook_add command -- param2 is the magic value that has to be passed to finish -- the hook mp.resume_all() -- do something, maybe set options that are reset on end: mp.set_property("file-local-options/name", "value") -- or change the URL that's being opened: local url = mp.get_property("stream-open-filename") mp.set_property("stream-open-filename", url .. ".png") -- let the player (or the next script) continue mp.commandv("hook_ack", param2) end)
* input: remove some unneeded codeGravatar wm42014-10-10
|
* input: cosmetics: move codeGravatar wm42014-10-10
|
* input: use mpv_node parser for char** command parsersGravatar wm42014-10-10
| | | | Minor simplification, also drops some useless stuff.
* input: add a function to parse mpv_node as commandGravatar wm42014-10-10
| | | | For future client API enhancements.
* libmpv/cocoa: don't start the event monitorGravatar Stefano Pigozzi2014-10-09
| | | | | | The event monitor is used to get keyboard events when there is no window, but since it is a global monitor to the current process, we don't want it in a library setting.
* client API: rename --input-x11-keyboard to --input-vo-keyboardGravatar wm42014-10-09
| | | | | Apparently we need this for Cocoa too. (The option was X11 specific in the hope that only X11 would need this hack.)
* client API, X11: change default keyboard input handling againGravatar wm42014-09-28
| | | | | | | | | | | | | | | | | | | | | | | | | | Commit 64b7811c tried to do the "right thing" with respect to whether keyboard input should be enabled or not. It turns out that X11 does something stupid by design. All modern toolkits work around this native X11 behavior, but embedding breaks these workarounds. The only way to handle this correctly is the XEmbed protocol. It needs to be supported by the toolkit, and probably also some mpv support. But Qt has inconsistent support for it. In Qt 4, a X11 specific embedding widget was needed. Qt 5.0 doesn't support it at all. Qt 5.1 apparently supports it via QWindow, but if it really does, I couldn't get it to work. So add a hack instead. The new --input-x11-keyboard option controls whether mpv should enable keyboard input on the X11 window or not. In the command line player, it's enabled by default, but in libmpv it's disabled. This hack has the same problem as all previous embedding had: move the mouse outside of the window, and you don't get keyboard input anymore. Likewise, mpv will steal all keyboard input from the parent application as long as the mouse is inside of the mpv window. Also see issue #1090.
* input: copy options automaticallyGravatar wm42014-09-27
| | | | | | Originally, all options were copied to ensure that input_ctx remins thread-safe, even if options are changed asynchronously. But this got a bit inconsistent. Copy them automatically and reduce some weirdness.
* input: separate creation and loading of configGravatar wm42014-09-27
| | | | | | | | | | | Until now, creating the input_ctx was delayed until the command line and config files were parsed. Separate creation and loading so that input_ctx is available from start. This should make it possible to simplify some things. For example, some complications with Cocoa were apparently only because input_ctx was available only "later". (Although I'm not sure if this is still relevant, or if the Cocoa code should even be organized this way.)
* input: explain why we use semaphoresGravatar wm42014-09-20
| | | | Also switch function names for better self-documentation.
* input: add locking for repeat infoGravatar Alexander Preisinger2014-09-19
|
* input: add function for setting repeat infoGravatar Alexander Preisinger2014-09-19
| | | | | | | Let us set a different rate and delay. Needed for the following commit where we set rate and delay reported by weston. But only if the option native-keyrepeat is set.
* input: use libwaio for pipe input on WindowsGravatar wm42014-09-14
| | | | | | | | | | | | Use libwaio to read from pipes (stdin or named pipes) on Windows. This liberates us from nasty issues, such as pipes (as created by most programs) not being possible to read in a non-blocking or event-driven way. Although it would be possible to do that in a somewhat sane way on Vista+, it's still not easy, and on XP it's especially hard. libwaio handles these things for us. Move pipe.c to pipe-unix.c, and remove Windows specific things. Also adjust the input.c code to make this work cleanly.
* input: fix nested commandsGravatar wm42014-09-13
| | | | Regression from today.
* input: distinguish playlist navigation and quit commands for abortGravatar wm42014-09-13
| | | | | | | Refine the ugly hack from the previous commit, and let the "quit" command and some others abort playback immediately. For playlist_next/playlist_prev, still use the old hack, because we can't know if they would stop playback or not.
* stream: redo playback abort handlingGravatar wm42014-09-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This mechanism originates from MPlayer's way of dealing with blocking network, but it's still useful. On opening and closing, mpv waits for network synchronously, and also some obscure commands and use-cases can lead to such blocking. In these situations, the stream is asynchronously forced to stop by "interrupting" it. The old design interrupting I/O was a bit broken: polling with a callback, instead of actively interrupting it. Change the direction of this. There is no callback anymore, and the player calls mp_cancel_trigger() to force the stream to return. libavformat (via stream_lavf.c) has the old broken design, and fixing it would require fixing libavformat, which won't happen so quickly. So we have to keep that part. But everything above the stream layer is prepared for a better design, and more sophisticated methods than mp_cancel_test() could be easily introduced. There's still one problem: commands are still run in the central playback loop, which we assume can block on I/O in the worst case. That's not a problem yet, because we simply mark some commands as being able to stop playback of the current file ("quit" etc.), so input.c could abort playback as soon as such a command is queued. But there are also commands abort playback only conditionally, and the logic for that is in the playback core and thus "unreachable". For example, "playlist_next" aborts playback only if there's a next file. We don't want it to always abort playback. As a quite ugly hack, abort playback only if at least 2 abort commands are queued - this pretty much happens only if the core is frozen and doesn't react to input.
* input: "quit_watch_later" and "stop" are abort commandsGravatar wm42014-09-13
| | | | | | | | | This means they get special handling for asynchronously aborting playback, even if the player is "stuck". Also document "stop". It seems somewhat useful for client API users (although that will be implemented properly only in the following commits.)
* input: don't autorepeat cycle_values commandGravatar wm42014-09-13
| | | | | | | Not sure why this was originally added as autorepeated. It makes no sense, because switching between choices should never autorepeat. (For the normal "add"/"cycle" commands, autorepeat is usually enabled, but command.c tries to disable it specifically for choice properties.)
* input: simplifyGravatar wm42014-09-13
| | | | | Just some minor things. In particular, don't call mp_input_wakeup() manually, but make it part of queuing commands (as far as possible).
* input: fix autorepeatGravatar wm42014-09-13
| | | | | | | | Mismatching units in timeout calculation. Also, as a near-cosmetic change, explicitly wake up the core on the right time. Currently this does nothing, because the core is woken up anyway - but it will matter with the next commit.
* input: remove central select() callGravatar wm42014-09-10
| | | | | This is now unused. Get rid of it and all surrounding infrastructure, and replace the remaining "wakeup pipe" with a semaphore.
* input: remove useless joystick.h/lirc.h include filesGravatar wm42014-09-10
| | | | These really just waste space.
* input: use an input thread for joystickGravatar wm42014-09-10
|
* input: use an input thread for lircGravatar wm42014-09-10
|
* input: add convenience function for running input sources in threadsGravatar wm42014-09-10
|
* input: make some fields internalGravatar wm42014-09-10
|
* terminal-unix: move to threadGravatar wm42014-09-10
| | | | | | | Do terminal input with a thread, instead of using the central select() loop. This also changes some details how SIGTERM is handled. Part of my crusade against mp_input_add_fd().