summaryrefslogtreecommitdiffstats
path: root/video
Commit message (Collapse)AuthorAgeFilesLines
* vd_lavc: make software decoding fallback an optionRodger Combs2015-10-251-1/+5
|
* vo_opengl: remove source shader leftoverBin Jin2015-10-242-3/+0
| | | | The source shader was removed after deband was introduced.
* vo_opengl: always cache to an FBO when not interpolatingNiklas Haas2015-10-231-4/+29
| | | | | | This speeds up redraws considerably (improving eg. <60 Hz material on a 60 Hz monitor with display-sync active, or redraws while paused), but slightly slows down the worst case (eg. video FPS = display FPS).
* vo: expose frame->num_vsyncs to the VO backendNiklas Haas2015-10-231-1/+0
| | | | | It's not clear why this was originally hidden, but the information is useful for allowing the VO backend to make decisions about caching.
* w32_common: disable IMEJames Ross-Gowan2015-10-231-9/+16
| | | | | | | | | | The IME is not useful for key-bindings. Handle the base ASCII chars instead and don't show the IME window. For the sake of libmpv users, the IME should only be disabled on mpv's GUI thread and not application- wide. No IME on the GUI thread should also mean that VK_PROCESSKEY will never have to be handled, so the logic for that can be removed as well.
* vo_opengl: wayland: use a more standard symbolwm42015-10-231-1/+2
| | | | | They're the same, but EGL_CONTEXT_MAJOR_VERSION_KHR technically is an extension, while EGL_CONTEXT_CLIENT_VERSION is the standardized alias.
* vo_opengl: vaapi: fix compilation failure on older systemswm42015-10-231-1/+2
| | | | | | | Older systems have certain EGL extension definitions missing. We redefine them to make the build system easier, and because it's trivial. But we forgot to define the EGL_LINUX_DMA_BUF_EXT identifier. (I hope it's the only missing one.)
* vo_opengl_cb: fix passing through some video equalizer propertieswm42015-10-231-2/+7
| | | | | | | | | | | | | | | | | | | | | | The equalizer code as it exists in vo_opengl works perfectly fine. The situation in vo_opengl_cb is pretty different. The playback thread can't communicate with the renderer thread synchronously (essentially to give the API user more flexibility). So the equalizer communication has to be done in an asynchronous way too. There were two problems. First, the eq capabilities can change with the pixel format, and the renderer initializes them on config only. This means equalizers were disabled on the first config run, and options like --video-output-levels or --brightness would not work. So we just initialize the caps with a known superset. The player will not correctly indicate when setting an eq doesn't work, but we're fine with it, as it is a relatively cosmetic issue. Second, it copied back the eq settings in the "wrong" moment (what for?), which overwrote the settings in some cases. Third, the eq was not reset correctly on vo init. This is needed to make it behave the same as vo_opengl.
* vo_opengl: make the default debanding settings less excessiveNiklas Haas2015-10-211-2/+2
| | | | | | | | | It's great that the new algorithm supports multiple placebo iterations and all, but it's really not necessary and hurts performance in the general case for the sake of the 0.1% that actually pause the screen and look for minute differences. Signed-off-by: wm4 <wm4@nowhere>
* Revert "vo_wayland: define opaque region"Ricardo Vieira2015-10-201-9/+0
| | | | | | This reverts commit c10fb4ce9fcd3dbbf69741eb8499c4cfabbf5412. This is already done in vo_wayland.c:resize,324 doing it here makes the window bigger before the video resizes showing a black area while dragging the border.
* vd_lavc: attempt to fallback from hwdec before anything is decodedwm42015-10-191-4/+4
| | | | | | | | | | The previous commit moved the av_frame_unref() after the got_picture check. This accidentally also deferred the software fallback reinitialization to until a software picture was decoded (instead of the exact time of the fallback), which is not ideal. Just rely on the fact that calling av_frame_unref() on a frame is ok even if nothing was decoded.
* vd_lavc: continue decoding properly after decoding failurewm42015-10-191-3/+7
| | | | | | | | | | Commit 12cd48a8 started setting the hwdec_failed field even if hwdec was not active, and because it also checked this field even if hwdec was not active, broke decoding forever. Fix this, and also avoid a memory leak or API misuse by releasing the decoded picture. Passing an unreleased frame to the decoder has as far as I know no defined effects.
* vo_opengl: support all kinds of GBRP formatswm42015-10-183-13/+15
| | | | | | | | Adds support for AV_PIX_FMT_GBRP9, AV_PIX_FMT_GBRP10, AV_PIX_FMT_GBRP12, AV_PIX_FMT_GBRP14, AV_PIX_FMT_GBRP16, AV_PIX_FMT_GBRAP, and AV_PIX_FMT_GBRAP16. (Not that it matters, because nobody uses these anyway.)
* vaapi: drop non-existing FourCCwm42015-10-172-5/+0
| | | | | | | This VA_FOURCC isn't even defined by latest drivers, so I'm just assuming it doesn't exist and never existed. For planar 4:2:0, VA_FOURCC_YV12 is normally preferred, and there's even a VA_FOURCC_IYUV for 4:2:0 with unswapped planes.
* build: bump required libva versionwm42015-10-171-6/+0
| | | | | | | | 0.34 and 0.35 don't have the buffer API, such as vaAcquireBufferHandle. This is only needed for the EGL interop, but why bother staying compatible for such old things (0.36 was released over a year ago). We also can drop some minor compatibility ifdeffery.
* vo_opengl_cb: fix pausing and seeking if interpolation is enabledwm42015-10-141-1/+20
| | | | | | | | | | | | | | | When seeking, the current frame will have the wrong timestamp, until the seek is done and a new frame from the seek target is shown. We still use the "old" frame for redrawing during seeks. This frame has to be explicitly marked with still=true in order not to confuse the interpolation queue. If this is not done, it will ignore frames until a frame with approximately the same timestamp as the "old" frame is reached. (Does this mean interpolation handles timestamp resets incorrectly? I have no idea.) Of course we also have to clear possibly queued frames on seeks. Also, in pausing, explicitly let the frame redraw.
* vo_opengl: x11egl: fix confused error status codeswm42015-10-121-2/+2
| | | | This is all kinds of wonderfully stupid.
* vo_opengl: x11egl: reject nvidia drivers when autoprobingwm42015-10-121-0/+6
| | | | | | | | | Newer nVidia drivers support EGL, but they seem to work badly, apparently don't support some needed features or not in a form we want (such as swap control), and vdpau interop is not available. Disable it by default, because I'm tired of explaining this issue. Can be reverted as soon as nVidia release working drivers.
* vd_lavc: work around libavcodec nonsense causing hwdec init failurewm42015-10-121-0/+3
| | | | | | | | | | | | | | | | The libavcodec h264 decoder contains some idiotic code with unknown purpose (no sample or explanation known that necessitates its existence), that causes the AVCodecContext.get_format callback to be invoked at a time when hwaccels can't be initialized. By definition, the get_format callback is supposed to initialize hwaccels (another idiotic thing now part of the API, but different story). This causes hwdec initialization sometimes to fail (WolfensteinTwitch.mp4): the first get_format callback will mark it as failed, so the second get_format (the "proper" normal one) will not bother restoring the state, and hwdec init fails. While this should be fixed in libavcodec (good luck with that), it's quite easy to workaround.
* vd_lavc: refuse to initialize vaapi with unknown profileswm42015-10-111-3/+1
| | | | | | Bad idea, although I'm not sure how harmful it actually was. Although this is common code, only the vaapi hwaccel still uses it.
* cocoa: set application policy before creating windowwm42015-10-111-5/+4
| | | | | | | | | | | | This fixes a regression since commit f4d62da8. The original code run vo_cocoa_config_window() once without creating the window, which had the effect that the last part of the function was run at least once before the actual window was created. Fix the regression by moving it to before the window is created. The regression itself is hard to describe. One test case: start mpv from a fullscreened terminal window. It should switch to another desktop, with the mpv window visible. This didn't happen anymore.
* vo: log deviation from ideal vsync intervalwm42015-10-081-0/+5
|
* vo_xv: fix crash with --widwm42015-10-071-1/+1
| | | | | | Fixes #2386. Reminder that you should not use this crap-VO.
* video: fix base for --no-correct-ptswm42015-10-062-9/+10
| | | | | | | | | | Use the first encountered packet PTS/DTS as base, instead of the last one. This does not add the amount of frames buffered in the codec to the PTS offset, and thus is better. Also, don't add the frame time if there was no decoded frame yet. The first frame should obviously have the timestamp of the first packet (going by this heuristic).
* video: increase maximum number of buffered AVI pts sampleswm42015-10-061-1/+1
| | | | | | | While b-frame reordering limits the maximum required number to around 16, the number of additionally buffered frames can be much higher. Guess when this actually matters? (For the libavcodec MMAL wrapper.)
* video: don't sort AVI pts sampleswm42015-10-061-14/+10
| | | | | It's obviously not needed, and only an artifact of the old PTS determination code.
* video: remove user-controllable PTS sorting (--pts-association-mode)wm42015-10-062-57/+5
| | | | | | | | | Useless. Sometimes it might be useful to make some extremely broken files work, but on the other hand --no-correct-pts is sufficient for these cases. While we still need some of the code for AVI, the "auto" mode in particular inflated the size of the code.
* video: disable framedrop if avi-style timestamps are usedwm42015-10-061-0/+3
| | | | | | | | | | | | This can't be handled correctly at all. Other cases when the decoder might drop a frame (such as completely failing to decode a frame) will shift timestamps by a frame, and it can't be avoided. While we could maybe find a better way to handle this with libavcodec's main decoders, this seems to be much harder if it should work with certain HW decoders, which don't passthrough the DTS field (such as MMAL). Another problem are .avi files with b-frames. So just leave it as it is.
* video: remove codec delay estimationwm42015-10-033-15/+2
| | | | | | | | | | This was used only by the timestamp sorting code, which is a fallback for avi files (as well as avi-muxed mkv files). This was supposed to prevent accumulating timestamps in case the decoder consumes more packets than it outputs frames (i.e. frames are dropped). This didn't work very well (timestamps could be off by a large amount), the estimation of the delay was fragile, and the interdependencies with the decoder were annoying, so kill it.
* video: cosmetics: remove trailing whitespacewm42015-10-031-1/+1
|
* video/out: remove an unused parameterwm42015-10-0325-43/+40
| | | | | | | | | | | This parameter has been unused for years (the last flag was removed in commit d658b115). Get rid of it. This affects the general VO API, as well as the vo_opengl backend API, so it touches a lot of files. The VOFLAGs are still used to control OpenGL context creation, so move them to the OpenGL backend code.
* vo: change some defines to enumswm42015-10-021-9/+13
| | | | Why not.
* vo_opengl: drop old backend APIwm42015-10-023-87/+26
|
* vo_opengl: rpi: switch to new internal APIwm42015-10-023-39/+35
|
* win32: cleanup: remove some unneeded thingswm42015-10-024-17/+10
|
* vo_opengl: w32: switch to new internal APIwm42015-10-024-27/+36
|
* vo_opengl: refactor DwmFlush crapwm42015-10-023-42/+45
| | | | | Get it out of the way in the common code. MPGLContext.dwm_flush_opt can be removed as well as soon as the option system gets overhauled.
* vo_opengl: remove leftover variable from vaglx in vaeglEmmanuel Gil Peyrot2015-10-021-1/+0
| | | | This was preventing compilation on systems without X11 headers.
* vo: fix compilation failure when vaapi is enabled and x11 disabledEmmanuel Gil Peyrot2015-10-021-1/+1
| | | | | This was previously trying to use the video_output_vaapi symbol despite vo_vaapi.c being guarded by the vaapi-x11 option.
* vo_opengl: wayland: switch to new internal APIwm42015-10-016-54/+44
|
* vo_opengl: cocoa: switch to new internal APIwm42015-10-016-31/+37
|
* vo_opengl: make sw suboption work without explicit backend selectionwm42015-10-013-2/+3
| | | | | | | You needed to select a GL backend with the backend suboption. This was confusing. Fixes #2361.
* vo_opengl: debanding requires GLSL 1.30wm42015-10-011-0/+4
| | | | | | We have to disable it, or shader compilation will fail. Fixes #2362.
* x11: separate window creation and configurationwm42015-09-308-36/+56
| | | | | | | | | | | | | | | | | | | This gets rid of an old hack, VOFLAG_HIDDEN. Although handling of it has been sane for a while, it used to cause much pain, and is still unintuitive and weird even today. The main reason for this hack is that OpenGL selects a X11 Visual for you, and you're supposed to use this Visual when creating the X window for the OpenGL context. Which means the X window can't be created early in the common X11 init code, but the OpenGL code needs to do something before that. API-wise you need separate functions for X11 init and X11 window creation. The VOFLAG_HIDDEN hack conflated window creation and the entrypoint for resizing on video resolution change into one function, vo_x11_config_vo_window(). This required all platform backends to handle this flag, even if they didn't need this mechanism. Wayland still uses this for minor reasons (alpha support?), so the wayland backend must be changed before the flag can be entirely removed.
* vo_opengl: cosmetics: coding stylewm42015-09-301-46/+45
|
* vo_opengl: do not reset video queue when changing video equalizerwm42015-09-301-1/+0
| | | | | | | If interpolation is enabled, then this causes heavy artifacts if done while unpaused. It's preferable to allow a latency of a few frames for the change to take full effect instead. If this is done paused, the frame is fully redrawn anyway.
* Revert "vo_x11: remove this video output"wm42015-09-302-0/+452
| | | | | | | | | | | | | | | This reverts commit d11184a256ed709a03fa94a4e3940eed1b76d76f. Unfortunately, there was a lot of unexpected resistance. Do note that this is still extremely slow, crappy, etc. Note that vo_x11.c was further edited. Compared to the removed vo_x11.c, an additional ~200 lines of code was removed in order to simplify it. I tried to strip it down as much as possible. In particular, support for odd non-32 bit formats (24, 16, 15, 8 bit) is dropped. Closes #2300.
* video: replace vf_format outputlevels option with global optionwm42015-09-297-21/+6
| | | | | | | | | | | The vf_format suboption is replaced with --video-output-levels (a global option and property). In particular, the parameter is removed from mp_image_params. The mechanism is moved to the "video equalizer", which also handles common video output customization like brightness and contrast controls. The new code is slightly cleaner, and the top-level option is slightly more user-friendly than as vf_format sub-option.
* Revert "vd_lavc: do not abort hardware decoding on errors"wm42015-09-281-0/+1
| | | | | | | | | | This essentially reverts commit 009dfbe3. FFmpeg VideoToolbox support is being wacky, and can cause major issues, such as not being able to decode a single frame. (E.g. by playing a .ts file. This should be fixed in FFmpeg eventually.) This is not a straight revert of the commit; just a functional one. We keep the slightly simpler code structure.
* vo_opengl: videotoolbox: cleanupswm42015-09-281-43/+26
| | | | Get rid of the VDA specifics like naming or ancient pixel formats.
* vo_opengl: rename hwdec_vda.c to hwdec_osx.cwm42015-09-281-0/+0
| | | | | | | It doesn't deal with VDA at all anymore. Rename it to hwdec_osx.c. Not using hwdec_videotoolbox.c, because that would give it the longest source path in this project yet. (Also, this code isn't even VideoToolox-specific, other than the name of the pixel format used.)
* video: remove VDA supportwm42015-09-289-142/+3
| | | | | | | | | VideoToolbox is preferred. Now that FFmpeg released 2.8, there's no reason to support VDA anymore. In fact, we had a bug that made VDA not useable with older FFmpeg versions in some newer mpv releases. VideoToolbox is supported even on slightly older OSX versions, and if not, you still can run mpv without hw decoding.
* vd_lavc: remove some ancient cargo-cultingwm42015-09-281-1/+0
| | | | | | | | Definitely not needed anymore, and fixes a crash in some weird corner- cases. The extradata freeing is apparently still needed, though. (Because a codec context can be opened again, which makes no sense, but ok.)
* vo_opengl: vaapi: add Wayland supportwm42015-09-272-0/+18
| | | | | | Pretty trivial with the new EGL interop. Fixes #478.
* vo_opengl: refactor EGL context information callbackwm42015-09-273-16/+33
| | | | | Move the ugliness from x11egl.c to common.c, so that the ugliness doesn't have to be duplicated in wayland.c.
* vaapi: remove dependency on X11wm42015-09-275-21/+84
| | | | | | | | | | | | | There are at least 2 ways of using VAAPI without X11 (Wayland, DRM). Remove the X11 requirement from the decoder part and the EGL interop. This will be used by a following commit, which adds Wayland support. The worst about this is the decoder part, which includes a bad hack for using the decoder without any VO interop (also known as "vaapi-copy" mode). Separate the X11 parts so that they're self-contained. For the EGL interop code we do something similar (it's kept slightly simpler, because it essentially only has to translate between our silly MPGetNativeDisplay abstraction and the vaGetDisplay...() call).
* vo_opengl: vaapi: provide symbols for missing extensionswm42015-09-271-0/+14
| | | | | We also could just check at build time, but since it's not much, just redefine them inline if not present.
* vo_opengl: vaapi: redo how EGL extensions are loadedwm42015-09-275-60/+35
| | | | | | | It looks like my hope that we can unconditionally include EGL headers in the OpenGL code is not coming true, because OSX does not support EGL at all. So I prefer loading the VAAPI EGL/GL specific extensions manually, because it's less of a mess. Partially reverts commit d47dff3f.
* vo_opengl: rpi: fix EGL commentwm42015-09-271-4/+2
| | | | | | While EGL 1.4 seemed a bit ambiguous about this to me, it actually says quite clearly that core functions are not supported with eglGetProcAddress() in the following paragraph.
* vo_opengl: probe for EGL by defaultwm42015-09-262-5/+6
| | | | | | | | | | | Normally, we prefer GLX on X11. But for the VAAPI EGL interop, we obviously want EGL. Since nvidia does not provide EGL with desktop GL yet, we can leave it to the autoprobing. Just make sure some failure messages don't unnecessarily show up in the nvidia case. This breaks VAAPI GLX interop by default, but I don't care much. If you use --hwdec=auto (which you should if you want hw decoding), this should fallback to vaapi-copy instead.
* vo_opengl: x11egl: cleanup uninit pathwm42015-09-261-30/+26
| | | | Get rid of the config_window_x11_egl() indirection.
* vo_opengl: vaapi: probe the surface formatwm42015-09-261-2/+68
| | | | | | | | | | | | | | | | Probe the surface format, and check whether it's really something we support. This also does a complete check whether the EGL interop works at all (the only way to find this out is actually running this code). Also, support YV12. Under some circumstances, vaapi (with Intel drivers) can be made to use this format. Unfortunately, the Intel drivers show some very weird behavior, which is hopefully a bug. insane_hack() provides a very evil workaround (see comments). A proper solution might be passing the hw format as part of mp_image_params, but as long as hw surfaces appear to be able to change the format on the fly, attempting this is probably not worth the extra complexity and likely fragility. The hack allows us to pretend that there is sane behavior for now.
* vaapi: use GPU memcpy for reading back from HW surfacewm42015-09-252-1/+6
| | | | | | | | | This makes it much faster if the surface is really mapped from GPU memory. It's slightly slower than system memcpy if used on system memory. We don't really know definitely in which type of memory it's located, so we use the GPU memcpy in all cases. Fixes #2317.
* video: refactor GPU memcpy usagewm42015