summaryrefslogtreecommitdiffstats
path: root/player
Commit message (Collapse)AuthorAgeFilesLines
* vo_gpu: make it possible to load multiple hwdec interop driverswm42017-12-011-8/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make the VO<->decoder interface capable of supporting multiple hwdec APIs at once. The main gain is that this simplifies autoprobing a lot. Before this change, it could happen that the VO loaded the "wrong" hwdec API, and the decoder was stuck with the choice (breaking hw decoding). With the change applied, the VO simply loads all available APIs, so autoprobing trickery is left entirely to the decoder. In the past, we were quite careful about not accidentally loading the wrong interop drivers. This was in part to make sure autoprobing works, but also because libva had this obnoxious bug of dumping garbage to stderr when using the API. libva was fixed, so this is not a problem anymore. The --opengl-hwdec-interop option is changed in various ways (again...), and renamed to --gpu-hwdec-interop. It does not have much use anymore, other than debugging. It's notable that the order in the hwdec interop array ra_hwdec_drivers[] still matters if multiple drivers support the same image formats, so the option can explicitly force one, if that should ever be necessary, or more likely, for debugging. One example are the ra_hwdec_d3d11egl and ra_hwdec_d3d11eglrgb drivers, which both support d3d11 input. vo_gpu now always loads the interop lazily by default, but when it does, it loads them all. vo_opengl_cb now always loads them when the GL context handle is initialized. I don't expect that this causes any problems. It's now possible to do things like changing between vdpau and nvdec decoding at runtime. This is also preparation for cleaning up vd_lavc.c hwdec autoprobing. It's another reason why hwdec_devices_request_all() does not take a hwdec type anymore.
* client: Allow "C.UTF-8" as LC_NUMERIC localesfan52017-11-301-1/+1
| | | | | This is required on newer Android NDKs, as setting LC_NUMERIC to "C" will still return "C.UTF-8" if you query it.
* audio: add audio softvol processing to AOwm42017-11-291-58/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This does what af_volume used to do. Since we couldn't relicense it, just rewrite it. Since we don't have a new filter mechanism yet, and the libavfilter is too inconvenient, do applying the volume gain in ao.c directly. This is done before handling the audio data to the driver. Since push.c runs a separate thread, and pull.c is called asynchronously from the audio driver's thread, the volume value needs to be synchronized. There's no existing central mutex, so do some shit with atomics. Since there's no atomic_float type predefined (which is at least needed when using the legacy wrapper), do some nonsense about reinterpret casting the float value to an int for the purpose of atomic access. Not sure if using memcpy() is undefined behavior, but for now I don't care. The advantage of not using a filter is lower complexity (no filter auto insertion), and lower latency (gain processing is done after our internal audio buffer of at least 200ms). Disavdantages include inability to use native volume control _before_ other filters with custom filter chains, and the need to add new processing for each new sample type. Since this doesn't reuse any of the old GPL code, nor does indirectly rely on it, volume and replaygain handling now works in LGPL mode. How to process the gain is inspired by libavfilter's af_volume (LGPL). In particular, we use exactly the same rounding, and we quantize processing for integer sample types by 256 steps. Some of libavfilter's copyright may or may not apply, but I think not, and it's the same license anyway.
* af: remove deprecated audio filterswm42017-11-292-85/+1
| | | | | | | | | | | | These couldn't be relicensed, and won't survive the LGPL transition. The other existing filters are mostly LGPL (except libaf glue code). This remove the deprecated pan option. I guess it could be restored by inserting a libavfilter filter (if there's one), but for now let it be gone. This temporarily breaks volume control (and things related to it, like replaygain).
* video: remove automatic stereo3d filter insertionwm42017-11-291-12/+1
| | | | | | | | | | | | | The internal stereo3d filter was removed due to being GPL only, and due to being a mess that somehow used libavfilter's filter. Without this filter, it's hard to remove our internal stereo3d image attribute, so even using libavfilter's stereo3d filter would not work too well (unless someone fixes it and makes it able to use AVFrame metadata, which we then could mirror in mp_image). This was never well thought-through anyway, so just drop it. I think some "downsampling" support would still make sense, maybe that can be readded later.
* video: fix rotation and deinterlace auto filterswm42017-11-291-2/+6
| | | | | | | | Now using libavfilter filters directly. The rotation case is a bit lazy, because it uses the slow vf_rotate filter in all cases, instead of using special filters for 90° step rotations.
* player: match subtitles with language tags with --sub-auto=exactwm42017-11-271-18/+15
| | | | | | Apparently a relatively widespread convention, and almost as strict as the old "exact" semantics. (So it's not going to auto load radically unrelated files.)
* player: change 3 remaining GPL-only code pieces to LGPLwm42017-11-242-15/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There has been no new developments or agreements, but I was uncertain about the copyright status of them. Thus this part of code was marked as being potentially GPL, and was not built in LGPL mode. Now I've taken a close look again, and decided that these can be relicensed using the existing relicensing agreements. OSD level 3 was introduced in commit 8d190244, with the author being unreachable. As I decided in commit 6ddd95fd, OSD level 3 itself can be kept, but the "osd" command had to go, and the "rendering" of OSD level 3 (the HAVE_GPL code in osd.c) was uncertain. But the code for this was rewritten: instead of duplicating the time/percent formatting code, it was changed to use common code, and some weird extra logic was removed. The code inside of the "if" is exactly the same as the code that formats the OSD status line (covered by LGPL relicensing). The current commands for adding/removing sub/audio tracks more or less originated from commit 2f376d1b39, with the author being unreachable. But the original code was very different, mostly due to MPlayer's incredibly messy handling of subtitles in general. Nothing of this remains in the current code. Even the command declarations were rewritten. The commands (as seen from the user side) are rather similar in naming and semantics, but we don't consider this copyrightable. So it doesn't look like anything copyrightable is left. The add/cycle commands were more or less based on step_property, introduced in commit 7a71da01d6, with the patch author disagreeing with the LGPL relicensing. But all code original to the patch has been replaced in later mpv changes, and the original code was mostly copied from MP_CMD_SET_PROPERTY anyway. The underlying property interface was completely changed, the error handling was redone, and all of this is very similar to the changes that were done on SET_PROPERTY. The command declarations are completely different in the first place, because the semantic change from step to add/cycle. The commit also seems to have been co-authored by reimar to some degree. He also had the idea to change the original patch from making the command modify a specific property to making it generic. (The error message line, especially with its %g formatting, might contain some level of originality, so change that just to be sure. This commit Copies and adapts the error message for SET_PROPERTY.) Although I'm a bit on the fence with all the above things, it really doesn't look like there's anything substantial that would cause issues. I thus claim that there is no problem with changing the license to LGPL for the above things. It's probably still slightly below the standard that was usually applied in the code relicensing in mpv, but probably still far above to the usual in open source relicensing (and above commercial standards as well, if you look what certain tech giants do).
* player: minor fix/simplification of OSD time/duration handlingwm42017-11-244-24/+12
| | | | | | | | | | Always display the duration as "unknown" if the duration is known. Also fix that at least demux_lavf reported unknown duration as 0 (fix by setting the default to unknown in demux.c). Remove the dumb _u formatter function, and use a different approach to avoiding displaying "unknown" as playback time on playback start (set last_seek_pts for that).
* demux: export demuxer cache sizes in byteswm42017-11-101-0/+2
| | | | | | Plus sort of document them, together with the already existing undocumented fields. (This is mostly for debugging, so use is discouraged.)
* player: change license of some code surrounding --frames to LGPLwm42017-11-061-6/+0
| | | | The original author of the patch has agreed now.
* player: log if NDEBUG is definedwm42017-11-041-0/+3
| | | | I sure want to know whether assert()s were unexpectedly not compiled in.
* osc: make cycling visibility an input.conf key bindingwm42017-11-031-1/+1
| | | | | As builtin script, it should not register global key bindings, and add them to input.conf instead. This is similar to what stats.lua does.
* osc: render seek ranges a bit less uglyChrisK22017-11-021-1/+1
|
* osc: render seek rangeswm42017-11-021-0/+26
| | | | | | Pretty fucking ugly, but I'm not a UI designer. Of course only does something with --demuxer-seekable-cache.
* screenshot: create directories from templateNicolas F2017-11-021-0/+5
| | | | | screenshot-template could be set to e.g. "%F/%04n", so we want to make sure that the path generated from the template actually exists.
* demux: refactor to export seek rangeswm42017-10-301-7/+8
| | | | | | | | | | | | | | | | | | | | Even though only 1 seek range is supported at the time. Other than preparation for possibly future features, the main gain is actually that we finally separate the reporting for the buffering, and the seek ranges. These can be subtly different, so it's good to have a clear separation. This commit also fixes that the ts_reader wasn't rebased to the start time, which could make the player show "???" for buffered cache amount in some .ts files and others (especially at the end, when ts_reader could become higher than ts_max). It also fixes writing the cache-end field in the demuxer-cache-state property: it checked ts_start against NOPTS, which makes no sense. ts_start was never used (except for the bug mentioned above), so get rid of it completely. This also makes it convenient to move the segment check for last_ts to the demux_add_packet() function.
* lavfi: fix warnings with newer libavfilter versionswm42017-10-271-2/+2
| | | | | Most likely will cause new warnings with avfilter_graph_alloc_filter() on old libavfilter versions. Ingore that part.
* audio: fix small memory leakwm42017-10-271-0/+1
| | | | | Most commonly happened with --end, in which case that field tends to be set.
* command: change demuxer-cache-state property to return multiple rangeswm42017-10-261-20/+27
| | | | | | | | | | | | | | | | | | Even if the demuxer cache does not multiple ranges yet. This is to reduce the pain should caching of multiple ranges ever be implemented. Also change it from the sub properties stuff to return a mpv_node directly, which is less roundabout. Sub-property access won't work anymore, though. Remove the seekable-start/-end fields as well, as they're redundant with the ranges. All this would normally be considered an API change, but since it's been only a few days with no known users, change it immediately. This adds some node.c helpers as well, as the code would be too damn fugly otherwise.
* demux: drop redundant SEEK_BACKWARD flagwm42017-10-231-3/+2
| | | | | | | | | | | | | Seems like most code dealing with this was for setting it in redundant cases. Now SEEK_BACKWARD is redundant, and SEEK_FORWARD is the odd one out. Also fix that SEEK_FORWARD was not correctly unset in try_seek_cache(). In demux_mkv_seek(), make the arbitrary decision that a video stream is not required for the subtitle prefetch logic to be active. We might want subtitles with long duration even with audio only playback, or if the file is used as external subtitle.
* video: fix typo in log messageNicolas F2017-10-221-1/+1
|
* command: read the diff if you want to knowwm42017-10-211-0/+36
|
* demux: add a back buffer and the ability to seek into itwm42017-10-211-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | This improves upon the previous commit, and partially rewrites it (and other code). It does: - disable the seeking within cache by default, and add an option to control it - mess with the buffer estimation reporting code, which will most likely lead to funny regressions even if the new features are not enabled - add a back buffer to the packet cache - enhance the seek code so you can seek into the back buffer - unnecessarily change a bunch of other stuff for no reason - fuck up everything and vomit ponies and rainbows This should actually be pretty usable. One thing we should add are some properties to report the proper buffer state. Then the OSC could show a nice buffer range. Also configuration of the buffers could be made simpler. Once this has been tested enough, it can be enabled by default, and might replace the stream cache's byte ringbuffer. In addition it may or may not be possible to keep other buffer ranges when seeking outside of the current range, but that would be much more complex.
* video: fix poitential NULL derefwm42017-10-181-2/+3
| | | | | Regression introduced by direct rendering code additions. Found by same static analyzer.
* video: remove special path for hwdec screenshotswm42017-10-161-6/+0
| | | | | | | This was phased out, and was used only by vdpau by now. Drop the mechanism and the vdpau special code, which means screenshots won't include the vf_vdpaupp processing anymore. (I don't care enough about vdpau, it's on its way out.)
* stats: add file sizeJulian2017-10-131-1/+2
| | | | also one minor cosmetic change: comment the "coming soon" dummy page
* audio: clarify GPL-only partswm42017-10-101-1/+2
|
* lua: integrate stats.lua scriptJulian2017-10-092-0/+4
| | | | | | | | | Signed-off-by: wm4 <wm4@nowhere> Rename --stats to --load-stats-overlay and add an entry to options.rst over the original commit. Signed-off-by: wm4 <wm4@nowhere>
* stats: change the way toggling/oneshot works internallyJulian2017-10-091-106/+109
| | | | | | | | | | | | | | | | Previously multiple timers were used to realize oneshot, toggling (redrawing) and page keybindings. The oneshot case in particular also relied on mp.osd_message to display text only for a given duration. This was changed to only use one timer in total now. Because now each case has a defined "start" and "end" point (including oneshot) mp.set_osd_ass() can be used to print stats as well. This is currently optional and has to be activated using the config option persistent_overlay=true. One shortcoming: oneshot and toggling are mutual exclusive right now. Previously you could enter toggling while oneshot stats were shown, this is not possible anymore to reduce the number of cases to be considered. This can be added later on if desired.
* stats: stop coloring timing valuesJulian2017-10-091-26/+8
| | | | | | It used a bad heuristic that got even worse/less reliable with recent changes in mpv. In fact, it's not reliable at all. Watch out for dropped frames instead. That's a useful indicator.
* stats: add current and total chapter numberJulian2017-10-091-1/+8
| | | | | Fixes #44 (well, partially, I'm still not sure about the time)
* stats: add audio and video filtersJan Janssen2017-10-091-0/+55
|
* stats: reorganize the framedrop countersNiklas Haas2017-10-091-4/+5
| | | | | Clarified the relationship between `Dropped` and `VO`, and also merged the DS-exclusive stats into the DS line.
* stats: revert DR indicator as it's unnecessaryJulian2017-10-091-2/+1
| | | | | It's apparently already stated as part of the upload pass name. This reverts commit ec837f64c29a1b825e28b65edc34059b6c1cad40.
* stats: reduce default font size to 8Julian2017-10-091-1/+1
|
* stats: visually indicate direct renderingJulian2017-10-091-1/+2
|
* stats: change font weight of % sign as wellJulian2017-10-091-1/+1
| | | | Due to popular demand
* stats: fix indentation/newline of frame timing pageJulian2017-10-091-11/+11
| | | | There was a superfluous newline and some indentation
* stats: show % of a pass on frame timing pageJulian2017-10-091-9/+23
|
* stats: always print perfdata totalJulian2017-10-091-7/+4
| | | | There's no point in disabling it anyway
* stats: make add_header() append at current positionJulian2017-10-091-7/+7
|
* stats: print perfdata total by defaultJulian2017-10-091-1/+1
| | | | There is enough space now
* stats: mark dummy as suchJulian2017-10-091-1/+1
|
* stats: correctly re-eval ASS tag usageJulian2017-10-091-11/+17
| | | | Fixes #42
* stats: make page keybinding repeatableJulian2017-10-091-1/+1
| | | | There's no reason it's not.
* stats: remove table in tableJulian2017-10-091-14/+6
| | | | | | Almost cosmetic change. This tables-in-table was done back when we actually processed strings but that's long ago now and no longer needed nor useful.
* stats: resilience against accidential timer removalJulian2017-10-091-9/+12
| | | | | | | Previously I could trigger a bug with intense button mashing, however, was unable to reproduce it and therefore debug it. This change now seems to be resilient against button mashing, let's hope it really is.
* stats: allow keybindings for specific pageJulian2017-10-091-12/+21
| | | | | | A keybinding in input.conf like: e script-binding stats/display-page-2 can be used to directly show the respective page (2, in this case)
* stats: support for multiple "pages" of statsJulian2017-10-091-26/+124
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Please note that the latest version of this script needs a very recent version of mpv (from yesterday, to be precise, see the readme). For older versions, please go to "releases". HOW IT WORKS: While the stats are visible (i.e. text is printed to the OSD) a subsequent click on a numeric key (1, 2, ...) will display the corresponding "page". This works no matter if the stats are toggled or just shown as a single invocation. In case of a single invocation, the newly displayed page will be shown for the full duration again. The selected page will be remembered (not persistantly though). So far, only 3 pages are available. 1: the default page, stats as they used to be 2: extensive VO performance stats (to be redesigned/changed soon) 3: dummy In the future, many more pages are possible. Implementation is likely to change again (functionality will stay the same). A new timer had to be introduced to remove the forced keybindings in the oneshot case. The toggle case can remove them without a timer. Ensuring that each mode won't remove timers of the other mode didn't really turn out neat. Therefore, I intend to change this again, maybe by merging the oneshot case into the toggle case.
* stats: remove check for lua timer functionJulian2017-10-091-8/+0
| | | | | We now require a modern mpv version. `property_aliases` is kept for future use.
* stats: rescale graphs to make the average align with the center, if possibleNiklas Haas2017-10-091-4/+11
| | | | | For vsync measurements this is not currently done because they don't track their average
* stats: add support for `vo-passes`, which replaces `vo-performance`Niklas Haas2017-10-091-68/+60
| | | | | | | | | | | Due to the large amount of per-pass data, the function takes a parameter indicating whether or not to print a simplified view instead. The overall intent is to print the simplified view for now, but supposed printing the full view on a dedicated "tab" (or extra view type), and as such, `o.print_perfdata_passes` will go away again. I've only introduced it for now so users can play around with this functionality if they want to, until Argon- gets around to implementing stats "tabs".
* stats: update HDR peak for upstream changesNiklas Haas2017-10-091-2/+2
| | | | | This no longer reports cd/m² but now reports a relative peak as a multiple of the SDR reference brightness.
* stats: add support for deprecated propertiesJulian2017-10-091-11/+21
| | | | | | | | | | | | | | Previously, we used a property and when it was unavailable we assumed it doesn't exist before assuming it really is just unavailable. This lead to unnecessarily falling back to deprecated properties which made mpv print deprecation warnings. Now we can really check if a property is not known to mpv. The alternative would've been to check the error part of mp.get_property and perform string comparisons on the returned error message. Not sure if supporting old mpv versions is actually worth it though. Fixes #37 #36
* stats: comment to remind me about deprecated propertiesJulian2017-10-091-0/+1
|
* stats: add new versions of decoder and VO dropped frame countsRicardo Constantino2017-10-091-1/+5
|
* stats: put vsync ratio and jitter on the same lineJulian2017-10-091-15/+10
| | | | Free some vertical space. Hope this doesn't hurt visibility.
* stats: declare function as localJulian2017-10-091-1/+1
| | | | Apparently forgot this one
*