summaryrefslogtreecommitdiffstats
path: root/input
Commit message (Collapse)AuthorAgeFilesLines
* input: fix mp_cmd memory leakwm42012-10-141-0/+3
| | | | | mp_input_feed_key() didn't free the command, if it was discarded due to the queue exceeding its maximum size.
* input: minor simplification to mp_input_get_cmd()wm42012-10-141-13/+8
|
* input: add input test modewm42012-10-142-12/+77
| | | | | | | | | | | 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-142-23/+42
| | | | | | 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.
* input: don't warn on commands for disabled optional featureswm42012-10-141-6/+5
| | | | | | | | | Always recognize input commands for optional features (like TV commands etc.). If these features are disabled, the commands are parsed, but simply do nothing. This fixes annoying warnings on start with the default/builtin input.conf, if certain optional features are not compiled.
* Merge branch 'input_changes' into masterwm42012-10-122-306/+377
|\ | | | | | | | | | | | | | | Conflicts: DOCS/man/en/vo.rst etc/input.conf input/input.c m_property.c
| * commands: use "up" and "down" as 2nd argument for cycle commandwm42012-10-121-1/+28
| | | | | | | | | | | | | | | | | | | | | | Allow the values "up" and "down" as step argument for the cycle input command. Previously, this argument was a float, which specified an arbitrary step value and direction (similar to the add command). Instead of "1" and "-1", "up" and "down" is to be used. Float values are still accepted. That capability might be removed in the future, as there's probably hardly any actual use for arbitrary step values.
| * commands: add print_text input command to print text on the terminalwm42012-10-122-0/+2
| | | | | | | | | | In theory, this could take over the role of the get_property slave command, and is more general.
| * commands: sub_step takes only one argumentwm42012-10-121-1/+1
| |
| * commands: disable deprecation warningswm42012-10-121-1/+1
| | | | | | | | | | | | | | This disables warning messages when the legacy input command bridge is used. For now, user input.confs should just keep working as if nothing has changed. The deprecation warnings will be enabled again at a later point, and the legacy bridge will be eventually removed.
| * commands: rename show_tracks/chapters_osd commandwm42012-10-121-2/+4
| |
| * commands: more user-control whether a command shows OSD bars/messageswm42012-10-122-2/+12
| | | | | | | | | | | | | | | | | | | | 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-122-50/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-122-25/+27
| | | | | | | | | | | | | | | | | | | | | | 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: handle escapes always in command parserwm42012-10-121-125/+157
| | | | | | | | | | | | | | | | | | | | | | | | Previously, both the command parser and property expansion (m_properties_expand_string) handled escapes with '\'. Move all escape handling into the command parser, and remove it from the property code. This removes the need to escape strings twice for commands that use property expansion. The command parser is practically rewritten: it uses m_option for the actual parsing, and reduces hackish C-string handling.
| * input: verify input.conf on loadingwm42012-10-122-8/+12
| | | | | | | | | | | | | | | | | | 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-122-36/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-122-3/+4
| | | | | | | | | | | | | | | | 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: replace --hardframedrop, change framedropping propertywm42012-10-121-1/+1
| | | | | | | | | | | | | | | | | | | | Replace --hardframedrop with --framedrop=hard. Rename the framedrop property from "framedropping" to "framedrop" for the sake of making command line options have the same name as their corresponding property. Change the property to accept choice values instead of numeric values. Remove unused/forgotten auto_quality variable.
| * commands: remove third parameter for "switch"wm42012-10-121-1/+1
| | | | | | | | | | This could change the direction (i.e. invoke STEP_PROPERTY_DOWN), but you can just pass a negative value as second argument instead.
| * commands: rename osd_show_[property_]text and osd_show_progressionwm42012-10-122-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | 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-122-4/+2
| | | | | | | | Redundant with set/switch commands.
| * commands: rename properties, update input.confwm42012-10-121-39/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Use "-" instead of "_" in property names. The intent is that property names and options names should be the same (if they refer to the same thing), and options use "-" as word separator. Rename some other properties too, e.g. "switch_audio" -> "audio". Add a way to translate the old property names to the new ones, similar to the input command legacy bridge. Update input.conf. Use the new property names, and don't use legacy commands.
| * commands: remove unimplemented "use_master" commandwm42012-10-122-2/+0
| | | | | | | | The implementation for this command was removed in 2002.
| * commands: change input commands to make OSD usage explicitwm42012-10-122-24/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-122-76/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-122-38/+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.
* | Rename to "mpv"wm42012-10-122-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This changes the name of this project to mpv. Most user-visible mentions of "MPlayer" and "mplayer" are changed to "mpv". The binary name and the default config file location are changed as well. The new default config file location is: ~/.mpv/ Remove etc/mplayer.desktop. Apparently this was for the MPlayer GUI, which has been removed from mplayer2 ages ago. We don't have a logo, and the MS Windows resource files sort-of require one, so leave etc/mplayer.ico/.xpm as-is. Remove the debian and rpm packaging scripts. These contained outdated dependencies and likely were more harmful than useful. (Patches which add working and well-tested packaging are welcome.)
* | commands: fix parsing bugwm42012-09-231-1/+1
|/ | | | | When tabs are used as whitespace between command and the first string parameter, the string is not correctly terminated.
* vf_rectangle: remove as it is very dirty and we have a replacement nowRudolf Polzer2012-09-182-2/+0
|
* core: manage tracks in the frontendwm42012-09-182-8/+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-072-2/+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-072-2/+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-242-6/+18
| | | | | | | | | | | | | | | | | | | | 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-162-15/+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.
* options: get rid of ambiguous option parsingwm42012-08-051-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Options parsing used to be ambiguous, as in the splitting into option and values pairs was ambiguous. Example: -option -something It wasn't clear whether -option actually takes an argument or not. The string "-something" could either be a separate option, or an argument to "-option". The code had to call the option specific parser function to resolve this. This made everything complicated and didn't even have a real use. There was only one case where this was actually used: string lists (m_option_type_string_list) and options based on it. That is because this option type actually turns a single option into a proxy for several real arguments, e.g. "vf*" can handle "-vf-add" and "-vf-clr". Options suffixed with "-clr" are the only options of this group which take no arguments. This is ambiguous only with the "old syntax" (as shown above). The "new" option syntax always puts option name and value into same argument. (E.g. "--option=--something" or "--option" "--something".) Simplify the code by making it statically known whether an option takes a parameter or not with the flag M_OPT_TYPE_OLD_SYNTAX_NO_PARAM. If it's set, the option parser assumes the option takes no argument. The only real ambiguity left, string list options that end on "-clr", are special cased in the parser. Remove some duplication of the logic in the command line parser by moving all argument splitting logic into split_opt(). (It's arguable whether that can be considered code duplication, but now the code is a bit simpler anyway. This might be subjective.) Remove the "ambiguous" parameter from all option parsing related code. Make m_config unaware of the pre-parsing concept. Make most CONF_NOCFG options also CONF_GLOBAL (except those explicitly usable as per-file options.)
* Remove teletext supportwm42012-08-032-4/+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-022-2/+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.
* input: change bind_keys() to use bstrwm42012-08-011-16/+14
| | | | | This seems rather pointless considering there are still stupid bstrdup0()s left, but maybe this is the right direction.
* input: replace internal key binds with included etc/input.confwm42012-08-011-159/+10
| | | | | | | | | | | The internal array of default key bindings is removed. Include the file etc/input.conf at compile time (using the file2header tool), and parse the default binds from etc/input.conf at startup time. This lowers maintainance overhead, and makes sure the default bindings and etc/input.conf don't deviate. Commit f30bf73bf22ed0542 already made sure etc/input.conf matches the default bindings, so this commit shouldn't change anything user-visible.
* input: refactor: store builtin key binds along user user bindswm42012-08-011-24/+26
| | | | | Builtin (i.e. default) binds are still separately handled, and this commit shouldn't change any user-visible behavior.
* input: simplify input.conf parsingwm42012-08-011-72/+28
| | | | | | | | | Now input.conf is loaded into memory at once, instead of streaming the file into the parser. The real reason for this change is that I want to be able to read the config file from memory. (Using fmemopen() would have been simpler, but that is available on sane platforms only.)
* Remove dead codewm42012-08-012-30/+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-012-0/+5
|
* mplayer: turn playtree into a list, and change per-file option handlingwm42012-07-312-23/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | |