aboutsummaryrefslogtreecommitdiffhomepage
path: root/player/osd.c
Commit message (Collapse)AuthorAge
* player: different way to auto-enable the demuxer cacheGravatar wm42017-02-02
| | | | | | | | | | | | | | | Instead of enabling it only when a stream-cache is enabled, also try to enable it independently from that if the demuxer is marked as is_network. Also add some code to the EDL code, so EDLs containing network streams are automatically cached this way. Extend the OSD info line so that it shows the demuxer cache in this case (more or less). I didn't find where or whether options.rst describes how the demuxer cache is enabled, so no changes there.
* player: remove dysfunctional edition switching OSD codeGravatar wm42017-01-05
| | | | | | | | | | | | | Was intended to show a "nice" message on edition switching. In practice, the message was never visible. The OSD code checks whether a demuxer is loaded, and if not, discards the message - meaning if the OSD code happened to run before the demuxer was fully loaded, no message was shown. This is apparently a regression due to extensions to the OSD and the situations in which it can be used. Remove the broken code since it's too annoying to fix. Instead, a default property message will be shown, which is a bit uglier, but actually not too unuseful.
* player: litter code with explicit wakeup callsGravatar wm42016-09-16
| | | | | | | | | | | | | This does 3 kinds of changes: - change sleeptime=x to mp_set_timeout() - change sleeptime=0 to mp_wakeup_core() calls (to be more explicit) - change commands etc. to call mp_wakeup_core() if they do changes that require the playloop to be rerun This is preparation for the following changes. The goal is to process client API requests without having to rerun the playloop every time. As of this commit, the changes should not change behavior. In particular, the playloop is still implicitly woken up on every command.
* player: add option to disable video OSDGravatar wm42016-08-28
| | | | | | | | | | | | | | 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.
* player: avoid some redundant terminal status updatesGravatar wm42016-08-26
| | | | | Run term_osd_update() just once per update, instead of twice (once for the status line, and once for the terminal OSD messafe).
* player: do not cut off terminal status line if it contains newlinesGravatar wm42016-07-15
| | | | | | | Just a heuristic to preserve the status line in odd corner cases. Probably a crap idea. Fixes #3340.
* player: cut off status line on terminal widthGravatar wm42016-07-06
| | | | | | | | | | If the status line is wider than the reported terminal size, then cut it off instead of causing the terminal to scroll down for the next line. This is done in the most primitive way possible, assuming ASCII. This was actually done in the past as far as I'm aware; do it again. (Probably differently.)
* player: fix previous commitGravatar wm42016-06-12
| | | | | | | Of course we can't just skip updating the OSD if the playloop was woken up for the purpose of removing OSD after an OSD timer expired. Fixes e.g. OSD bars sometimes sticking along when seeking while paused.
* player: do not update OSD all the time when pausedGravatar wm42016-06-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | Normally, OSD is updated every time the playloop is run. This has to be done, because the OSD may implicitly reference various properties, without knowing whether they really need to be updated or not. (There's a property update mechanism, but it's mostly unavailable, because OSD is special-cased and can not use the client API mechanism properly.) Normally, these updates are no problem, because the OSD is only actually printed when the OSD text actually changes. But commit d23ffd24 added a rate-limiting mechanism, which tries to limit OSD updates at most every 50ms (or the next video frame). Since it can't know in advance whether the OSD is going to change or not, this simply waked up the player every 50ms. Change this so that the player is updated only as part of general updates determined through mp_notify(). (This function also notifies the client API of changed properties.) The desired result is that the player will not wake up at all in normal idle mode, but still update properties that can change when paused, such as the cache. This is mostly a cosmetic change (in the sense of making runtime behavior just slightly better). It has the slightly more negative consequence that properties which update implicitly (such as "clock") will not update periodically anymore.
* player: fix OSD bar chapter marksGravatar wm42016-04-22
| | | | Truly dumb bug introduced with the previous commit.
* command: if only ab-loop-b is set, loop from start of fileGravatar wm42016-04-21
| | | | | | | | | | Commit 382bafcb changed the behavior for ab-loop-a. This commit changes ab-loop-b so that the behavior is symmetric. Adjust the OSD rendering accordingly to the two changes. Also fix mentions of the "ab_loop" command to the now preferred "ab-loop".
* player: hide cache in status line by default againGravatar wm42016-03-30
| | | | | | Commit 57506b27 accidentally broke this. The status (including the usually always active demuxer cache) should be shown only if the stream cache is actually enabled.
* cache: use a single STREAM_CTRL for various cache infoGravatar wm42016-03-29
| | | | | | | | Instead of having a separate for each, which also requires separate additional caching in the demuxer. (The demuxer adds an indirection, since STREAM_CTRLs are not thread-safe.) Since this includes the cache speed, this should fix #3003.
* osd: cleanup: make OSDTYPE_ constants private to OSD codeGravatar wm42016-03-08
| | | | | | No need to have them everywhere. The only exception/annoyance is MAX_OSD_PARTS, which is now basically duplicated (and at runtime initialization is checked with an assert()).
* player: remove old timeline/ordered chapters supportGravatar wm42016-02-15
|
* player: use different variable to indicate coverartGravatar wm42016-02-01
| | | | Slightly better.
* player: refactor: some more minor decoder/output decouplingGravatar wm42016-01-29
| | | | | | These changes don't make too much sense without context, but are preparation for later. Then the audio_src/video_src fields will be actually be NULL under circumstances.
* player: refactor: eliminate MPContext.d_audioGravatar wm42016-01-22
|
* player: never show "DS: (unavailable)"Gravatar wm42016-01-20
| | | | Kind of annoying.
* player: refactor: eliminate MPContext.d_videoGravatar wm42016-01-17
| | | | | | | | | | | | | | Eventually we want the VO be driven by a A->V filter, so a decoder doesn't even have to exist. Some features definitely require a decoder though (like reporting the decoder in use, hardware decoding, etc.), so for each thing which accessed d_video, it has to be redecided if and how it can access decoder state. At least the "framedrop" property slightly changes semantics: you can now always set this property, even if no video is active. Some untested changes in this commit, but our bio-based distributed test suite has to take care of this.
* video: refactor: disentangle decoding/filtering some moreGravatar wm42016-01-16
| | | | | | | | | | | This moves some code related to decoding from video.c to dec_video.c, and also removes some accesses to dec_video.c from the filtering code. dec_video.ch is starting to make sense, and simply returns video frames from a demuxer stream. The API exposed is also somewhat intended to be easily changeable to move decoding to a separate thread, if we ever want this (due to libavcodec already being threaded, I don't see much of a reason, but it might still be helpful).
* mpv_talloc.h: rename from talloc.hGravatar Dmitrij D. Czarkoff2016-01-11
| | | | This change helps avoiding conflict with talloc.h from libtalloc.
* osd: do not let OSD messages overwrite --osd-msgN textGravatar wm42015-11-29
| | | | | | | | | Requested. Don't overwrite permanent OSD text set with e.g. --osd-msg1. Instead, append the OSD message to it (on the next line). Note that with --osd-msg1, seeking will still overwrite the OSD with the playback status for a while. If you do not want this, use --osd-msg3 --osd-level=3 instead.
* player: replace mistimed-frame-count with vsync-ratio on status lineGravatar wm42015-11-18
| | | | I think this is much more informative. Maybe.
* player: remove OSD subtitle render pathGravatar wm42015-11-17
| | | | | | | | | | | | | | | | | | | This was used with --no-sub-ass (aka --no-ass). This option (which is not yet removed) strips all styling from the subtitles, and renders them as plaintext only. For some reason, it originally seemed convenient to reuse all the OSD text rendering code (osd_libass.c). While this was indeed simple, it had a bad influence on the rest of the code. For example, it had to decide whether to go through the OSD code path, or the proper subtitle renderer in sd_ass.c. Kill the OSD subtitle renderer. Reimplement --no-sub-ass and also "secondary" subtitles in sd_ass.c. fill_plaintext() contains some rather minor code duplication with osd_libass.c for setting up a dummy ASS_Event and escaping the stripped text. Since sd_ass.c already has to handle "normal" text subtitles, and has code for stripping ASS tags, this remains all relatively simple. Remove all the unnecessary crap from the rest of the code.
* player: handle rebasing start time differentlyGravatar wm42015-11-16
| | | | | | | | | | | | | | | | Most of this is explained in the DOCS additions. This gives us slightly more sanity, because there is less interaction between the various parts. The goal is getting rid of the video_offset entirely. The simplification extends to the user API. In particular, we don't need to fix missing parts in the API, such as the lack for a seek command that seeks relatively to the start time. All these things are now transparent. (If someone really wants to know the real timestamps/start time, new properties would have to be added.)
* win32: support taskbar button progress indicatorGravatar Martin Herkt2015-11-15
| | | | | | | | | | | This adds support for the progress indicator taskbar extension that was introduced with Windows 7 and Windows Server 2008 R2. I don’t like this solution because it keeps its own state and introduces another VOCTRL, but I couldn’t come up with anything less messy. closes #2399
* command: rename vo-missed-frame-count propertyGravatar wm42015-11-13
| | | | | | | | | "Missed" implies the frame was dropped, but what really happens is that the following frame will be shown later than intended (due to the current frame skipping a vsync). (As of this commit, this property is still inactive and always returns 0. See git blame for details.)
* player: offset chapter display by start timeGravatar wm42015-10-23
| | | | | | Some mkv files can have this. The chapter times are still timestamps (and thus not affected by the start time), but it misplaces the OSD chapter ticks.
* command: make time properties unavailable if timestamp is unknownGravatar wm42015-10-16
| | | | | | Let's hope this doesn't confuse client API users too much. It's still the best solution to get rid of corner cases where it actually return the wrong timestamp on start, and then suddenly jump.
* player: use OSD formattin for DS on the terminal status lineGravatar wm42015-08-12
|
* player: add display sync modeGravatar wm42015-08-10
| | | | | | | | | | | | | | | | | | | | | | | | If this mode is enabled, the player tries to strictly synchronize video to display refresh. It will adjust playback speed to match the display, so if you play 23.976 fps video on a 24 Hz screen, playback speed is increased by approximately 1/1000. Audio wll be resampled to keep up with playback. This is different from the default sync mode, which will sync video to audio, with the consequence that video might skip or repeat a frame once in a while to make video keep up with audio. This is still unpolished. There are some major problems as well; in particular, mkv VFR files won't work well. The reason is that Matroska is terrible and rounds timestamps to milliseconds. This makes it rather hard to guess the framerate of a section of video that is playing. We could probably fix this by just accepting jittery timestamps (instead of explicitly disabling the sync code in this case), but I'm not ready to accept such a solution yet. Another issue is that we are extremely reliant on OS video and audio APIs working in an expected manner, which of course is not too often the case. Consequently, the new sync mode is a bit fragile.
* player: show larger cache sizes in MB on status lineGravatar wm42015-07-14
|
* video: do not use MP_NOPTS_VALUE for A/V differenceGravatar wm42015-05-24
| | | | | | There's no need for this, it just creates more corner cases. Also always reset it on seeks etc..
* Update license headersGravatar Marcin Kurczewski2015-04-13
| | | | Signed-off-by: wm4 <wm4@nowhere>
* command: improve A-B loop behaviorGravatar wm42014-11-18
| | | | | | If the B point is set, then loop back to A. Also, update the OSD bar if necessary.
* command: implement A-B loopsGravatar wm42014-11-18
| | | | | | | | | | | | | Probably needs to be polished a bit more. Also, might require a key binding that can set/clear the loop points in a more intuitive way. For now, something like this can be put into input.conf to use it: ctrl+y set ab-loop-a ${time-pos} # set A ctrl+x set ab-loop-b ${time-pos} # set B ctrl+c set ab-loop-a no # clear (mostly) Fixes #1241.
* player: make the osd-msg prefix work for playlist_next/prevGravatar wm42014-11-11
| | | | | If input.conf e.g. contains "n osd-msg playlist_next", then pressing the n key will switch to the next file, and display the filename on OSD.
* osd: properly wakeup when the OSD function disappearsGravatar wm42014-11-01
| | | | Fixes #1236.
* player: update meaning of drop_frame_cntGravatar wm42014-11-01
| | | | | Rename the variable, update comments, and update the documentation of the property which returns its value.
* player: change framedrop display in the status lineGravatar wm42014-10-31
| | | | | Hopefully less confusing, and hopefully doesn't exceed the terminal width in any situation.
* player: don't display zero duration for files with unknown durationGravatar wm42014-10-29
| | | | | | On OSD/terminal, just don't display the duration if unavailable. Make the "length" property unavailable if duration is unavailable.
* player: show busy symbol on OSD if seeking takes too longGravatar wm42014-10-22
| | | | Same as it's done on the terminal.
* player: fix OSD cyclingGravatar wm42014-10-14
| | | | | | | OSD cycling attempted to remove the current message by setting an empty message with duration 0. Duration 0 tripped up a corner case causing no OSD to be displayed (until the next message was set), so exclude this explicitly.
* osd: don't let slow commands cut OSD messages shortGravatar wm42014-10-06
| | | | Done for screenshot commands, requested by a user.
* player: remove central uninit_player() function and flags messGravatar wm42014-10-03
| | | | | | | | | | | | | | Each subsystem (or similar thing) had an INITIALIZED_ flag assigned. The main use of this was that you could pass a bitmask of these flags to uninit_player(). Except in some situations where you wanted to uninitialize nearly everything, this wasn't really useful. Moreover, it was quite annoying that subsystems had most of the code in a specific file, but the uninit code in loadfile.c (because that's where uninit_player() was implemented). Simplify all this. Remove the flags; e.g. instead of testing for the INITIALIZED_AO flag, test whether mpctx->ao is set. Move uninit code to separate functions, e.g. uninit_audio_out().
* build: add -Wno-format-zero-lengthGravatar wm42014-09-26
| | | | | | This warning makes absolutely no sense. Passing an empty string to printf-like functions is perfectly fine. In the OSD case, it just sets an empty message, practically clearing the OSD.
* player: do not wrongly clear OSD bar stops, reindentGravatar wm42014-09-25
| | | | | | | | | | set_osd_bar_chapters() always cleared the OSD bar stops, even if the current bar was not the seek bar. Obviously it should leave the state of the bar alone in this case. Also change the function control flow so that we can drop one indentation level, and do the equivalent change for the other OSD bar functions.
* player: simplify OSD message handling codeGravatar wm42014-09-25
| | | | | | | | | | | Eliminate the remains of the OSD message stack. Another simplification comes from the fact that we do not need to care about time going backwards (we always use a monotonic time source, and wrapping time values are practically impossible). What this code was pretty trivial, and by now unnecessarily roundabout. Merge get_osd_msg() into update_osd_msg(), and add_osd_msg() into set_osd_msg_va().
* player: rate-limit OSD text updateGravatar wm42014-09-25
| | | | | | | | | | | | | | | There's no need to update OSD messages and the terminal status if nobody is going to see it. Since the player doesn't block on video display anymore, this update happens to often and probably burns slightly more CPU than necessary. (OSD redrawing is handled separately, so it's just mostly useless text processing and such.) Change it so that it's updated only on every video frame or all 50ms (whatever comes first). For VO OSD, we could in theory try to lock to the OSD redraw heuristic or the display refresh rate, but that's more complicated and doesn't work for the terminal status.