summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* video: rewrite filtering glue codewm42018-01-3056-2864/+5887
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Get rid of the old vf.c code. Replace it with a generic filtering framework, which can potentially handle more than just --vf. At least reimplementing --af with this code is planned. This changes some --vf semantics (including runtime behavior and the "vf" command). The most important ones are listed in interface-changes. vf_convert.c is renamed to f_swscale.c. It is now an internal filter that can not be inserted by the user manually. f_lavfi.c is a refactor of player/lavfi.c. The latter will be removed once --lavfi-complex is reimplemented on top of f_lavfi.c. (which is conceptually easy, but a big mess due to the data flow changes). The existing filters are all changed heavily. The data flow of the new filter framework is different. Especially EOF handling changes - EOF is now a "frame" rather than a state, and must be passed through exactly once. Another major thing is that all filters must support dynamic format changes. The filter reconfig() function goes away. (This sounds complex, but since all filters need to handle EOF draining anyway, they can use the same code, and it removes the mess with reconfig() having to predict the output format, which completely breaks with libavfilter anyway.) In addition, there is no automatic format negotiation or conversion. libavfilter's primitive and insufficient API simply doesn't allow us to do this in a reasonable way. Instead, filters can use f_autoconvert as sub-filter, and tell it which formats they support. This filter will in turn add actual conversion filters, such as f_swscale, to perform necessary format changes. vf_vapoursynth.c uses the same basic principle of operation as before, but with worryingly different details in data flow. Still appears to work. The hardware deint filters (vf_vavpp.c, vf_d3d11vpp.c, vf_vdpaupp.c) are heavily changed. Fortunately, they all used refqueue.c, which is for sharing the data flow logic (especially for managing future/past surfaces and such). It turns out it can be used to factor out most of the data flow. Some of these filters accepted software input. Instead of having ad-hoc upload code in each filter, surface upload is now delegated to f_autoconvert, which can use f_hwupload to perform this. Exporting VO capabilities is still a big mess (mp_stream_info stuff). The D3D11 code drops the redundant image formats, and all code uses the hw_subfmt (sw_format in FFmpeg) instead. Although that too seems to be a big mess for now. f_async_queue is unused.
* vo_gpu: check for RA_CAP_FRAGCOORD in dumb mode tooJames Ross-Gowan2018-01-301-13/+14
| | | | | | | The RA_CAP_FRAGCOORD checks apply to dumb mode as well, but they were after the check for dumb mode, which returns early, so they never ran. Fixes #5436
* ytdl_hook: pre-append id-only playlist items with shortened youtube URLRicardo Constantino2018-01-291-1/+1
|
* ytdl_hook: whitelist segmented DASH and HLS for the manifests codeRicardo Constantino2018-01-271-7/+9
| | | | Close #5453
* video: fix crash with vdpau when reinitializing renderingwm42018-01-271-3/+3
| | | | | | | | | | Using vdpau will allocate additional textures for the reinterleaving step, which uninit_rendering() will free. This is a problem because the hwdec image remains mapped when reinitializing, so the reinterleaving textures are turned into dangling pointers. Fix this by freeing the reinterleave textures on full uninit instead. Fixes #5447.
* demux_lavf: work around another aspect of libavformat garbage APIwm42018-01-261-1/+6
| | | | | | | | | | | | | | | | AV_DISPOSITION_ATTACHED_PIC usually means the video track isn't real, and merely reflects the presence of an embedded image in tag data (such as ID3v2 tags), with some inconsistent hack to make libavformat return it as video packet once. Except it doesn't mean that. It can be randomly set on other streams that do sort of behave like video streams, such as chapter thumbnail tracks in mp4 files. AV_DISPOSITION_TIMED_THUMBNAILS is set in these cases. In theory, there can supposedly be more such cases, but only the chapter thumbnail one currently exists. So add it as exception. This restores displaying these thumbnails as video frames, for better or worse. (Before, only the first thumbnail was displayed.)
* demux_lavf: export correct seekability state for HLS live streamswm42018-01-261-0/+5
| | | | | | | Requires newest FFmpeg git, which has a change that makes the HLS demuxer set an AVFMTCTX_UNSEEKABLE flag if seeking is not available, which is the case for HLS live streams. This should make the player frontend behave pretty well, instead of crapping up irrecoverably.
* command: add --osd-on-seek option defaulting to barKevin Mitchell2018-01-265-11/+30
| | | | | | | | | | | | | Restores behaviour prior to aef2ed5dc13e37dec0670c451b4369b151d5c65f. That change was apparently unpopular. However, given the amount of complaining over how hard it is to change the defaults by rebinding every key, I think the extra option introduced by this commit is justified. Technically not all behaviour is restored, because now --no-osd-bar will not instead display the msg text on seek. I think that feature was a little weird and is now easy enough to remedy with the --osd-on-seek option.
* Revert "command: make pause display the same osd-msg-bar as seek"Kevin Mitchell2018-01-262-6/+4
| | | | | | | | | | | | | | This reverts commit 9812e276aa1bb0bddeb73677aa9e9f87e73cd930. This was apparently unpopular. I still think the pause OSD should be the same as seek even if it's not visible by default, but it seems that whether to display a given property change is currently conflated with what to display. The reverted behaviour can be restored by adding something like the following to input.conf: SPACE cycle pause; show_progress
* ytdl_hook: prefer hls/dash manifest if availableRicardo Constantino2018-01-261-6/+10
| | | | | | | This makes all the video/audio variants available for selection. Might break with non-hls/dash, or even with dash if FFmpeg wasn't compiled with the demuxer.
* ytdl_hook: fix safe url checking with EDL urlsRicardo Constantino2018-01-261-11/+11
|
* ytdl_hook: move url_is_safe earlier in codeRicardo Constantino2018-01-261-9/+9
| | | | lua isn't javascript.
* hwdec: detach d3d and d3d9 hwaccel from anglemyfreeer2018-01-253-9/+10
| | | | Fix https://github.com/mpv-player/mpv/issues/5420
* stream_lavf: remove deprecated hls protocol from whitelistwm42018-01-251-1/+1
| | | | | | The use of the FFmpeg hls protocol (as opposed to demuxer) is "discouraged", and probably only causes additional potential security problems at best, so drop it.
* manpage: mention --network-timeout is broken with RTSPwm42018-01-251-0/+10
| | | | | | Not much we can do, too hard to work around. Fixes #3361.
* options: add string list -toggle actionwm42018-01-252-0/+25
|
* m_option: remove string list -append action code duplicationwm42018-01-251-15/+6
| | | | | | | | Instead of duplicating the append code, reimplement it using the existing code. The difference between -add and -append is that -append does not take multiple items (thus removing the need for escaping), but -append can reuse all code for -add by pretending the separator is never found.
* command: make change-list show changed option on OSDwm42018-01-251-0/+1
|
* command: add a change-list commandwm42018-01-255-0/+53
| | | | | | | | | | | | | Requested. See manpage additions. The main reason why this goes through the trouble to keep the action/operation parameter separate is so that we don't expose some option parser implementation details to the command (although that is a relatively weak reason), and also to make it more different from the "set" command, which can't support this type of option as it goes through the property layer. Fixes #5435.
* client API: be more explicit about what can be done in wakeup callbackswm42018-01-252-6/+15
| | | | Don't leave any room for interpretation.
* options: add an option type for byte sizeswm42018-01-255-25/+108
| | | | | | And use it for 2 demuxer options. It could be used for more options later. (Though the --cache options can not use this, because they use KB as base unit.)
* m_option: add missing print callbackswm42018-01-251-5/+35
| | | | | | | | | | | Add the print callback to all option types (except pseudo option types which don't represent values). This makes it less confusing for client API users (no strange properties that can't be read), and also lists the default properly with --list-options. Fix the option type for audio formats - they use int, not uint32_t. Fix some identation cosmetic issues.
* ao_alsa: reduce verbosity at -vwm42018-01-251-10/+10
| | | | | | | Always make the hw params dump function use MSGL_DEBUG, and remove the MSGL_V use. That means you need -v -v to see them. The detailed information is usually not very interesting, so this reduces the log noise.
* audio: fix annyoing af_get_best_sample_formats() definitionwm42018-01-258-9/+10
| | | | | | | | | | | | | | | | The af_get_best_sample_formats() function had an argument of int[AF_FORMAT_COUNT], which is slightly incorrect, because it's 0 terminated and should in theory have AF_FORMAT_COUNT+1 entries. It won't actually write this many formats (since some formats are fundamentally incompatible), but it still feels annoying and incorrect. So fix it, and require that callers pass an AF_FORMAT_COUNT+1 array. Note that the array size has no meaning in C function arguments (just another issue with C static arrays being weird and stupid), so get rid of it completely. Not changing the af_lavcac3enc use, since that is rewritten in another branch anyway.
* command: make sure to redraw on overlay commandswm42018-01-251-0/+1
| | | | | | | | | | When overlay-add etc. is run, make sure the playlop is rerun so that it considers actually redrawing the screen. (I considered making the OSD code generally wakeup the player, but that will probably lead to redundant wakeups, so I didn't bother.) Fixes #5431.
* video: minor simplificationwm42018-01-251-1/+1
| | | | | The check is redundant - if removed, it will write the same value, so it's a NOP.
* ytdl_hook: whitelist protocols from urls retrieved from youtube-dlRicardo Constantino2018-01-261-7/+47
| | | | | | Not very clean since there's a lot of potential unsafe urls that youtube-dl can give us, depending on whether it's a single url, split tracks, playlists, segmented dash, etc.
* manpage: remove obsolete information on bd://Ricardo Constantino2018-01-251-4/+3
| | | | ISO files have been supported by bd:// for a while.
* sub/osd: remove limits from border and shadow size optionsRicardo Constantino2018-01-241-2/+2
|
* manpage: document using sub-shadow-offset for background sizingRicardo Constantino2018-01-241-1/+2
|
* stream_bluray: always show list of available titlesRicardo Constantino2018-01-232-4/+4
|
* stream_bluray: silence libbluray's debug messages unless we want themRicardo Constantino2018-01-231-0/+4
| | | | libbluray's way too verbose on default loglevel with non-breaking issues.
* video: warn user against FFmpeg's lieswm42018-01-222-9/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I found that at least for mjpeg streams, FFmpeg will set packet pts/dts anyway. The mjpeg raw video demuxer (along with some other raw formats) has a "framerate" demuxer option which defaults to 25, so all mjpeg streams will be played at 25 FPS by default. mpv doesn't like this much. If AVFMT_NOTIMESTAMPS is set, it prints a warning, that might print a bogus FPS value for the assumed framerate. The code was originally written with the assumption that FFmpeg would not set pts/dts for such formats, but since it does, the printed estimated framerate will never be used. --fps will also not be used by default in this situation. To make this hopefully less confusing, explicitly state the situation when the AVFMT_NOTIMESTAMPS flag is set, and give instructions how to work it around. Also, remove the warning in dec_video.c. We don't know what FPS it's going to assume anyway. If there are really no timestamps in the stream, it will trigger our normal missing pts workaround. Add the assumed FPS there. In theory, we could just clear packet timestamps if AVFMT_NOTIMESTAMPS is set, and make up our own timestamps. That is non-trivial for advanced video codecs like h264, so I'm not going there. For seeking and buffering estimation the situation thus remains half-broken. This is a mitigation for #5419.
* m_option: add print callback to color typeOlivier Perret2018-01-221-0/+7
| | | | This lets scripts query the value of 'background' and similar properties
* mpv.desktop: update mime type listsfan52018-01-221-1/+1
| | | | see https://wiki.debian.org/DebianMultimedia/PlayerSupport
* osx: add some more menu bar items as suggested by Apples's HIGAkemi2018-01-201-0/+35
| | | | | | | | | | | | this adds the standard menu bar items Services, Hide Others, Show All and Close, as suggested by Apple's HIG. https://developer.apple.com/macos/human-interface-guidelines/menus/menu-bar-menus/#app-menu - Services are useful to add custom actions and shortcuts via the System Preferences to mpv - Close is important since the menu bar can open secondary windows, like About or the Open dialogue. those couldn't be closed with the standard system shortcut before. this is now possible.
* video: change some remaining vo_opengl mentions to vo_gpuAkemi2018-01-209-11/+11
|
* osx: code cleanups and cosmetic fixesAkemi2018-01-207-18/+4
|
* osx: fix macOS 10.13 deprecation warningAkemi2018-01-202-1/+7
| | | | | | | | NSFileHandlingPanelOKButton is deprecated with macOS 10.13, but the replacement NSModalResponseOK is not available on 10.8 and earlier. added a declaration for 10.8 and earlier since i only officially dropped support for 10.7 and earlier. this is untested.
* cmd_parse: minor cosmeticswm42018-01-181-5/+2
|
* ta: introduce talloc_dup() and use it in some placeswm42018-01-186-12/+12
| | | | | | | It was actually already implemented as ta_dup_ptrtype(), but that seems like a clunky name. Also we still use the talloc_ names throughout the source, and I'd rather use an old name instead of a mixing inconsistent naming conventions.
* demux: reword an outdated commentwm42018-01-181-2/+1
|
* player: redo hack for video keyframe seeks with external audiowm42018-01-186-35/+78
| | | | | | | | | | | | | | | | | | | | | | | | If you play a video with an external audio track, and do backwards keyframe seeks, then audio can be missing. This is because a backwards seek can end up way before the seek target (this is just how this seek mode works). The audio file will be seeked at the correct seek target (since audio usually has a much higher seek granularity), which results in silence being played until the video reaches the originally intended seek target. There was a hack in audio.c to deal with this. Replace it with a different hack. The new hack probably works about as well as the old hack, except it doesn't add weird crap to the audio resync path (which is some of the worst code here, so this is some nice preparation for rewriting it). As a more practical advantage, it doesn't discard the audio demuxer packet cache. The old code did, which probably ruined seeking in youtube DASH streams. A non-hacky solution would be handling external files in the demuxer layer. Then chaining the seeks would be pretty easy. But we're pretty far from that, because it would either require intrusive changes to the demuxer layer, or wouldn't be flexible enough to load/unload external files at runtime. Maybe later.
* sws_utils: don't force callers to provide option structwm42018-01-186-7/+12
| | | | | | | mp_sws_set_from_cmdline() has the only purpose to respect the --sws- command line options. Instead of forcing callers to get the option struct containing these, let callers pass mpv_global, and get it from the option core code directly. This avoids minor annoyances later on.
* vo: log reconfig callswm42018-01-181-0/+2
| | | | Helpful for debugging, sometimes.
* mp_image_pool: add helper functions for FFmpeg hw frames poolswm42018-01-182-0/+81
| | | | | | | FFmpeg has its own rather "special" image pools (AVHWFramesContext) specifically for hardware decoding. So it's not really practical to use our own pool implementation. Add these helpers, which make it easier to use FFmpeg's code in mpv.
* mp_image: fix some metadata loss with conversion from/to AVFramewm42018-01-181-2/+14
| | | | | | | | | | | | | This fixes that AVFrames passing through libavfilter (such as with --lavfi-complex) implicitly stripped some fields. I'm not actually sure what to do with the mp_image_params.color.light field here (what happens if the colorspace changed?) - there is no equivalent in AVFrame or FFmpeg at all. It did not affect the old --vf code, because it doesn't allow libavfilter to change the metadata. Also log the .light field in verbose mode.
* video: make IMGFMT_IS_HWACCEL() return 0 or 1wm42018-01-181-1/+1
| | | | Sometimes helps avoiding usage mistakes.
* video: add utility function to pick conversion image format from a listwm42018-01-182-0/+10
|
* video: avoid some unnecessary vf.h includeswm42018-01-184-5/+0
|
* options: simplify mp_get_config_group() memory managementwm42018-01-182-4/+4
| | | | | | | | | | | | | | | | There is some craziness here: the function allocates m_config_cache, which in turn allocates the actual option struct, which is what the function returns. The user would expect to be able to use talloc_free() to deallocate everything. Of course this didn't work, because the returned pointer is not the root parent in the talloc tree. But with some additional talloc craziness, this can be fixed. We rearrange the parent pointers such that freeing the option struct will free m_config_cache first, which uninits the contents in the option struct, but fortunately not the option struct itself. This change should simplify API use on the caller side, and reduce surprises.
* options: don't warn when reading deprecated option as raw valuewm42018-01-181-1/+1
| | | | | | mp_read_option_raw() should not print the deprecation warning if the option is deprecated. This change also means you can't pass an alias to the function, but all existing uses should be fine.
* manpage: reword some vf command exampleswm42018-01-181-7/+8
| | | | Hopefully this is easier to read.
* Fix undefined preprocessor behaviorwm42018-01-183-4/+15
| | | | | | | | | | | This commit eliminates the following clang warning: warning: macro expansion producing 'defined' has undefined behavior [-Wexpansion-to-defined] Going by the clang commit message, this seems to be explicitly specified as UB by the standard, and they added this warning because MSVC apparently results in different behavior. Whatever, we can just avoid the warning with some small changes.
* client API: mention that SIGPIPE is sometimes blockedwm42018-01-181-0/+2
| | | | | | ipc-unix.c does this out of convenience. Since signals are global process state, this deserves a mention, since applications could in theory rely on SIGPIPE being set to something else.
* vo_gpu: skip DR for unsupported image formatswm42018-01-181-0/+3
| | | | | | | | | | | | | | DR (direct rendering) works by having the decoder decode into the GPU staging buffers, instead of copying the video data on texture upload. We did this even for formats unsupported by the GPU or the renderer. This "worked" because the staging memory is untyped, and the video frame was converted by libswscale to a supported format, and then uploaded with a copy using the normal non-DR texture upload path. Even though it "works", we don't gain anything from using the staging buffers for decoding, since we can't use them for upload anyway. Also, staging memory might be potentially limited (what really happens is up to the driver). It's easy to avoid, so just skip it in these cases.
* vo_gpu: fix broken 10 bit via integer textures playbackwm42018-01-171-3/+3
| | | | | | | | | | | The check_gl_features(p) call here checks whether dumb mode can be used. It uses the field use_integer_conversion, which is set _after_ the call in the same function. Move check_gl_features() to the end of the function, when use_integer_conversion is finally set. Fixes that it tried to use bilinear filtering with integer textures. The bug disabled the code that is supposed to convert it to non-integer textures.
* vo_gpu: rpi: defer gl_ctx_resize until after gl_ctx_initNiklas Haas2018-01-151-1/+3
| | | | | | | | This segfaults otherwise. The conditional is needed to break a circular dependency (gl_init depends on mpgl_load_functions which depends on recreate_dispmanx which calls gl_ctx_resize). Fixes #5398
* af_rubberband: add af-command to multiply current pitchVobe2018-01-152-6/+22
| | | | | | | | | | | | | This commit introduces the multiply-pitch af-command. Users may bind keys to this command in order to incrementally adjust the pitch of a track. This will probably mostly be useful for musicians trying to transpose up and down by semi tones without having to calculate the correct ratio beforehand. As an example, here is an input.conf to test this feature: { af-command all multiply-pitch 0.9438743126816935 } af-command all multiply-pitch 1.059463094352953
* demux_lavf: add required format hacks for DASHsfan52018-01-151-0/+1
|
* ytdl_hook: support native dash demuxer, if presentRicardo Constantino2018-01-151-1/+44
| | | | | | Uses track tbr instead of track disposition id for dash selection Works just as expected because youtube-dl also takes tbr from