summaryrefslogtreecommitdiffstats
path: root/options
Commit message (Collapse)AuthorAgeFilesLines
* vo_gpu: vulkan: generalize SPIR-V compilerNiklas Haas2017-09-262-0/+3
| | | | | | | | | | | | | | In addition to the built-in nvidia compiler, we now also support a backend based on libshaderc. shaderc is sort of like glslang except it has a C API and is available as a dynamic library. The generated SPIR-V is now cached alongside the VkPipeline in the cached_program. We use a special cache header to ensure validity of this cache before passing it blindly to the vulkan implementation, since passing invalid SPIR-V can cause all sorts of nasty things. It's also designed to self-invalidate if the compiler gets better, by offering a catch-all `int compiler_version` that implementations can use as a cache invalidation marker.
* vo_gpu: vulkan: initial implementationNiklas Haas2017-09-262-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This time based on ra/vo_gpu. 2017 is the year of the vulkan desktop! Current problems / limitations / improvement opportunities: 1. The swapchain/flipping code violates the vulkan spec, by assuming that the presentation queue will be bounded (in cases where rendering is significantly faster than vsync). But apparently, there's simply no better way to do this right now, to the point where even the stupid cube.c examples from LunarG etc. do it wrong. (cf. https://github.com/KhronosGroup/Vulkan-Docs/issues/370) 2. The memory allocator could be improved. (This is a universal constant) 3. Could explore using push descriptors instead of descriptor sets, especially since we expect to switch descriptors semi-often for some passes (like interpolation). Probably won't make a difference, but the synchronization overhead might be a factor. Who knows. 4. Parallelism across frames / async transfer is not well-defined, we either need to use a better semaphore / command buffer strategy or a resource pooling layer to safely handle cross-frame parallelism. (That said, I gave resource pooling a try and was not happy with the result at all - so I'm still exploring the semaphore strategy) 5. We aggressively use pipeline barriers where events would offer a much more fine-grained synchronization mechanism. As a result of this, we might be suffering from GPU bubbles due to too-short dependencies on objects. (That said, I'm also exploring the use of semaphores as a an ordering tactic which would allow cross-frame time slicing in theory) Some minor changes to the vo_gpu and infrastructure, but nothing consequential. NOTE: For safety, all use of asynchronous commands / multiple command pools is currently disabled completely. There are some left-over relics of this in the code (e.g. the distinction between dev_poll and pool_poll), but that is kept in place mostly because this will be re-extended in the future (vulkan rev 2). The queue count is also currently capped to 1, because of the lack of cross-frame semaphores means we need the implicit synchronization from the same-queue semantics to guarantee a correct result.
* m_config: better variable namewm42017-09-221-5/+5
|
* options: properly handle deprecated options with CLI actionswm42017-09-221-8/+23
| | | | | | | | We want e.g. --opengl-shaders-append=foo to resolve to the new option, all while printing an option name. --opengl-shader is a similar case. These options are special, because they apply "actions" on actual options by specifying a suffix. So the alias/deprecation handling has to be part of resolving the actual option from prefix and suffix.
* build: make vo_gpu + infrastructure non-optionalwm42017-09-221-6/+0
| | | | | Also readd the the error message for when no GL backends are found (why was this removed?).
* vo_opengl: refactor into vo_gpuNiklas Haas2017-09-212-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is done in several steps: 1. refactor MPGLContext -> struct ra_ctx 2. move GL-specific stuff in vo_opengl into opengl/context.c 3. generalize context creation to support other APIs, and add --gpu-api 4. rename all of the --opengl- options that are no longer opengl-specific 5. move all of the stuff from opengl/* that isn't GL-specific into gpu/ (note: opengl/gl_utils.h became opengl/utils.h) 6. rename vo_opengl to vo_gpu 7. to handle window screenshots, the short-term approach was to just add it to ra_swchain_fns. Long term (and for vulkan) this has to be moved to ra itself (and vo_gpu altered to compensate), but this was a stop-gap measure to prevent this commit from getting too big 8. move ra->fns->flush to ra_gl_ctx instead 9. some other minor changes that I've probably already forgotten Note: This is one half of a major refactor, the other half of which is provided by rossy's following commit. This commit enables support for all linux platforms, while his version enables support for all non-linux platforms. Note 2: vo_opengl_cb.c also re-uses ra_gl_ctx so it benefits from the --opengl- options like --opengl-early-flush, --opengl-finish etc. Should be a strict superset of the old functionality. Disclaimer: Since I have no way of compiling mpv on all platforms, some of these ports were done blindly. Specifically, the blind ports included context_mali_fbdev.c and context_rpi.c. Since they're both based on egl_helpers, the port should have gone smoothly without any major changes required. But if somebody complains about a compile error on those platforms (assuming anybody actually uses them), you know where to complain.
* build: add preliminary LGPL modewm42017-09-211-9/+7
| | | | | | | See "Copyright" file for caveats. This changes the remaining "almost LGPL" files to LGPL, because we think that the conditions the author set for these was finally fulfilled.
* audio: make libaf derived code optionalwm42017-09-211-1/+6
| | | | | | | | | | | | | | | This code could not be relicensed. The intention was to write new filter code (which could handle both audio and video), but that's a bit of work. Write some code that can do audio conversion (resampling, downmixing, etc.) without the old audio filter chain code in order to speed up the LGPL relicensing. If you build with --disable-libaf, nothing in audio/filter/* is compiled in. It breaks a few features, such as --volume, --af, pitch correction on speed changes, replaygain. Most likely this adds some bugs, even if --disable-libaf is not used. (How the fuck does EOF notification work again anyway?)
* options: remove --heartbeat-cmd and --heartbeat--intervalwm42017-09-182-7/+1
| | | | | | | | | This mechanism uses system() and shouldn't even exist. x11_common.c has its own solution for the original problem (disabling Linux DE screensavers without MPlayer/mpv having to link a dbus lib). If that is not sufficient, you can create a simple Lua script. Incidentally fixes #4888.
* video: increase --monitorpixelaspect rangeJames Ross-Gowan2017-08-261-1/+1
| | | | | | | | | | | | | | | | | Some people use very wide display modes such as 3840x240 with their CRT televisions because it lessens scaling artifacts in video game emulators. When using a 3840x240 display mode on a 4:3 CRT television, the pixel aspect ratio is 1:12, so in order to watch a video with mpv on the same television without changing the display mode, the user should use --monitorpixelaspect=1:12. Unfortunately, 1:12 (or 0.083) was out of range for the --monitorpixelaspect option. There was no good reason for this, so extend the range of the option to 1:32-32:1 (0.03125-32,) which should be more than enough to support "super-wide" display modes like these. This is related to #4483, but it doesn't fix the issue (which was to do with subtitle rendering.)
* command: restore OSD marker for video equalizer propertieswm42017-08-231-5/+0
| | | | | | | Commit 03cf150ff3516 accidentally dropped these. Readd them in a simpler way (so only a property_osd_display[] entry is enough). This commit doesn't actually touch the video equalizer properties, because the default value of 0 for the marker is what they require anyway.
* video: change --deinterlace behaviorwm42017-08-222-6/+3
| | | | | | | | | | | | This removes all GPL only code from it, and that's the whole purpose. Also happens to be much simpler. The "deinterlace" option still sort of exists, but only as runtime changeable option. The main change in behavior is that the property will not report back the actual deint state. Or in other words, if inserting or initializing the filter fails, the deinterlace property will still return "yes". This is in line with most recent behavior changes to properties and options.
* video: redo video equalizer option handlingwm42017-08-222-21/+2
| | | | | | | | | | | | | | | | | | | | | | | I really wouldn't care much about this, but some parts of the core code are under HAVE_GPL, so there's some need to get rid of it. Simply turn the video equalizer from its current fine-grained handling with vf/vo fallbacks into global options. This makes updating them much simpler. This removes any possibility of applying video equalizers in filters, which affects vf_scale, and the previously removed vf_eq. Not a big loss, since the preferred VOs have this builtin. Remove video equalizer handling from vo_direct3d, vo_sdl, vo_vaapi, and vo_xv. I'm not going to waste my time on these legacy VOs. vo.eq_opts_cache exists _only_ to send a VOCTRL_SET_EQUALIZER, which exists _only_ to trigger a redraw. This seems silly, but for now I feel like this is less of a pain. The rest of the equalizer using code is self-updating. See commit 96b906a51d5 for how some video equalizer code was GPL only. Some command line option names and ranges can probably be traced back to a GPL only committer, but we don't consider these copyrightable.
* options: add a thread-safe way to notify option updateswm42017-08-224-13/+127
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | So far, we had a thread-safe way to read options, but no option update notification mechanism. Everything was funneled though the main thread's central mp_option_change_callback() function. For example, if the panscan options were changed, the function called vo_control() with VOCTRL_SET_PANSCAN to manually notify the VO thread of updates. This worked, but's pretty inconvenient. Most of these problems come from the fact that MPlayer was written as a single-threaded program. This commit works towards a more flexible mechanism. It adds an update callback to m_config_cache (the thing that is already used for thread-safe access of global options). This alone would still be rather inconvenient, at least in context of VOs. Add another mechanism on top of it that uses mp_dispatch_queue, and takes care of some annoying synchronization issues. We extend mp_dispatch_queue itself to make this easier and slightly more efficient. As a first application, use this to reimplement certain VO scaling and renderer options. The update_opts() function translates these to the "old" VOCTRLs, though. An annoyingly subtle issue is that m_config_cache's destructor now releases pending notifications, and must be released before the associated dispatch queue. Otherwise, it could happen that option updates during e.g. VO destruction queue or run stale entries, which is not expected. Rather untested. The singly-linked list code in dispatch.c is probably buggy, and I bet some aspects about synchronization are not entirely sane.
* options: change --loop semanticswm42017-08-141-2/+1
| | | | As announced by the previous deprecation.
* player: add --track-auto-selection optionwm42017-08-122-0/+3
| | | | I imagine this is useful. Or maybe it isn't.
* player: make --lavfi-complex changeable at runtimewm42017-08-122-2/+3
| | | | | | | | Tends to be somewhat glitchy if subtitles are enabled, and you enable and disable tracks. On error, this will disable --lavfi-complex, which will result in whatever behavior.
* vo_opengl: separate hwdec context and mapping, port it to use rawm42017-08-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This does two separate rather intrusive things: 1. Make the hwdec context (which does initialization, provides the device to the decoder, and other basic state) and frame mapping (getting textures from a mp_image) separate. This is more flexible, and you could map multiple images at once. It will help removing some hwdec special-casing from video.c. 2. Switch all hwdec API use to ra. Of course all code is still GL specific, but in theory it would be possible to support other backends. The most important change is that the hwdec interop returns ra objects, instead of anything GL specific. This removes the last dependency on GL-specific header files from video.c. I'm mixing these separate changes because both requires essentially rewriting all the glue code, so better do them at once. For the same reason, this change isn't done incrementally. hwdec_ios.m is untested, since I can't test it. Apart from superficial mistakes, this also requires dealing with Apple's texture format fuckups: they force you to use GL_LUMINANCE[_ALPHA] instead of GL_RED and GL_RG. We also need to report the correct format via ra_tex to the renderer, which is done by find_la_variant(). It's unknown whether this works correctly. hwdec_rpi.c as well as vo_rpi.c are still broken. (I need to pull my RPI out of a dusty pile of devices and cables, so, later.)
* options: fix --includewm42017-08-081-0/+2
| | | | | | | | This is really obnoxious. --include parses into the default profile, but when used on the command line, it did never get applied. So we have to apply it when the exact conditions for this are met. Fixes #4673.
* cocoa: add an option to disable the native macOS fullscreenAkemi2017-08-062-0/+3
| | | | Fixes #4014
* options: --priority can be LGPLwm42017-08-031-1/+1
| | | | | | | Original author has agreed now. Also fix the notice in dec_video.c - all GPL-only code is gone (unrelated to --priority/its author).
* options: fix --external-file alias typoMartin Herkt2017-07-291-1/+1
|
* options: drop --video-aspect-method=hybridwm42017-07-211-1/+1
| | | | | | | | | Remove this code because it could be argued that it contains GPL-only code (see commit 642e963c860 for details). The remaining aspect methods appear to work just as well, are potentially more compatible to other players, and the code becomes much simpler.
* client API: drop some compatibility handlingwm42017-07-211-13/+2
| | | | See commit e4bc563fd2dcf for more information.
* options: kill --field-dominancewm42017-07-212-8/+0
| | | | GPL-only author, no chance of relicensing.
* options/path: fallback to USERPROFILE if HOME isn't setRicardo Constantino2017-07-061-1/+4
| | | | | | | HOME isn't set by default on Windows. But if the user does set it, prefer it by default. Enables stuff like --log-file=~/mpv.log to work, even if HOME isn't set.
* m_option: deprecate multiple items for -add etc.wm42017-07-021-2/+10
| | | | | | | | This is more confusing than it helps, and forces escaping more stuff. For example, for string lists we could remove all need for escaling with -add and -pre. The user can simply use multiple of those options.
* options: change everything againwm42017-07-024-43/+50
| | | | Fucking bullshit.
* m_option: remove unused error codewm42017-07-022-9/+1
| | | | | The situation in the str_list_* functions can never happen, and they were the only users of this error code.
* m_option: remove redundant indirectionswm42017-07-024-51/+28
| | | | | | Remove the various redundant m_config_set_option* calls, rename the remaining one to m_config_set_option_cli(), and merge the m_config_parse_option() function.
* d3d: make DXVA2 support optionalwm42017-06-301-1/+1
| | | | | | | | | | | | This partially reverts the change from a longer time ago to always build DXVA2 and D3D11VA together. To make it simpler, we change the following: - building with ANGLE headers is now required to build D3D hwaccels - if DXVA2 is enabled, D3D11VA is still forcibly built - the CLI vo_opengl ANGLE backend is now under --egl-angle-win32 This is done to reduce the dependency mess slightly.
* options: change path list options, and document list optionswm42017-06-303-13/+14
| | | | | | | | | | | | | | | | | | | | | | | The changes to path list options is basically getting rid of the need to pass multiple paths to a single option. Instead, you can use the option multiple times. The old behavior can be used by using the -set suffix with the option. Change some options to path lists. For example --script is now append by default, and if you use --script-set, you need to use ":"/";" as separator instead of ",". --sub-paths/--audio-file-paths is a deprecated alias now, and will break if the user tries to pass multiple paths to it. I'm assuming that if these are used, most users will pass only 1 path anyway. --opengl-shaders has more compatibility handling, since it's probably rather common that users pass multiple options to it. Also document all that in the manpage. I'll probably regret this later, as it somewhat increases the complexity of the option parser, rather than increasing it.
* video: change --video-aspect-method default value againwm42017-06-291-1/+1
| | | | | | I noticed that the previous default, bitstream, actually breaks with some shitty anamorphic DVD rips that signal square pixel aspect in the bitstream. So I think the "container" method is a better default.
* Universal Windows Plaform (UWP) supportPedro Pombeiro2017-06-291-1/+3
| | | | | | | | libmpv only. Some things are still missing. Heavily reworked. Signed-off-by: wm4 <wm4@nowhere>
* build: change how some OS specific source files are selectedwm42017-06-291-2/+2
| | | | | | | | | | | | | | | | | | In a bunch of cases, we emulate highly platform specific APIs on a higher level across all OSes, such as IPC, terminal, subprocess handling, and more. We have source files for each OS, and they implement all the same mpv internal API. Selecting which source file to use on an OS can be tricky, because there is partially overlapping and emulated APIs (consider Cygwin on Windows). Add a pick_first_matching_dep() function to make this slightly easier and more structured. Also add dummy backends in some cases, to deal with APIs not being available. Clarify the Windows dependency identifiers, as these are the most confusing.
* build: replace glob() check and assume it's always in POSIXwm42017-06-291-1/+1
| | | | | POSIX requires glob(), so no need to check for it. Together with the fact that we can emulate glob() on Windows, glob() is always available.
* options: sort action list alphabeticallywm42017-06-271-11/+11
| | | | | | There is no technical need for this, but it's nicer if --list-options appears to output them sorted (it only actually sorts the actual option list, while actions are output in the order they are defined).
* options: expose string list actions for --sub-file optionwm42017-06-271-23/+38
| | | | | | | | | | | | This means you can use --sub-file-set=a,b,c to set a string list separated by ',', while --sub-file=filename,with,commas.srt still works (the original motivation for changing the --sub-file option this way). You can also use it to append strings to string list options without the need for escale, e.g.: --opengl-shaders-add-str=unescapesdfilename.glsl (The normal -add for some reason expects a ',' separated list as argument.)
* options: list suffix actions as options toowm42017-06-271-2/+7
| | | | | | | These are not "really" separate actions, but on the command line they're obserable as such. So it would be a good idea to list them too. Adds about 117 options (holy fuck).
* options: handle suffixes like -add in a more generic waywm42017-06-264-125/+148
| | | | | | | | | | | | | | | | This affects options like --vf or --display-tags. These used a "*" suffix to match all options starting with a specific name, and handled the rest in the option parser. Change this to remove the "*" special case, and require every option parser to declare a list of allowed suffixes via m_option_type.actions. The new way is conceptually simpler, because we don't have to account for the "*" in a bunch of places anymore, and instead everything is centrally handled in the CLI part of the option parser, where it's actually needed. It automatically enables suffixes like -add for a bunch of other stringlist options.
* client API: drop old "no-" option emulationwm42017-06-261-22/+2
| | | | | | | You could do mpv_set_option(h, "no-fs", ""), which would behave like "--no-fs" on the command line. At one point, this had to be emulated for compatibility, and printed a deprecation warning. This was almost a year ago, so remove it.
* options: suggest a replacement for --field-dominancewm42017-06-251-1/+1
|
* Revert "parse_commandline: fail gracefully on bad args"wm42017-06-242-6/+3
| | | | | | This reverts commit 38b05daf7d16898f4a63e4ccf48479d8964e6e19. There was actually no LGPL relicensing agreement with wd0.
* options: simplify and rename m_option_type_storewm42017-06-233-50/+27
| | | | | | | | | | This was an annoying option type. And still is. But at least it's on the same level as m_option_type_print_fn now, and can probably cleaned up further like it. Both types are for options that are only on the command line, always have special handling (i.e. do something with them in parse_commandline.c before passing them to the generic m_config.c/m_option.c layers), and are m_options only for --list-options and (oddly) the split_opt_silent() function.
* options: remove weird --really-quiet special behaviorwm42017-06-232-2/+2
| | | | | | | | | This was especially grating because it causes problems with the option/property unification, uses as only thing OPT_FLAG_STORE, and behaves weird with the client API or scripts. It can be reimplemented in a much simpler way, although it needs slightly more code. (Simpler because less special cases.)
* options: unbreak -hwm42017-06-233-4/+9
| | | | Sure is a simple thing to break.
* player: change license of most core files to LGPLwm42017-06-231-7/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These files have all in common that they were fully or mostly taken from mplayer.c. (mplayer.c was a huge file that contains almost all of the playback core, until it was split into multiple parts.) This was probably the hardest part to relicense, because so much code was moved around all the time. player/audio.c still does not compile. We'll have to redo audi