summaryrefslogtreecommitdiffstats
path: root/options
Commit message (Collapse)AuthorAgeFilesLines
* options: add automagic hack for handling sub-option deprecationswm42016-09-052-5/+51
| | | | | | | | | | | | | | | | | I decided that it's too much work to convert all the VO/AOs to the new option system manually at once. So here's a shitty hack instead, which achieves almost the same thing. (The only user-visible difference is that e.g. --vo=name:help will list the sub-options normally, instead of showing them as deprecation placeholders. Also, the sub-option parser will verify each option normally, instead of deferring to the global option parser.) Another advantage is that once we drop the deprecated options, converting the remaining things will be easier, because we obviously don't need to add the compatibility hacks. Using this mechanism is separate in the next commit to keep the diff noise down.
* vo_image: move to global optionswm42016-09-051-2/+8
| | | | | This is a bit "special", because the config tree wants unique m_sub_options pointers in the whole thing.
* options: add a mechanism to make sub-option replacement slightly easierwm42016-09-054-8/+20
| | | | | | | | Instead of requiring each VO or AO to manually add members to MPOpts and the global option table, make it possible to register them automatically via vo_driver/ao_driver.global_opts members. This avoids modifying options.c/options.h every time, including having to duplicate the exact ifdeffery used to enable a driver.
* m_config: move parts of m_config_add_option into its own functionwm42016-09-051-26/+36
| | | | Preparation for the next commit.
* sd_lavc: enable teletextwm42016-09-032-0/+3
| | | | | | | | | | | | Whitelisting supported codecs is (probably) still better than just allowing everything, given the weird FFmpeg API. I'm also assuming Libav doesn't even have the codec ID, but I didn't check. Also add a --teletext-page option, since otherwise it decodes every teletext page and shows them in succession. And yes, we can't use av_opt_set_int() - instead we have to set it as string. Because FFmpeg's option system is terrible.
* ao_alsa: change sub-options to global optionswm42016-09-022-0/+5
| | | | | | Same deal as with vo_opengl. Also edit the outdated information about multichannel output a little.
* config: allow profile forward-references in default profilewm42016-09-023-10/+19
| | | | | | | | This works by first parsing a config file into the default profile, and applying it once parsing the whole file is finished. This won't work across config files (not even if you include other config files via "include=file.conf").
* m_config: make sure profile values are never NULLwm42016-09-021-5/+4
| | | | | | | | | | Apparently this was supposed to be handled - but badly at best. Make unset values always have the value "" instead of NULL to avoid special-cases. In particular, this fixes passing NULL to a %s format specifier to printf in show_profile(). Glibc prints this as "(null)", but it's undefined behavior, and other libcs can crash.
* options: deprecate --vo-defaultswm42016-09-022-10/+12
| | | | | | With the conversion from sub-options to global options, this becomes useless. This change also comes slightly too soon, because not all VOs have been changed yet.
* vo_opengl: deprecate sub-options, add them as global optionswm42016-09-026-22/+78
| | | | | | | | | | | | | | | | | | | | | | | | vo_opengl sub-option were always rather annoying to handle. It seems better to make them global options instead. This is simpler and easier to use. The only disadvantage we are aware of is that it's not clear that many/all of these new global options work with vo_opengl only. --vo=opengl-hq is also deprecated. There is extensive compatibility with the old behavior. One exception is that --vo-defaults will not apply to opengl-hq (though with opengl it still works). vo-cmdline is also dysfunctional and will be removed in a following commit. These changes also affect opengl-cb. The update mechanism is still rather inefficient: it requires syncing with the VO after each option change, rather than batching updates. There's also no granularity (video.c just updates "everything", and if auto-ICC profiles are enabled, vo_opengl.c will fetch them on each update). Most of the manpage changes were done by Niklas Haas <git@haasn.xyz>.
* m_config: add some convenience functionswm42016-09-022-0/+35
| | | | To be used by the following commits.
* vo: use new option update mechanismwm42016-09-022-1/+2
| | | | | | | | | | | | | | | | This is still rather basic. run_reconfig() and run_control() update the options because it's needed for panscan (and other video scaling options), and fullscreen, border, ontop updates. In the old model, these options could be accessed only while both playback thread and VO threads were locked (i.e. during synchronous calls like vo_control()), so this should be sufficient in order not to miss any updates. In the future, a more fine-grained update mechanism could be added to handle these updates "exactly". x11_common.c contains an evil hack, as I see no reasonable way to handle this properly. The VO thread can't "lock" the main thread, so this is not simple.
* m_config: introduce basic mechanism to synchronize global option updateswm42016-09-022-4/+257
| | | | | | | | | | | | | | | | | | The way option runtime changes are handled is pretty bad in the current codebase. There's a big option struct (MPOpts), which contains almost everything, and for which no synchronization mechanism exists. This was handled by either making some options read-only after initialization, duplicating the option struct, using sub-options (in the VO), and so on. Introduce a mechanism that creates a copy of the global options (or parts of it), and provides a well-defined way to update them in a thread-safe way. Most code can remain the same, just that all the component glue code has to explicitly make use of it first. There is still lots of room for improvement. For example, the update mechanism could be better.
* m_config: add helper function for initializing af/ao/vf/vo suboptionswm42016-09-022-9/+22
| | | | | | | | Normally I'd prefer a bunch of smaller functions with fewer parameters over a single function with a lot of parameters. But future changes will require messing with the parameters in a slightly more complex way, so a combined function will be needed anyway. The now-unused "global" parameter is required for later as well.
* command: fix or document some property/option consistency issueswm42016-09-011-5/+5
| | | | | | | | | | | | | Make some existing properties behave more like options. This mostly means they don't deny access if the associated component is not active, but redirects to the option. One kind of fishy change is that we apply --brightness etc. only if they're not set to the default value. This won't necessarily work with --vo=xv, but affects only cases where 1. the Xv adapter has been changed to non-defaults, and 2. the user tries to reset them with mpv by passing e.g. --brightness=0. We don't care about Xv, and the noted use-case is dumb, so this change is acceptable.
* command: add options to property listwm42016-09-017-16/+39
| | | | | | | | | | | Now options are accessible through the property list as well, which unifies them to a degree. Not all options support runtime changes (meaning affected components need to be restarted for the options to take effects). Remove from the manpage those properties which are cleanly mapped to options anyway. From the user-perspective they're just options available through the property interface.
* m_config: fix "no-" option handling with sub-optionswm42016-09-011-1/+1
| | | | | | | | | | E.g. --vf=scale=no-arnd didn't work, because it didn't recognize no-arnd as flag option. The top-level command line parser is not affected by this, because it uses the result of m_config_option_requires_param() differently and assumes unknown parameters do not necessarily require a parameter. (The suboption parser can't do this.)
* vo, ao: disable positional parameter suboptionswm42016-09-012-7/+11
| | | | | | | | | | | | | | | | Positional parameters cause problems because they can be ambiguous with flag options. If a flag option is removed or turned into a non-flag option, it'll usually be interpreted as value for the first sub-option (as positional parameter), resulting in very confusing error messages. This changes it into a simple "option not found" error. I don't expect that anyone really used positional parameters with --vo or --ao. Although the docs for --ao=pulse seem to encourage positional parameters for the host/sink options, which means it could possibly annoy some PulseAudio users. --vf and --af are still mostly used with positional parameters, so this must be a configurable option in the option parser.
* m_config: remove an unused functionwm42016-08-312-24/+6
| | | | Well, almost unused.
* m_config: remove some aliasing checkswm42016-08-311-19/+2
| | | | | We strictly assume no aliasing (the previous commit removed the last case), so remove the checks.
* m_option: replace --no-video-aspect aliaswm42016-08-314-62/+31
| | | | | | | | | Instead, add a hacky OPT_ASPECT option type, which only exists to accept a "no" parameter, which in combination with the "--no-..." handling code makes --no-video-aspect work again. We can also remove the code in m_config.c, which only existed to make "--no-aspect" (a deprecated alias) to work.
* m_config: deprecate top-level suboptionswm42016-08-312-0/+7
| | | | | | | | | | | | | | | This is a really old weird MPlayer feature. While the MPlayer requires you to use the sub-option syntax in these cases, mpv "flattens" them to normal options. The still-supported alternate sub-option syntax remains a weird artifact that hopefully nobody uses. For example you can do "-sub-text font=Foo:color=0.5" instead of using "--sub-text-font=Foo --sub-text-color=0.5". For --sub-text this is an accidental feature, but it used to be documented for --demuxer-rawaudio and some others. This should just be removed, but for now only print a warning to preempt complaints from weird users wanting this feature back.
* client API: deprecate "no-..." option handlingwm42016-08-311-0/+7
| | | | | | | | The client API can do this (and there are apparently some libmpv using projects which rely on this). But it's just unnecessary bloat as it requires a separate code path from the option parser. It would be better to remove this code. Formally deprecate it, including API bump and warning in the API changes file to make it really clear.
* m_config: introduce and use OPT_ALIAS for some optionswm42016-08-313-17/+21
| | | | | | | | | | | | | | OPT_ALIAS redirects the options at a higher level, instead of introducing "duplicate" options with different name but same backing storage. This uses the OPT_REPLACED mechanisms - only the deprecation warning had to be made conditional. Note that e.g. --no-video still works, because the "--no-..." redirection and OPT_ALIAS are orthogonal. The deprecated --sub -> --sub-file alias had to be dropped, because it essentially conflicts with --no-sub. If anyone complains, this could probably still be undone by letting m_config_find_negation_opt do a special mapping for --no-sub. (Which would be dumb, but simple and effective.)
* m_config: handle --no-... options differentlywm42016-08-311-53/+44
| | | | | | | Instead of adding "no-"-prefixed aliases to the internal option list, which will act like normal options, do it in the parsing stage. This turns out to be simpler (and cheaper), and avoids adding aliased options.
* m_property: remove pointless explicitly clampingwm42016-08-313-63/+0
| | | | | | | | | This is basically dead code, and even the commit that added this code 4 years ago said that this should be for debugging only. (Though it is possible that the clamp callback was used for something else, and then unused again. Also, some of the clamping code remains and is used for internal checking, e.g. clamp_double().)
* options: make mp_vo_opts options an actual sub-option groupwm42016-08-302-69/+78
| | | | | | | | | | | Just a minor refactor along the planned option change. This commit will make it easier to update (i.e. copy) the VO options without copying _all_ options. For now, behavior should be equivalent, though. (The VO options were put into a separate struct quite early - when all global variables were removed from the source code. It wasn't clear whether the separate struct would have any actual purpose, but it seems it will now. Awesome, huh.)
* m_config: pass parent option in m_config_add_option()wm42016-08-301-9/+10
| | | | | Instead of just the parent name. This is a minor refactor as preparation for other things.
* m_config: rename is_generated to is_hiddenwm42016-08-302-7/+7
| | | | | | More appropriate. Originally it really was for automatically added options, but now it even needed some stupid comments to indicate that it was used for simply hiding options.
* m_option: remove M_OPT_TYPE_DYNAMIC flagwm42016-08-303-17/+4
| | | | | | It's actually redundant with whether m_option_type.free is set. Some option types were flagged inconsistently. Its only use was for running an additional sanity check without any real functionality.
* m_config: profile option values can be NULLwm42016-08-291-1/+2
| | | | Sigh.
* command: export profile list as a propertywm42016-08-282-0/+29
| | | | | | | Targeted at scripts, which can do whatever they want with it. This comes with the promise that they could get randomly broken any time. See #977.
* player: add option to disable video OSDwm42016-08-282-0/+5
| | | | | | | | | | | | | | Normally, OSD can be disabled with --osd-level=0. But this also disables terminal OSD, and some users want _only_ the terminal OSD. Add --video-osd=no, which essentially disables the video OSD. Ideally, it should probably be possible to control terminal and video OSD levels independently, but that would require separate OSD timers (and other state) for both components, so don't do it. But because the current situation isn't too ideal, add a threat to the manpage that might be changed in the future. Fixes #3387.
* aspect: add --video-unscaled=downscale-bigrr-2016-08-191-1/+2
|
* player: add option to control duration of image displaywm42016-08-172-0/+5
| | | | | | | | | | | | | The --image-display-duration option controls how long an image is displayed. It's also possible to display the image forever (until manual user interaction stops playback). With this, the core drops the old method to "drain" video (i.e. waiting for the last frame duration on end of playback). Instead, we reuse MPContext.time_frame. The old mechanism was disabled for non-images anyway. Fixes #3425.
* m_option: add mechanism to allow inf/-inf float optionswm42016-08-171-1/+2
| | | | Used by the next commit.
* m_option: simplify float value range handlingwm42016-08-171-21/+3
| | | | | | Use clamp_double() to handle all value restriction/verification. The error messages become a bit less nice, but they were kind of incomplete before.
* player: add --no-autoload-files optionwm42016-08-102-0/+3
| | | | Allt his auto-loading is getting annoying especially for testing.
* player: add --audio-wait-open optionswm42016-08-092-0/+2
| | | | Complements the option added in the previous commit.
* player: add --audio-stream-silencewm42016-08-092-0/+2
| | | | | Completely insane that this has to be done. Crap for compensating HDMI crap.
* options: fix channels options copy/free operationswm42016-08-051-0/+6
| | | | | For some fucked up reason the arguments can be NULL. Makes no sense to me, but ok.
* audio: use --audio-channels=auto behavior, except on ALSAwm42016-08-044-33/+94
| | | | | | | | | | | | | | | | | | | | | | | This commit adds an --audio-channel=auto-safe mode, and makes it the default. This mode behaves like "auto" with most AOs, except with ao_alsa. The intention is to allow multichannel output by default on sane APIs. ALSA is not sane as in it's so low level that it will e.g. configure any layout over HDMI, even if the connected A/V receiver does not support it. The HDMI fuckup is of course not ALSA's fault, but other audio APIs normally isolate applications from dealing with this and require the user to globally configure the correct output layout. This will help with other AOs too. ao_lavc (encoding) is changed to the new semantics as well, because it used to force stereo (perhaps because encoding mode is supposed to produce safe files for crap devices?). Exclusive mode output on Windows might need to be adjusted accordingly, as it grants the same kind of low level access as ALSA (requires more research). In addition to the things mentioned above, the --audio-channels option is extended to accept a set of channel layouts. This is supposed to be the correct way to configure mpv ALSA multichannel output. You need to put a list of channel layouts that your A/V receiver supports.
* options: un-restrict --audio-delaywm42016-08-041-1/+1
| | | | Not a real reason to restrict its value range.
* options: add vp9 to --hwdec-codecswm42016-07-301-1/+1
|
* audio: refactor mixer code and delete mixer.cwm42016-07-172-1/+2
| | | | | | | | | | | | | | | | | mixer.c didn't really deserve to be separate anymore, as half of its contents were unnecessary glue code after recent changes. It also created a weird split between audio.c and af.c due to the fact that mixer.c could insert audio filters. With the code being in audio.c directly, together with other code that unserts filters during runtime, it will be possible to cleanup this code a bit and make it work like the video filter code. As part of this change, make the balance code work like the volume code, and add an option to back the current balance value. Also, since the balance semantics are unexpected for most users (panning between the audio channels, instead of just changing the relative volume), and there are some other volumes, formally deprecate both the old property and the new option.
* videotoolbox: add --hwdec=videotoolbox-copy for h/w accelerated decoding ↵Aman Gupta2016-07-151-0/+1
| | | | with video filters
* audio: drop --softvol=no and --softvol=autowm42016-07-092-9/+9
| | | | | | | | | | | | | | Drop the code for switching the volume options and properties between af_volume and AO volume controls. interface-changes.rst mentions the changes in detail. Do this because this was exceedingly complex and had other problems as well. It was also very hard to test. It's just not worth the trouble. Some leftovers like AOCONTROL_HAS_PER_APP_VOLUME will be removed at a later point. Fixes #3322.
* options: deprecate --heartbeat-cmdwm42016-06-291-1/+2
| | | | | It's useless. --heartbeat-interval is also considered deprecated, but this is not made explicit.
* options: add a deprecation warning printing mechanismwm42016-06-292-0/+11
| | | | | | | | | | We have a warning mechanism for removed and for replaced options, but none yet for options which have been simply deprecated. For the following commit. (Fun fact: just adding the m_option field increases binary size by 14KB.)
* Fix misspellingsstepshal2016-06-261-1/+1
|
* vo_opengl: refactor performance data propertiesNiklas Haas2016-06-081-0/+2
| | | | | | | | | | | | | | | Instead of having 9 different properties, requiring 18 different VOCTRLs to read them all, they are now exposed as a single property. This is not only cleaner (since they're all together) but also allows querying all 9 of them with only a single VOCTRL (by using mp.get_property_native). (The extra factor of 2 was due to an extra query being needed to get the type, which is now also unnecessary) This makes it much easier to access performance metrics from within a lua script, and also makes it easier to just show a readable, formatted version via show-text.
* vo_opengl: somewhat simplify suboption handling messwm42016-06-041-14/+37
| | | | | | | | | | | | | | | Enable m_sub_options_copy() to copy nested sub-options, and also enable it to create an option struct from defaults. We can get rid of most of the crap in assign_options() now. Calling handle_scaler_opt() to get a static allocation for scaler name is still needed. It's moved to reinit_scaler(), which seems to be a better place for it. Without it, dangling pointers could be created when options are changed. (And in fact, this fixes possible dangling pointers for window.name.) In theory we could create a dynamic copy, but that seemed even more messy. Chance of regressions.
* options: --geometry: center window position after applying sizemaniak13492016-05-221-0/+4
| | | | | | | Center window position after applying W and H parameters of the --geometry option. Passing valid X and Y values will still override the position. Fixes #2397.
* video: add --hwdec=auto-copy modewm42016-05-111-0/+1
| | | | | | | | This uses the normal autoprobing rules like "auto", but rejects anything that isn't flagged as copying data back to system memory. The chunk in command.c was dead code, so remove it instead of updating it.
* win32: make taskbar progress indication optionalmaniak13492016-05-082-0/+3
| | | | | | | | | | | Add --taskbar-progress command line option and property which controls taskbar progress indication rendering in Windows 7+. This option is on by default and can be toggled during playback. This option does not affect the creation process of ITaskbarList3. When the option is turned off the progress bar is just hidden with TBPF_NOPROGRESS. Closes #2535
* x11: rename inappropriate --x11-bypass-compositor=never optionwm42016-05-071-1/+1
| | | | This obviously made no sense.
* x11: add --x11-bypass-compositor=alwayswm42016-05-061-1/+1
| | | | Also add missing documentation for fs-only, and correct the default.
*