summaryrefslogtreecommitdiffstats
path: root/input/input.h
Commit message (Collapse)AuthorAgeFilesLines
* command: remove radio commandswm42013-12-191-4/+0
| | | | | | | Remove these because I'm too lazy to convert them to proper STREAM_CTRLs. Considering that probably nobody uses radio://, caring about this is a complete waste of time. I will add these commands back if someone asks for them, but I don't expect this to happen.
* Split mpvcore/ into common/, misc/, bstr/wm42013-12-171-1/+1
|
* Move options/config related files from mpvcore/ to options/wm42013-12-171-1/+1
| | | | | | | | | 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/wm42013-12-171-0/+303
|
* Rename directories, move files (step 1 of 2) (does not compile)wm42012-11-121-219/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Tis drops the silly lib prefixes, and attempts to organize the tree in a more logical way. Make the top-level directory less cluttered as well. Renames the following directories: libaf -> audio/filter libao2 -> audio/out libvo -> video/out libmpdemux -> demux Split libmpcodecs: vf* -> video/filter vd*, dec_video.* -> video/decode mp_image*, img_format*, ... -> video/ ad*, dec_audio.* -> audio/decode libaf/format.* is moved to audio/ - this is similar to how mp_image.* is located in video/. Move most top-level .c/.h files to core. (talloc.c/.h is left on top- level, because it's external.) Park some of the more annoying files in compat/. Some of these are relicts from the time mplayer used ffmpeg internals. sub/ is not split, because it's too much of a mess (subtitle code is mixed with OSD display and rendering). Maybe the organization of core is not ideal: it mixes playback core (like mplayer.c) and utility helpers (like bstr.c/h). Should the need arise, the playback core will be moved somewhere else, while core contains all helper and common code.
* input: add input test modewm42012-10-141-0/+1
| | | | | | | | | | | In input test mode, key bindings won't be executed, but are shown on the OSD. The OSD includes various information, such as the name of the key, the command itself, whether it's builtin, and the config file location it was defined. The input test mode can be enabled with "--input=test". No effort is spent trying to react to key bindings that normally exit the player; they are treated just like any other binding.
* input: track location info for input commandswm42012-10-141-2/+3
| | | | | | If parsing a command fails, its location is printed. The location is the path to the input.conf, and the line number of the key binding and the associated input command.
* commands: add print_text input command to print text on the terminalwm42012-10-121-0/+1
| | | | | In theory, this could take over the role of the get_property slave command, and is more general.
* commands: more user-control whether a command shows OSD bars/messageswm42012-10-121-2/+4
| | | | | | | | | | The "no-osd" prefix was introduced earlier to disable OSD selectively based on the key binding. Extend this, and allow the user to force display of an OSD bar ("osd-bar"), OSD message ("osd-msg") or both ("osd-msg-bar"). This changes mainly how property setting functions behave. The default behavior is still the same.
* commands: add choice type to input commandswm42012-10-121-6/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Allow using the choice type (as it used for command line) for arguments of input commands. Change the magic integer arguments of some commands (like seek) to use choices instead. The old numeric values are still allowed (but only those which made sense before, not arbitrary integers). In order to do this, remove the input.c specific types (like MP_CMD_ARG_INT) completely and specify commands using the m_option types. Also, add the special choice "-" to some arguments. It's supposed to signify the default value, so arguments can be easily skipped. Maybe the choice option should recognize this and not change the previous value, but we'll leave this for later. For now, leave compatibility integer values for all new choice arguments, e.g. "0" maps to 0. We could let the choice option type do this automatically, but we don't, because we want user input values and internal mplayer values decoupled in general. The compatibility options will be removed one day, too. Also, remove optional args for strings - would require either annoying additional code, or copying strings twice. It's not used, so remove it.
* input: warn about non-existing commands, add explicit "ignore" commandwm42012-10-121-0/+1
| | | | | | | | | | | If a command is not found, warn about it at loading time (just like other command parsing errors are printed at loading time). Add an explicit "ignore" command. input.conf instructs users to use this command to cancel out existing mapping. This clashed with the warning added in this commit. Make "ignore" a real command and remove the specialcasing for it from get_cmd_from_keys(). Now "ignore" is ignored because it's not handled in command.c.
* input: verify input.conf on loadingwm42012-10-121-1/+2
| | | | | | | | | When input.conf is loaded, verify each command and print a warning if it's invalid or uses legacy commands. This is done for both the user's and the embedded config files. The diff is a bit noisy, because mp_input_parse_cmd() is changed to take a bstr as argument instead of a char*.
* commands: replace "switch" with "add" and "cycle"wm42012-10-121-1/+2
| | | | | | | | | | | | | | Now it depends on the command whether a property wraps around, or stops at min/max valid property value. For practically all properties, it's quite unambiguous what the "switch" command should have done, and there's technically no need to replace it with these new commands. More over, most properties that cycle are boolean anyway. But it seems more orthogonal to make the difference explicit, rather than hardcoding it. Having different commands also makes it more explicit to the user what these commands do, both just due to the naming, and what wrapping policy is used. The code is simpler too.
* commands: make "aspect" property writeable, replaces "switch_ratio"wm42012-10-121-1/+0
| | | | | | | | Move the code for "switch_ratio" to the M_PROPERTY_SET case of the "aspect" property. The rules are exactly the same, e.g. setting a ratio smaller than 0.1 sets the pixel aspect ratio to 1:1. For now, we define that writing "0" sets the PAR to 1:1, and disallow -1 (possibly reserve it to reset to default aspect ratio).
* commands: rename osd_show_[property_]text and osd_show_progressionwm42012-10-121-3/+2
| | | | | | | | | | | | osd_show_[property_]text => show_text osd_show_progression => show_progress show_text, osd_show_property_text and osd_show_text both map to the code for the previous osd_show_property_text. The only special thing about osd_show_text is that you don't need to escape "$". Also, unfortunately osd_show_property_text requires escaping things twice, one time for the command parser, and the other time for the property formatting code, while osd_show_text needed only one level of escaping.
* commands: remove speed_set/speed_incr commandswm42012-10-121-2/+0
| | | | Redundant with set/switch commands.
* commands: remove unimplemented "use_master" commandwm42012-10-121-1/+0
| | | | The implementation for this command was removed in 2002.
* commands: change input commands to make OSD usage explicitwm42012-10-121-4/+8
| | | | | | | | | | | | | | | | | | | | Most input commands had their own policy whether to display an OSD message for user feedback or not. Some commands had two variants, one that showed an OSD message and one that didn't (e.g. step_property_osd and step_property). Change it such that all commands show a message on the OSD. Add a "no-osd" modifier that disables OSD for that command. Rename the "step_property" and "step_property_osd" command to "switch", and rename "set_property" and "set_property_osd" to "set". Note that commands which haven't used OSD before still don't use OSD. That will possibly be fixed later. (E.g. "screenshot" could display an OSD message instead of just printing a message on the terminal.) The chapter and edition properties still produce OSD messages even with "no-osd", because they don't map so well to the property_osd_display[] mechanism.
* commands: simplify legacy command-to-property bridgewm42012-10-121-36/+0
| | | | | | | | | | | | | | | | | | | | | There are many input commands which are redundant to properties. They were parsed like normal commands, but set_property_command() in command.c handled them automatically using the property mechanism. This still required having the command specifications around, and the code in command.c was quite messy. Replace this with a text based replacement mechanism. Some corner cases are not handled: commands of form "seek_chapter 3 1" are supposed to set the "chapter" property to 3. This use is probably rare, and doesn't show up in the default input.conf. The reason compatibility is kept is because breaking input.conf is quite annoying, so a minimal effort is made to avoid this. Currently we print an annoying warning every time a legacy command is used, though. Also add a compatibility entry for "pt_step", which was removed some time ago. Variations in whitespace are not handled, but it's good enough to deal with old input.conf entries.
* commands: remove legacy slave mode get commandswm42012-10-121-19/+0
| | | | | | | | These have been replaced by properties. Also remove some other slave- mode specific get commands that can be replaced by property uses. The get_metadata() function didn't actually contain anything useful, and just replicated code from other parts of mplayer.
* vf_rectangle: remove as it is very dirty and we have a replacement nowRudolf Polzer2012-09-181-1/+0
|
* core: manage tracks in the frontendwm42012-09-181-4/+0
| | | | | | | | | | | | | | | Introduce a general track struct for every audio/video/subtitle track known to the frontend. External files (subtitles) are now represented as tracks too. This mainly serves to clean up the subtitle selection code: now every subtitle is simply a track, instead of using a messy numbering that goes by subtitle type (as it was stored in the global_sub_pos field). The mplayer fontend will list external subtitle files as additional tracks. The timeline code now tries to match the exact demuxer IDs of all tracks. This may cause problems when Matroska files with different track numberings are used with EDL timelines. Change demux_lavf not to set demuxer IDs, since most time they are not set.
* command: remove sub_remove commandwm42012-09-071-1/+0
| | | | | | | This messes deeply with the subtitle bookkeeping data structures, and would have to be reimplemented anyway. It's not sure what this was even useful for. Possibly for slave mode.
* command: remove sub_log commandwm42012-09-071-1/+0
| | | | | Not very useful, and introduced special cases. Just get rid of it, can be reintroduced if in a better way if someone misses this feature.
* input: add ability to disable all default bindings for an input sectionwm42012-08-241-1/+8
| | | | | | | | | | | | | | | | | | | | Add a flags parameter to mp_input_set_section(). Add a flag that defines whether bindings in the default section are used or not. This is useful for special functionality, where the normal key bindings may have unwanted effects. For example, it shouldn't be possible to seek during encoding. However, you want to be able to cancel the encoding process gracefully. For that purpose, the "encode" section of input.conf could be made exclusive: mp_input_set_section(mpctx->input, "encode", MP_INPUT_NO_DEFAULT_SECTION); And input.conf could contain this definition: RIGHT seek 10 q {encode} quit Then only the key "q" would be bound during encoding.
* Remove dvdnav support (DVD menus)wm42012-08-161-11/+0
| | | | | | | | | | | | | | | | When the internal mplayer MPEG demuxer was removed (commit 1fde09db), the default demuxer when using dvdnav was set to libavformat. Now it turns out that this doesn't work with libavformat. It will terminate playback right after the audio runs out (instead of looping it like the video, or whatever it's supposed to do). I'm not sure what exactly the problem is, but since 1. even mplayer-svn can't handle DVD menus directly (missing highlights), 2. DVD menus are essentially worthless, and 3. I don't directly watch DVDs, don't bother with it and remove it. For basic playback, there's still libdvdread support. Also, use pkg-config for libdvdread, and drop support for in-tree libdvdread. Remove support for in-tree libdvdcss as well.
* Remove teletext supportwm42012-08-031-2/+0
| | | | | | | | Teletext requires special OSD support. Because I can't even test teletext, I can't restore support for it. Since teletext can be considered ancient and obscure, and since it doesn't make sense to keep the remaining teletext code without being able to use it, I'm removing it.
* mplayer: rip out --capture supportwm42012-08-021-1/+0
| | | | | | | While this was an interesting idea, it wasn't actually useful. Basically it dumped the raw data (as requested by the demuxer) into a file. The result is only useful if the file format was raw or maybe some MPEG packet stream, but not with most modern file formats.
* Remove dead codewm42012-08-011-6/+0
| | | | | | | | | | | | | This was done with the help of callcatcher [1]. Only functions which are statically known to be unused are removed. Some unused functions are not removed yet, because they might be needed in the near future (such as open_output_stream for the encode branch). There is one user visible change: the --subcc option did nothing, and is removed with this commit. [1] http://www.skynet.ie/~caolan/Packages/callcatcher.html
* VO: add mechanisms to change VO commandline for VOs supporting itwm42012-08-011-0/+3
|
* mplayer: turn playtree into a list, and change per-file option handlingwm42012-07-311-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: - There is no playtree anymore. It's reduced to a simple list. - Options are now always global. You can still have per-file options, but these are optional and require special syntax. - The slave command pt_step has been removed, and playlist_next and playlist_prev added. (See etc/input.conf changes.) This is a user visible incompatible change, and will break slave-mode applications. - The pt_clear slave command is renamed to playlist_clear. - Playtree entries could have multiple files. This is not the case anymore, and playlist entries have always exactly one entry. Whenever something adds more than one file (like ASX playlists or dvd:// or dvdnav:// on the command line), all files are added as separate playlist entries. Note that some of the changes are quite deep and violent. Expect regressions. The playlist parsing code in particular is of low quality. I didn't try to improve it, and merely spent to least effort necessary to keep it somehow working. (Especially ASX playlist handling.) The playtree code was complicated and bloated. It was also barely used. Most users don't even know that mplayer manages the playlist as tree, or how to use it. The most obscure features was probably specifying a tree on command line (with '{' and '}' to create/close tree nodes). It filled the player code with complexity and confused users with weird slave commands like pt_up. Replace the playtree with a simple flat playlist. Playlist parsers that actually return trees are changed to append all files to the playlist pre-order. It used to be the responsibility of the playtree code to change per-file config options. Now this is done by the player core, and the playlist code is free of such details. Options are not per-file by default anymore. This was a very obscure and complicated feature that confused even experienced users. Consider the following command line: mplayer file1.mkv file2.mkv --no-audio file3.mkv This will disable the audio for file2.mkv only, because options are per-file by default. To make the option affect all files, you're supposed to put it before the first file. This is bad, because normally you don't need per-file options. They are very rarely needed, and the only reasonable use cases I can imagine are use of the encode backend (mplayer encode branch), or for debugging. The normal use case is made harder, and the feature is perceived as bug. Even worse, correct usage is hard to explain for users. Make all options global by default. The position of an option isn't significant anymore (except for options that compensate each other, consider --shuffle --no-shuffle). One other important change is that no options are reset anymore if a new file is started. If you change settings with slave mode commands, they will not be changed by playing a new file. (Exceptions include settings that are too file specific, like audio/subtitle stream selection.) There is still some need for per-file options. Debugging and encoding are use cases that profit from per-file options. Per-file profiles (as well as per-protocol and per-VO/AO options) need the implementation related mechanisms to backup and restore options when the playback file changes. Simplify the save-slot stuff, which is possible because there is no hierarchical play tree anymore. Now there's a simple backup field. Add a way to specify per-file options on command line. Example: mplayer f1.mkv -o0 --{ -o1 f2.mkv -o2 f3.mkv --} f4.mkv -o3 will have the following options per file set: f1.mkv, f4.mkv: -o0 -o3 f2.mkv, f3.mkv: -o0 -o3 -o1 -o2 The options --{ and --} start and end per-file options. All files inside the { } will be affected by the options equally (similar to how global options and multiple files are handled). When playback of a file starts, the per-file options are set according to the command line. When playback ends, the per-file options are restored to the values when playback started.
* commands: add show_tracks_osd command to display audio and subtitle tracks ↵wm42012-07-281-0/+1
| | | | | | | | | on OSD The command lists the audio and subtitle tracks in the current file on the OSD. It also marks the currently active streams. Video streams are not shown, as files with more than one video stream are exceedingly rare.
* commands: add show_chapters_osd command to display chapters on OSDwm42012-07-281-0/+2
| | | | | | | | The command lists the chapters in the current file on the OSD. It also marks the current chapter. This is actually a cheap replacement for the chapter select libmenu functionality.
* Merge remote-tracking branch 'origin/master'wm42012-04-011-4/+7
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: bstr.c bstr.h etc/input.conf input/input.c input/input.h libao2/ao_pulse.c libmpcodecs/vf_ass.c libmpcodecs/vf_vo.c libvo/gl_common.c libvo/x11_common.c mixer.c mixer.h mplayer.c
| * ao_pulse, core: make pulse thread wake up core for more dataUoti Urpala2012-03-261-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For ao_pulse, the current latency is not a good indicator of how soon the AO requires new data to avoid underflow. Add an internal pipe that can be used to wake up the input loop from select(), and make the pulseaudio main loop (which runs in a separate thread) use this mechanism when pulse requests more data. The wakeup signal currently contains no information about the reason for the wakup, but audio buffers are always filled when the event loop wakes up. Also, request a latency of 1 second from the Pulseaudio server. The default is normally significantly higher. We don't need low latency, while higher latency helps prevent underflows reduces need for wakeups.
| * input.c: simplify command definitionsUoti Urpala2012-03-251-8/+7
| | | | | | | | | | Change command definitions to allow writing the command definition table in more readable format.
* | commands: add pt_clear command to clear playlistwm42012-02-101-0/+1
| | | | | | | | | | | | | | | | | | This deletes all playlist elements, except the currently active playlist entry. NOTE: this doesn't remove parent nodes in the case when we really have a play tree (as opposed to a play list). Apparently this doesn't cause any harm.
* | input.c: simplify command definitionswm42012-01-261-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using type = -1 for terminating the command argument list was an unnecessary complication. Change it to 0 to make use of default initialization. Remove the explicit termination from the command definitions. Now the argument list is automatically terminated by C default initialization rules. Also remove other redundant {0} initializers. When an argument's default value is actually initialized to something other than 0, make the field being initialized explicit (e.g. {1} becomes {.i = 1}). Try to make use of whitespace more consistent.
* | input: fix crashes with libmenuwm42012-01-181-1/+0
|/ | | | | | | | | | | | | Note: now that libmenu has been removed, the related code in input.c has been removed. If libmenu is ever added back, a queue_remove() function that can remove any item in the input queue will be required. libmenu triggered some special case that caused crashes by double frees. In particular the queue_pop function is used, expecting to remove an element that is not necessarily always the one that queue_pop removes. Fix by adding a queue_remove functions. Rewrite the other queue functions, since these are probably buggy as well. queue_pop didn't even attempt to maintain the doubly linked list.
* libmenu: remove OSD menu functionality (--menu)Uoti Urpala2011-10-251-17/+0
| | | | | | | | | | Something like the OSD menu functionality could be useful. However the current implementation has several problems and would require a relatively large amount of work to get into good shape. As far as I know there are few users of the existing functionality. Nobody is working on the existing code and keeping it compiling at all while changing other code would require extra work. So delete the menu code and some related code elsewhere that's used by nothing else.
* input: rework event reading and command queuingUoti Urpala2011-07-171-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rework much of the logic related to reading from event sources and queuing commands. The two biggest architecture changes are: - The code buffering keycodes in mp_fifo.c is gone. Instead key input is now immediately fed to input.c and interpreted as commands, and then the commands are buffered instead. - mp_input_get_cmd() now always tries to read every available event from every event source and convert them to (buffered) commands. Before it would only process new events until one new command became available. Some relevant behavior changes: - Before commands could be lost when stream code called mp_input_check_interrupt() which read commands (to see if they were of types that triggered aborts during slow IO tasks) and then threw them away. This was especially an issue if cache was enabled and slow to read. Fixed - now it's possible to check whether there are queued commands which will abort playback of the current file without throwing other commands away. - mp_input_check_interrupt() now prints a message if it returns true. This is especially useful because the failures caused by aborted stream reads can trigger error messages from other code that was doing the read; the new message makes it more obvious what the cause of the subsequent error messages is. - It's now possible to again avoid making stdin non-blocking (which caused some issues) without reintroducing extra latency. The change will be done in a subsequent commit. - Event sources that do not support select() should now have somewhat lower latency in certain situations as they will be checked both before and after select()/sleep in input reading; before the sleep always happened first even if such sources already had queued input. Before the key fifo was also handled in this manner (first key triggered select, but if multiple were read then rest could be delayed; however in most cases this didn't