aboutsummaryrefslogtreecommitdiffhomepage
path: root/player
Commit message (Collapse)AuthorAge
...
* client API: add a first class hook API, and deprecate old APIGravatar wm42018-03-26
| | | | | | | | | | | | | | | As it turns out, there are multiple libmpv users who saw a need to use the hook API. The API is kind of shitty and was never meant to be actually public (it was mostly a hack for the ytdl script). Introduce a proper API and deprecate the old one. The old one will probably continue to work for a few releases, but will be removed eventually. There are some slight changes to the old API, but if a user followed the manual properly, it won't break. Mostly untested. Appears to work with ytdl_hook.
* command: remove an old compatibility hackGravatar wm42018-03-26
| | | | | Was removed 3 releases ago and was spamming warning messages that it'll be dropped, so it's fine to remove it now.
* command: remove duplication of property set error message handlingGravatar wm42018-03-26
| | | | | | | | Move all of this stuff to a common function. This makes the error messages less specific, but I don't think anyone will miss it. The OSD flag handling is annoying, but it's nothing that should be changed with this commit.
* command: move property multiply code to m_property.cGravatar wm42018-03-26
| | | | | | | I think this will help with reducing code duplication (see following commit). The error messages loses the multiplication factor, but the error message will be replaced by a generic one in the following commit anyway.
* command: use mpv_node helpers instead of duplicated codeGravatar wm42018-03-26
| | | | | | They didn't exist yet when this code was added. Completely untested.
* client API: add a new way to pass X11 Display etc. to render APIGravatar wm42018-03-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Hardware decoding things often need access to additional handles from the windowing system, such as the X11 or Wayland display when using vaapi. The opengl-cb had nothing dedicated for this, and used the weird GL_MP_MPGetNativeDisplay GL extension (which was mpv specific and not officially registered with OpenGL). This was awkward, and a pain due to having to emulate GL context behavior (like needing a TLS variable to store context for the pseudo GL extension function). In addition (and not inherently due to this), we could pass only one resource from mpv builtin context backends to hwdecs. It was also all GL specific. Replace this with a newer mechanism. It works for all RA backends, not just GL. the API user can explicitly pass the objects at init time via mpv_render_context_create(). Multiple resources are naturally possible. The API uses MPV_RENDER_PARAM_* defines, but internally we use strings. This is done for 2 reasons: 1. trying to leave libmpv and internal mechanisms decoupled, 2. not having to add public API for some of the internal resource types (especially D3D/GL interop stuff). To remain sane, drop support for obscure half-working opengl-cb things, like the DRM interop (was missing necessary things), the RPI window thing (nobody used it), and obscure D3D interop things (not needed with ANGLE, others were undocumented). In order not to break ABI and the C API, we don't remove the associated structs from opengl_cb.h. The parts which are still needed (in particular DRM interop) needs to be ported to the render API.
* player: don't print error if aborted while loading external filesGravatar wm42018-03-26
|
* stats: print section titles independentlyGravatar Julian2018-03-25
| | | | | | | Previously, section titles (File/Video/Audio) were printed as suffix of a property that was assumed to always exist. However, with e.g. lavi-complex this is not the case, therfore, print them without being dependent on a property.
* stats: improve video/audio detectionGravatar Julian2018-03-25
| | | | | | | | | Switch from audio|video to audio|video-out-params properties as per recommendation in #5670. These properties are tables and include information explicitly queried later, so switch to using these tables and reduce the amount of queried properties. Fixes #5670
* vo: pass through framedrop flag differentlyGravatar wm42018-03-15
| | | | | | | | There is some sort-of awkwardness here, because option access needs to happen in a synchronized manner, and the framedrop flag is not in the VO option struct. Remove the mp_read_option_raw() call and the awkward change notification via VO_EVENT_WIN_STATE from command.c, and pass it through as new vo_frame flag.
* vo: move display-fps internal option value to VO optsGravatar wm42018-03-15
| | | | | | Removes the awkward notification through VO_EVENT_WIN_STATE. Unfortunately, some awkwardness remains in mp_property_display_fps(), because the property has conflicting semantics with the option.
* client API: send MPV_EVENT_SHUTDOWN only onceGravatar wm42018-03-15
| | | | | | | | | | | | Before this change, mpv_wait_event() could inconsistently return multiple MPV_EVENT_SHUTDOWN events to a single mpv_handle, up to the point of spamming the event queue under certain circumstances. Change this and just send it exactly once to each mpv_handle. Some client API users might have weird requirements about destroying their state asynchronously (and not reacting immediately to the SHUTDOWN event). This change will help a bit to make this less weird and surprising.
* all: replace mpv_detach_destroy() with mpv_destroy()Gravatar wm42018-03-15
|
* client API: rename mpv_detach_destroy() to mpv_destroy()Gravatar wm42018-03-15
| | | | | Since this has clearer semantics now, the old name is just clunky and confusing.
* client API: add mpv_create_weak_client()Gravatar wm42018-03-15
|
* client API: cleanup mpv_handle terminationGravatar wm42018-03-15
| | | | | | | | | | | | | | | This changes how mpv_terminate_destroy() and mpv_detach_destroy() behave. The doxygen in client.h tries to point out the differences. The goal is to make this more useful to the API user (making it behave like refcounting). This will be refined in follow up commits. Initialization is unfortunately closely tied to termination, so that changes as well. This also removes earlier hacks that make sure that some parts of FFmpeg initialization are run in the playback thread (instead of the user's thread). This does not matter with standard FFmpeg, and I have no reason to care about this anymore.
* player: move locale check to mp_create()Gravatar wm42018-03-15
| | | | | | The intention is to reduce annoying differences between mpv CLI and libmpv, and there's no reason to have the locale check only in libmpv (although it doesn't help with any real issues either).
* player: shuffle around CLI exit code handlingGravatar wm42018-03-15
| | | | | Remove the weird prepare_exit_cplayer() function, and fold the contents into mpv_main() and mp_initialize().
* scripting: make a function staticGravatar wm42018-03-08
|
* client: remove legacy API that is unused nowGravatar Akemi2018-03-04
| | | | | | this API was introduced in c5e4538 solely for the use with cocoa-cb and was not public. with the port to the new API in 760d471 it is now unused and can safely be removed.
* player: fix strange behavior on edition switchingGravatar wm42018-03-03
| | | | | | | After switching, the playback state was not reset, which could leave it in a strange, pause like state, that could be fixed by e.g. seeking. This seems to be an older regression - it's even in 0.27.
* player: don't free root filter while it's still neededGravatar wm42018-03-03
| | | | | | | | | | | | | | Sometimes, playback needs to be fully uninitialized and reinitialized without "officially" closing and reopening the playlist entry. This happens with PT_RELOAD_FILE, which is triggered by edition switching and also DVD/BD title switching. (Not really sure why it goes through so much pain for such obscure cases. All it gains is not resetting "local" options, and not signaling a reload to the client API. Whatever.) The recent filter change freed filter_root too early without recreating it, so it crashed on edition switching. Fixes #5587.
* player: fix track autoselection of external files yet againGravatar wm42018-03-03
| | | | | | If you used --aufio-file=file.mkv, and file.mkv included a video track marked as default, then the logic in select_default_track() would pick the video track from file.mkv. This is 100% broken, so fix it.
* command: fix whitespaceGravatar wm42018-03-03
|
* video: add option to reduce latency by 1 or 2 framesGravatar wm42018-03-03
| | | | | | | | | | | | | | | | | | | | The playback start logic explicitly waits until the first frame has been displayed. Usually this will introduce a wait of 1 vsync. For normal playback this doesn't matter, but with respect to low latency needs, this only leads to additional data getting queued up in the demuxer or network buffers. Another thing is that the timing logic decodes 1 frame ahead (= 1 frame extra latency) to determine the exact duration of a frame. To be fair, there doesn't really seem to be a hard reason why this is needed. With the current code, enabling the option does lead to A/V desync sometimes (if the demuxer FPS is too inaccurate), and also frame drops at playback start in some situations. But this all seems to be avoidable, if the timing logic were to be rewritten completely, which should probably happen in the future. Thus the new option comes with the warning that it can be removed any time. This is also why the option has "hack" in the name.
* video: don't read ahead a frame in --untimed modeGravatar wm42018-03-03
| | | | | The extra frame is used to compute the exact frame duration. But frame drop is disabvled with --untimed.
* player: set thread name in opener threadGravatar wm42018-03-03
| | | | Somewhat helpful for debugging.
* player: add warning comment about ignoring ABI safetyGravatar wm42018-03-03
| | | | | At least ffmpeg_garbage() uses sizeof(AVFrameSideData), which is not included in the ABI, but there's no ABI-safe alternative either.
* client API: deprecate opengl-cb API and introduce a replacement APIGravatar wm42018-02-28
| | | | | | | | | | | | | | | | | | | | | | | | | The purpose of the new API is to make it useable with other APIs than OpenGL, especially D3D11 and vulkan. In theory it's now possible to support other vo_gpu backends, as well as backends that don't use the vo_gpu code at all. This also aims to get rid of the dumb mpv_get_sub_api() function. The life cycle of the new mpv_render_context is a bit different from mpv_opengl_cb_context, and you explicitly create/destroy the new context, instead of calling init/uninit on an object returned by mpv_get_sub_api(). In other to make the render API generic, it's annoyingly EGL style, and requires you to pass in API-specific objects to generic functions. This is to avoid explicit objects like the internal ra API has, because that sounds more complicated and annoying for an API that's supposed to never change. The opengl_cb API will continue to exist for a bit longer, but internally there are already a few tradeoffs, like reduced thread-safety. Mostly untested. Seems to work fine with mpc-qt.
* audio: improve behavior if filters output nothing during probingGravatar wm42018-02-21
| | | | | | | | | | Just bail out immediately (and disable audio) if format probing has no result, instead of doing nothing and then apparently freezing. This can happen with bogus filters, cases where the first audio frame is essentially dropped by filters (can happen with large resampling factors), and if the audio track contains no packets at all, or all packets fail to decode.
* video: do not buffer extra frames with VO_CAP_NORETAIN outputsGravatar Aman Gupta2018-02-17
| | | | | | | | | | | | | | This fixes playback stalls on some mediacodec hardware decoders, which expect that frame buffers will be rendered and returned back to the decoder as soon as possible. Specifically, the issue was observed on an NVidia SHIELD Android TV, only when playing an H264 sample which switched between interlaced and non-interlaced frames. On an interlacing change, the decoder expects all outstanding frames would be returned to it before it would emit any new frames. Since a single extra frame always remained buffered by mpv, playback would stall. After this commit, no extra frames are buffered by mpv when using vo_mediacodec_embed.
* command: simplify mp_property_filter_metadataGravatar wm42018-02-16
| | | | Also silence a dead code coverity error.
* lua+js: Implement utils.getpid()Gravatar sfan52018-02-13
| | | | | | | Usable for uniquely identifying mpv instances from subprocesses, controlling mpv with AppleScript, ... Adds a new mp_getpid() wrapper for cross-platform reasons.
* input: add a keybinding to toggle hardware decodingGravatar wm42018-02-13
| | | | | We sure as hell won't enable hardware decoding by default, but we can make it more accessible with a key binding.
* audio: move back PTS jump detection to before filter chainGravatar wm42018-02-13
| | | | | | | | | | | The recent changes to player/audio.c moved PTS jump detection to after audio filtering. This was mostly done for convenience, because dataflow between decoder and filters was made "automatic", and jump detection would have to be done as filter. Now move it back to after decoders, again out of convenience. The future direction is to make the dataflow between filters and AO automatic, so this is a bit in the way. Another reason is that speed changes tend to cause jumps - these are legitimate, but get annoying quickly.
* cocoa-cb: initial implementation via opengl-cb APIGravatar Akemi2018-02-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | this is meant to replace the old and not properly working vo_gpu/opengl cocoa backend in the future. the problems are various shortcomings of Apple's opengl implementation and buggy behaviour in certain circumstances that couldn't be properly worked around. there are also certain regressions on newer macOS versions from 10.11 onwards. - awful opengl performance with a none layer backed context - huge amount of dropped frames with an early context flush - flickering of system elements like the dock or volume indicator - double buffering not properly working with a none layer backed context - bad performance in fullscreen because of system optimisations all the problems were caused by using a normal opengl context, that seems somewhat abandoned by apple, and are fixed by using a layer backed opengl context instead. problems that couldn't be fixed could be properly worked around. this has all features our old backend has sans the wid embedding, the possibility to disable the automatic GPU switching and taking screenshots of the window content. the first was deemed unnecessary by me for now, since i just use the libmpv API that others can use anyway. second is technically not possible atm because we have to pre-allocate our opengl context at a time the config isn't read yet, so we can't get the needed property. third one is a bit tricky because of deadlocking and it needed to be in sync, hopefully i can work around that in the future. this also has at least one additional feature or eye-candy. a properly working fullscreen animation with the native fs. also since this is a direct port of the old backend of the parts that could be used, though with adaptions and improvements, this looks a lot cleaner and easier to understand. some credit goes to @pigoz for the initial swift build support which i could improve upon. Fixes: #5478, #5393, #5152, #5151, #4615, #4476, #3978, #3746, #3739, #2392, #2217
* ytdl_hook: add ytdl:// prefix again for non-youtube playlistsGravatar Ricardo Constantino2018-02-11
| | | | | | | | Only youtube playlists return ID-only urls. Other extractors may return "<extractor>:<ID>" so those still need the ytdl:// prefix. Reproduced with http://www.cbc.ca/burdenoftruth/videos/trailers-promos/burden-of-truth-returns
* ytdl_hook: add script opt for using manifest URLsGravatar Ricardo Constantino2018-02-11
| | | | | | | | | | | Disable by default. This feature was added in 7eb342757, which allowed stream selection in runtime. Problem with this atm is that FFmpeg will try to demux every first packet of every track leading to noticeable delay opening the URL. This option can be changed to enabled by default or removed when HLS/DASH demuxers are improved upstream.
* ytdl_hook: parse youtube playlist urls to set start indexGravatar Ricardo Constantino2018-02-11
| | | | | | | | | | | | | | Still needs `--ytdl-raw-option=yes-playlist=` because this only works for youtube. This was requested in a few issues: https://github.com/mpv-player/mpv/issues/1400 https://github.com/mpv-player/mpv/issues/2592 https://github.com/mpv-player/mpv/issues/3024 For #1400 to be completely implemented would need ytdl_hook to re-request the same playlist with the last video's ID for the mix to continue indefinitely which would probably too hackish to work reliably.
* ytdl_hook: exit early, save an indentation levelGravatar Ricardo Constantino2018-02-11
|
* ytdl_hook: various nitGravatar Ricardo Constantino2018-02-11
| | | | | | | | Remove obsolete comment about FFmpeg ignoring non-http proxies which was repeated in ytdl_hook before the feature was added. Remove unnecessary conditions for not nil. Lua tables will always return nil for non-existent keys.
* ytdl_hook: whitelist subtitle URLs as wellGravatar Ricardo Constantino2018-02-11
| | | | | This was overlooked when doing the whitelisting for video and audio to fix #5456.
* ytdl_hook: use fallback if there's no demuxer-lavf-list propGravatar Ricardo Constantino2018-02-11
| | | | | | | This is important if backporting by grabbing the latest version of the script without backporting the commit that added the property: 828bd2963cd10a851e0a977809687aed4d377dc3
* vo_gpu: make screenshots use the GL rendererGravatar wm42018-02-11
| | | | | | | | | | | | | | | | | | | | | | | | | | Using the GL renderer for color conversion will make sure screenshots will use the same conversion as normal video rendering. It can do this for all types of screenshots. The logic when to write 16 bit PNGs changes. To approximate the old behavior, we decide by looking whether the source video format has more than 8 bits per component. We apply this logic even for window screenshots. Also, 16 bit PNGs now always include an unused alpha channel. The reason is that FFmpeg has RGB48 and RGBA64 formats, but no RGB064. RGB48 is 3 bytes and usually not supported by GPUs for rendering, so we have to use RGBA64, which forces an alpha channel. Will break for users who use --target-trc and similar options. I considered creating a new gl_video context, but it could double GPU memory use, so I didn't. This uses FBOs instead of glGetTexImage(), because that increases the chance it could work on GLES (e.g. ANGLE). Untested. No support for the Vulkan and D3D11 backends yet. Fixes #5498. Also fixes #5240, because the code for reading back is not used with the new code path.
* player: correctly set track information on adding external filesGravatar Zehua Chen2018-02-10
| | | | | | | | Before this commit, auto_loaded and lang were only set for the first track in auto-loaded external files. Likewise, for the title and lang arguments to the sub-add and audio-add commands. Fixes #5432
* loadfile: make --lavfi-complex runtime changes more flexibleGravatar wm42018-02-03
| | | | | | | | | Setting lavfi-complex at runtime will now forcefully reselect the tracks as needed, even if it was a "proper" track selection via --aid or --vid. Before this commit, it just failed and complained that the VO/AO was already "used". Requested.
* loadfile: initialize decoders after outputs for --lavfi-complexGravatar wm42018-02-03
| | | | | | | This makes it actually somewhat simpler, and doesn't have any disadvantages. It should also make some new features easier. Mostly just moves code around.
* loadfile: fix crash in some cases of setting --lavfi-complex at runtimeGravatar wm42018-02-03
| | | | | | | | | The somewhat confusing thing is that many filters (including track->dec) have a public struct, but to free them, you need to free the mp_filter pointer itself (track->dec->f). The assignment wrote to a dangling pointer, instead of removing the dangling pointer. (Other than that, this idiom is actually nice.)
* loadfile: remove minor unneeded things from --lavfi-complex setupGravatar wm42018-02-03
|
* video: fix passing down FPS to vf_vapoursynthGravatar wm42018-02-03
| | | | | | | To make this less of a mess, remove one of the redundant container_fps fields. Part of #5470.