summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* client API: make mpv_opengl_cb_uninit_gl() behavior slightly nicerwm42016-09-092-1/+9
| | | | | | Instead of deselecting the video stream plainly, use the slightly more robust error_on_track() function. Also give it an error code (although I'm not sure if this one is confusing, it's better than the one before).
* stream_dvd, stream_dvdnav: remove weird option parsing stuffwm42016-09-087-77/+120
| | | | | | Same deal as with stream_bluray. Untested because I don't give a fuck about your shitty DVDs.
* options: drop unreferenced --bluray-angle optionwm42016-09-083-6/+1
| | | | | Uh, what? It wasn't used at all. It was probably accidentally dropped at one point, or it was never used at all. Whatever, who cares.
* stream_bluray: fix a minor memory leakwm42016-09-081-2/+3
|
* stream_bluray: remove weird option parsing stuffwm42016-09-081-51/+45
| | | | | | | Instead, parse manually. This is to get rid of the option API usages, which seem unnecessary and shoehorned. (Just look at the URL pseudo parsing and the dumb url_options map. They were pretty much artifacts from refactoring old mplayer code.)
* vo: remove unused VOCTRL_GET_PANSCANwm42016-09-0812-25/+1
| | | | | | It was used to determine whether the VO supports VOCTRL_SET_PANSCAN. With all those changes to property semantics this became unnecessary, and its only use was dropped at some point.
* vo: don't access global options unsynchronizedwm42016-09-082-6/+21
| | | | | And since there's no proper fine-grained option change notification mechanism yet, intercept updates to "framedrop" manually.
* vo_opengl: use dedicated image unref function in config casewm42016-09-081-1/+1
| | | | | | | Just another corner-caseish potential issue. Unlike unreffing the image manually, unref_current_image() also takes care of properly unmapping hwdec frames. (The corner-case part of this is that it's probably never mapped at this point, but it's apparently not entirely guaranteed.)
* vo_opengl: simplify a conditionwm42016-09-081-2/+1
| | | | | | | | | | | The " || vimg->mpi" part virtually never seems to trigger, but on the other hand could possibly create unintended corner cases (for example by trying to upload a NULL image, which would then be marked as an error and render a blue screen). I guess it's a leftover from over times, where a NULL image meant "redraw the current frame". This is now handled by actually passing along the current frame.
* hwdec/opengl: Add support for CUDA and cuvid/NvDecodePhilip Langdale2016-09-0810-1/+430
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Nvidia's "NvDecode" API (up until recently called "cuvid" is a cross platform, but nvidia proprietary API that exposes their hardware video decoding capabilities. It is analogous to their DXVA or VDPAU support on Windows or Linux but without using platform specific API calls. As a rule, you'd rather use DXVA or VDPAU as these are more mature and well supported APIs, but on Linux, VDPAU is falling behind the hardware capabilities, and there's no sign that nvidia are making the investments to update it. Most concretely, this means that there is no VP8/9 or HEVC Main10 support in VDPAU. On the other hand, NvDecode does export vp8/9 and partial support for HEVC Main10 (more on that below). ffmpeg already has support in the form of the "cuvid" family of decoders. Due to the design of the API, it is best exposed as a full decoder rather than an hwaccel. As such, there are decoders like h264_cuvid, hevc_cuvid, etc. These decoders support two output paths today - in both cases, NV12 frames are returned, either in CUDA device memory or regular system memory. In the case of the system memory path, the decoders can be used as-is in mpv today with a command line like: mpv --vd=lavc:h264_cuvid foobar.mp4 Doing this will take advantage of hardware decoding, but the cost of the memcpy to system memory adds up, especially for high resolution video (4K etc). To avoid that, we need an hwdec that takes advantage of CUDA's OpenGL interop to copy from device memory into OpenGL textures. That is what this change implements. The process is relatively simple as only basic device context aquisition needs to be done by us - the CUDA buffer pool is managed by the decoder - thankfully. The hwdec looks a bit like the vdpau interop one - the hwdec maintains a single set of plane textures and each output frame is repeatedly mapped into these textures to pass on. The frames are always in NV12 format, at least until 10bit output supports emerges. The only slightly interesting part of the copying process is that CUDA works by associating PBOs, so we need to define these for each of the textures. TODO Items: * I need to add a download_image function for screenshots. This would do the same copy to system memory that the decoder's system memory output does. * There are items to investigate on the ffmpeg side. There appears to be a problem with timestamps for some content. Final note: I mentioned HEVC Main10. While there is no 10bit output support, NvDecode can return dithered 8bit NV12 so you can take advantage of the hardware acceleration. This particular mode requires compiling ffmpeg with a modified header (or possibly the CUDA 8 RC) and is not upstream in ffmpeg yet. Usage: You will need to specify vo=opengl and hwdec=cuda. Note that hwdec=auto will probably not work as it will try to use vdpau first. mpv --hwdec=cuda --vo=opengl foobar.mp4 If you want to use filters that require frames in system memory, just use the decoder directly without the hwdec, as documented above.
* vo_opengl: fix incorrect video rendering after vdpau preemption recoverywm42016-09-071-0/+1
| | | | | This could also trigger in certain other cases, whenever it falls back to dumb mode.
* vo_opengl: fix another potential vdpau preemption issuewm42016-09-071-1/+2
| | | | | | reinit() will change the image params fields, so give it a copy. Will fix potential crashes if preemption happens more than once.
* ao_rsound: fix compilationwm42016-09-071-1/+1
| | | | Probably fixes #3501.
* sub: fix previous commit with older libass releaseswm42016-09-071-0/+2
|
* sub: actually apply text alignment options to non-ASS subtitleswm42016-09-071-0/+2
| | | | | | | | | | | This is a bug fix, and the text alignment functionality probably got lost sometime along the way. For ASS subtitles, this could have unintended consequences, so it's hard to get right - thus it's not applied to ASS subtitles. For other text subtitles, this should be fine, though. It still works on ASS subtitles as promised by the manpage if --no-sub-ass is used.
* manpage: remove more references to deprecated sub-option syntaxwm42016-09-075-72/+54
| | | | Fixes #3497.
* ao_pcm: remove some useless messageswm42016-09-071-2/+0
| | | | | | The first one is printed even if the user disabled video (or there's no video), so just remove it. The second one uses deprecated sub-option syntax, so remove that as well.
* osdep: rename atomics.h to atomic.hwm42016-09-0716-17/+16
| | | | | The standard header is stdatomic.h, so the extra "s" freaks me out every time I look at it.
* atomics: readd some emulationwm42016-09-063-2/+53
| | | | | | | | | | | This time it's emulation that's supposed to work (not just dummied out). Unlike the previous emulation, no mpv code has to be disabled, and everything should work (albeit possibly a bit slowly). On the other hand, it's not possible to implement this kind of emulation without compiler support. We use GNU statement expressions and __typeof__ in this case. This code is inactive if stdatomic.h is available.
* DOCS/interface-changes.rst: list exact sub-option replacementswm42016-09-061-0/+2
| | | | | Actually, only link to a wiki page doing that, because these are too many options.
* demux: do not access global optionswm42016-09-0613-168/+241
| | | | | | | | | | | | | | | | | Don't access MPOpts directly, and always use the new m_config.h functions for accessing them in a thread-safe way. The goal is eventually removing the mpv_global.opts field, and the demuxer/stream-layer specific hack that copies MPOpts to deal with thread-safety issues. This moves around a lot of options. For one, we often change the physical storage location of options to make them more localized, but these changes are not user-visible (or should not be). For shared options on the other hand it's better to do messy direct access, which is worrying as in that somehow renaming an option or changing its type would break code reading them manually, without causing a compilation error.
* input, demux_tv: remove some older option access methodswm42016-09-062-7/+8
|
* demux_mkv: don't crash if --ordered-chapters-files failswm42016-09-061-1/+1
| | | | It just crashed.
* vo_vdpau: rename some sub-optionswm42016-09-062-5/+8
| | | | | Since the sub-options have been deprecated very recently, and are redirected to global options, we don't need to document this change.
* common: use char array for version stringwm42016-09-062-4/+4
| | | | | Use a char array instead of a pointer, which allows using the version variables in a constant context.
* vo_opengl: simplify option handlingwm42016-09-063-45/+37
| | | | | | | | | | | | | Instead of copying the options around... just don't. video.c now has full control over when options are updated. (It still gets notified from outside, but it decides when the updated options are copied: when m_config_cache_update() is called.) So there's no need for tricky stuff, and it can be simplified a bit. Also change lcms.c. We could do it like video.c, and get the options from the global config store. But it seems simpler to just provide a pointer to an option struct, which is arbitrarily mutated from the outside (from the perspective of lcms.c).
* vo_opengl: fix --icc-profile initial behaviorwm42016-09-061-0/+1
| | | | | | | | | Setting --icc-profile had no effect, until a vo_opengl option was changed at runtime. We must initialize the renderer for the initial option state too. For some reason, the ICC profile gets loaded twice. The next commit happens to fix this.
* wscript: fix typopavelxdd2016-09-061-1/+1
|
* m_config: avoid accidentally causing deprecation warningswm42016-09-051-41/+52
| | | | | | | | | It has to copy each option, whether it's deprecated or not. This would print a warning on every deprecated sub-option, even if it's not used. Yep, this is very stupid. At least m_config_get_co() gets actually slightly cleaner, because it separates the search and the deprecation handling.
* audio/out: deprecate "exclusive" sub-optionswm42016-09-059-2/+29
| | | | | | | And introduce a global option which does this. Or more precisely, this deprecates the global wasapi and coreaudio options, and adds a new one that merges their functionality. (Due to the way the sub-option deprecation mechanism works, this is simpler.)
* audio/out: deprecate device sub-optionswm42016-09-0511-24/+32
| | | | | We have --audio-device, which can force the device. Also add something describing to this extent to the manpage.
* options: deprecate suboptions for the remaining AO/VOswm42016-09-0523-74/+136
|
* options: add automagic hack for handling sub-option deprecationswm42016-09-056-5/+60
| | | | | | | | | | | | | | | | | 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_direct3d: deprecate direct3d_shaders aliaswm42016-09-054-32/+13
| | | | | And remove the difference between the aliases. This is needed to make the sub-option changes less painful.
* vo_image: move to global optionswm42016-09-055-37/+72
| | | | | This is a bit "special", because the config tree wants unique m_sub_options pointers in the whole thing.
* ao_jack: move to global optionswm42016-09-052-28/+50
|
* options: add a mechanism to make sub-option replacement slightly easierwm42016-09-0511-16/+33
| | | | | | | | 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.
* dispatch: improve recent locking changes slightlywm42016-09-051-14/+20
| | | | | | | | | | | | | | Instead of adding a lock_frame to the list when mp_dispatch_lock() is called, just set a simple flag. This uses the fact that the lock is not recursive, and can happen once per mp_dispatch_queue_process(). It avoids the dynamic allocation, and makes error checking slightly stricter. Again, this is actually redundant and exists only for error-checking. It'd actually need only a counter, because the actual locking is done by "parking" the target thread in mp_dispatch_queue_process() and then setting queue->idling=false. Only when mp_dispatch_unlock() sets it to true again other work can proceed again. Document this too.
* dispatch: redo locking, and allow reentrant processingwm42016-09-041-70/+101
| | | | | | | | | | | | | | | | | | | | | | | | | | A deadlock bug was reported with the following test program: mpv_handle *mpv = mpv_create(); mpv_set_option_string(mpv, "ytdl", "yes"); mpv_initialize(mpv); mpv_terminate_destroy(mpv); The cause of this is loading the ytdl.lua script, which triggers a certain code path that calls mp_dispatch_queue_process() recursively. It does so to wait until the script is loaded, and we want to keep that. Reentrancy was not supported by mp_dispatch, which leads to the deadlock. Rewrite the locking so that it does. We mainly get rid of the "exclusive_lock" mutex. Instead we use the existing lock/condition variable to wait until we can grab a logical lock. Note that the lock_frame business can be replaced with a simple counter. Instead of checking the lock_frame address, it'd simply increment and store the counter when entering mp_dispatch_queue_process(), and then compare the counter to decide whether or not to wait. But I think the additional error checking done by the lock_frame list is valuable. Fixes #3489.
* client API: implement mpv_suspend/resume slightly differentlywm42016-09-045-10/+20
| | | | | | | | Why do these API calls even still exist? I don't know, and maybe they don't make any sense anymore. But whether they should be removed or not is not a decision I want to make now. I want to get rid of mp_dispatch_suspend/resume(), though. So implement the client APIs slightly differently.
* travis: trigger website rebuild only on docs changesRicardo Constantino2016-09-041-0/+5
|
* travis: rebuild website for updated docs on pushStefano Pigozzi2016-09-042-0/+27
|
* client API: more option/property updateswm42016-09-031-2/+11
|
* sd_lavc: enable teletextwm42016-09-034-0/+18
| | | | | | | | | | | | 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.
* command: try selecting the next track if track switching failswm42016-09-031-3/+4
| | | | | | | | | | | | This affects the "cycle" command. If we switched to the next track, and it failed to initialize, we just deselected everything. Change it so that if initialization fails early (typically decoder selection), we try to continue with the track after that. (Even if nothing can be selected, the loop will terminate when trying to select nothing. Fixes #3446.
* player: remove opengl-es=no flag from opengl-hq profilewm42016-09-031-1/+0
| | | | | | | | This was mistakenly added. It was removed from the vo_opengl_hq defaults at an earlier time, but the documentation was not updated, which is why it made it back into the profile. Fixes #3485.
* manpage: document another option/property inconsistencewm42016-09-031-0/+13
|
* config: deprecate ao and vo auto-profileswm42016-09-032-0/+3
| | | | | | | | | These never made any sense. They checked the --vo/--ao option, and applied the profile corresponding to the first entry. So the only way to get any use of those was to use the --ao or --vo option explicitly. You can get the same functionality by making a manual profile, making these force the ao/vo, and then using --profile on command line instead of --vo/--ao.
* manpage: mention how to apply/view opengl-hq profilewm42016-09-021-1/+2
|
* ao_alsa: change sub-options to global optionswm42016-09-028-99/+117
| | | | | | 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.
* w32_common: initialize playback status as soon as possiblewm42016-09-021-16/+25
| | | | | | | | On a VOCTRL_UPDATE_PLAYBACK_STATE store the state, and use it to initialize the next time the task list becomes available. This actually fixes #3482. Revert commit f2e25e9e because it's not needed anymore.
* command: remove vo-cmdlinewm42016-09-026-26/+2
| | | | | | With the recent vo_opengl changes it doesn't do anything anymore. I don't think a deprecation period is necessary, because the command was always marked as experimental.
* options: deprecate --vo-defaultswm42016-09-024-10/+15
| | | | | | 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-0217-1101/+1139
| | | | | | | | | | | | | | | | | | | | | | | | 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>.
* vo_opengl: rename 3dlut-size to icc-3dlut-sizewm42016-09-021-1/+2
| | | | | Not documenting this yet, because a later commit will change all the options anyway.
* m_config: add some convenience functionswm42016-09-022-0/+35
| | | | To be used by the following commits.
* vo: use new option update mechanismwm42016-09-025-4/+25
| | | | | | | | | | | | | | | | 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-025