summaryrefslogtreecommitdiffstats
path: root/video
Commit message (Collapse)AuthorAgeFilesLines
* vo: fix some nonsensewm42014-12-104-11/+8
| | | | | | | | | Commit d38bc531 is incorrect: the 50ms queue-ahead value and the flip queue offset have different functions. The latter is about calling flip_page in advance, so the change attempted to show video frames 50ms in advance on all VOs. The change was for vo_opengl_cb, but that can be handled differently.
* vo_opengl: fix linkage typewm42014-12-091-1/+1
| | | | Can happen on Windows, I suppose.
* vo_opengl: make shader text output slightly nicerwm42014-12-091-2/+2
| | | | It was missing an indentation in some cases.
* vo_opengl: don't crash if framebuffers are not availablewm42014-12-091-0/+9
| | | | | | | | | | | In theory, vo_opengl supports operation without framebuffers. But this has been broken for a while now (commit cc00b3ff is a contender). It crashed because it unconditionally called gl->BindFramebuffer() (which is NULL if framebuffers are missing). Since this function is actually only called to set the default framebuffer, the simplest way to deal with this is to provide a dummy function, insteas of uglifying the code with additional if branches.
* vo_opengl_cb: simplify reconfigure, render transparent if unconfiguredwm42014-12-092-15/+15
| | | | | | | I think that's expected; mpv shouldn't draw anything while no video is active. This doesn't blend transparently, though. Also document the vo_opengl_cb thing.
* vo_opengl: make background color configurablewm42014-12-092-3/+11
| | | | | This mainly affects the black bars that are drawn if the window and video aspect ratios mismatch.
* w32: copy WinID optionwm42014-12-091-14/+14
| | | | See previous and next commit.
* x11: copy WinID optionwm42014-12-092-16/+22
| | | | For the purpose of making "--wid" setable at any time.
* client API: expose OpenGL rendererwm42014-12-0912-18/+445
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds API to libmpv that lets host applications use the mpv opengl renderer. This is a more flexible (and possibly more portable) option to foreign window embedding (via --wid). This assumes that methods like context sharing and multithreaded OpenGL rendering are infeasible, and that a way is needed to integrate it with an application that uses a single thread to render everything. Add an example that does this with QtQuick/qml. The example is relatively lazy, but still shows how relatively simple the integration is. The FBO indirection could probably be avoided, but would require more work (and would probably lead to worse QtQuick integration, because it would have to ignore transformations like rotation). Because this makes mpv directly use the host application's OpenGL context, there is no platform specific code involved in mpv, except for hw decoding interop. main.qml is derived from some Qt example. The following things are still missing: - a way to do better video timing - expose GL renderer options, allow changing them at runtime - support for color equalizer controls - support for screenshots
* vo: include normal render-ahead time in flip_queue_offsetwm42014-12-093-9/+13
| | | | | | A small refactor; shouldn't change any behavior. Do this so immediate display can be achieved.
* w32_common: fix GUID linking in CygwinJames Ross-Gowan2014-12-091-0/+1
|
* cocoa: fix crashStefano Pigozzi2014-12-081-5/+0
| | | | | | fixes #1323 Doesn't leak unless we switch video tracks on and off while in fullscreen.
* vo_opengl: enable fancy-downscaling for opengl-hq againwm42014-12-081-1/+1
| | | | | | I guess most problems with it have been fixed. It's still slower than necessary, though.
* vo_opengl: use all filter sizes possible with the shaderswm42014-12-082-33/+21
| | | | | | | | | | | | | | Not all filter sizes the shaders could handle were in the filter_sizes list. The shader can handle any multiple of 4 (the sizes 2 and 6 are special-cased to keep it simple). Add all possible filter sizes, up to 64. 64 is ridiculously high anyway. Most of the larger filter sizes are completely useless for upscaling, but help with the fancy-downscaling option. (Although it would still be more efficient to use cascaded scalers to handle downscaling better.) I considered doing something less stupid than the hardcoded array, but it seems this is still the simplest solution.
* vo_opengl: refactor: instantiate scaler functions at runtimewm42014-12-082-44/+43
| | | | | | | | | | | | | | | | | Before this commit, the convolution scaler shader functions were pre- instantiated in the shader file. For every filter size, a corresponding function (with the filter size as suffix) had to be present. Change this, and make the C code emit the necessary bits. This means the shader code is much reduced. (Although hopefully it doesn't make shader compilation faster - it would require a really dumb compiler if it spends its time on dead code.) It also makes it more flexible, which is the main goal. The DEF_SCALER0 stuff is needed because the C code writes the header of the shader, at a point where scaler macros are not defined yet.
* vo_opengl: never use 1D textures for lookup textureswm42014-12-082-48/+35
| | | | | | | | | This was a microoptimization for small filters which need 4 or less weights per sample point. When I originally wrote this code, using a 1D texture seemed to give a slight speed gain, but now I couldn't measure any difference. Remove this to simplify the code.
* vo_opengl: refactor: merge convolution function and sampler entrypointwm42014-12-081-67/+36
| | | | | | | | | There's not much of a reason to have the actual convolution code in a separate function. Merging them actually simplifies the code a bit, and gets rid of the repetitious macro invocations to define the functions for each filter size. There should be no changes in behavior or output.
* w32_common: ensure taskbar is hidden when fullscreenJames Ross-Gowan2014-12-081-2/+28
| | | | | | | | | | | | | | | Windows uses a heuristic to determine if a window should appear fullscreen. If the active window's client area covers the whole screen, the taskbar should move to the bottom of the Z-order, allowing the window to show through. Unfortunately, sometimes it doesn't work and the taskbar stays on top of the "fullscreen" window. ITaskbarList2->MarkFullscreenWindow explicitly tells the shell that a window wants to be fullscreen, so the taskbar is always at the bottom of the Z-order while the marked window is active. This might help with #999. Firefox also uses this interface to fix fullscreen issues.
* vo_opengl: extend filter size to 64wm42014-12-062-3/+9
| | | | | | For better downscaling. Maybe the list of filter sizes shouldn't be static...
* vo_opengl: clamp filters to their sizewm42014-12-061-1/+2
| | | | | | | | | | | This gives better results with fancy-downscaling. The issue here is that fancy-downscalign "extends" the filter radius by some amount, which requires using a larger filter size and shader. Then most of the filter is "unused", but some filters still return non-0 coefficients, which create heavy artifacts. Just clamp them off. I'm not sure if this is the right solution, but at least it's better than before.
* cocoa: fix view leak in uninit when fullscreenStefano Pigozzi2014-12-061-1/+9
|
* cocoa: use --idle when running inside bundleStefano Pigozzi2014-12-061-4/+1
| | | | | Previously when using the bundle we used a custom bizarro thing to wait for events. Just use `--idle` and greatly simplify the code.
* cocoa: don't change app activation policy in libmpvStefano Pigozzi2014-12-061-3/+4
| | | /cc @mpv-player/stable
* vo_opengl: disable fancy-downscaling for opengl-hq againwm42014-12-061-1/+1
| | | | | Seems it's actually buggy, beyond the problem that large filter sizes are required.
* vo_opengl: extend filter size to 32wm42014-12-062-25/+25
| | | | | | Also replace the weights calculations for 8/12/16 with the generic weight function definition macro. (The weights 2/4/6 follow slightly different rules.)
* vaapi/GLX: remove a direct reference to an GL symbolwm42014-12-061-1/+2
| | | | Instead go through our function loader.
* cocoa: don't create Dock icon for audio only filesStefano Pigozzi2014-12-051-0/+21
| | | | fixes #635
* cocoa: don't async redraw when waiting for VO redrawStefano Pigozzi2014-12-041-1/+3
| | | | | This fixes the very annoying glitch where the black bars disappear for a single frame when going fullscreen.
* video: remove things forgotten in previous commitwm42014-12-032-13/+0
| | | | Oops.
* video: remove internal QP passingwm42014-12-032-78/+3
| | | | | | | | | | | This was required by vf_pp, which was just removed. vf_dlopen has this stuff in its API. This API is considered stable, so the related fields are not removed from it. But the fields are always 0 now, so there's no point in keeping the example program around. vf_pullup.c did some extremely awkward passthrough of this information, but didn't actually use it.
* video/filter: kill vf_pp (libpostproc)wm42014-12-032-157/+0
| | | | | | | | | This is an ancient filter, and we assume it's not useful anymore. If you really want this, it's still available in libavfilter (e.g. via --vf=lavfi=[pp...]). The disadvantage is that mpv doesn't pass through QP information to libavfilter. (This was probably the reason vf_pp still was part of mpv - it was slightly easier to pass QP internally.)
* vo_opengl: make uninit idempotentwm42014-12-032-6/+6
|
* vo_opengl: move hwdec parts into their own fileswm42014-12-039-113/+160
| | | | | | This wasn't done before because there was no advantage in "abstracting" it. This changed, and putting this into its own files is better than messing it into gl_common.c/h.
* vdpau/GLX: don't access VO backendwm42014-12-036-17/+16
| | | | | | | | | Same as with the previous commits. In theory, vdpau/x11 GL interop doesn't assume GLX. It could use EGL as well. But since it's always GLX in practice, so we're fine with this. Remove the gl_hwdec.mpgl field - it's unused now.
* vaapi/GLX: don't access VO backendwm42014-12-031-3/+4
| | | | Same as with the VDA change.
* vda: make independent from cocoa backendwm42014-12-033-8/+7
| | | | | | | | | Basically, don't access the vo field. There's also no reason anymore to access MPGLContext. We still need to access loaded GL functions though, so add a field for that to gl_hwdec. Untested.
* vda: use implicit current GL contextStefano Pigozzi2014-12-033-16/+1
| | | | Removes the dependency from the Cocoa backend in case we are not using it but still wanna use VDA GL introp.
* vo_opengl: minor changeswm42014-12-023-10/+12
| | | | | | | | | | | | | | Always set the viewport on entry. The way the viewport is tracked is a bit complicated in my opinion, and in fact it doesn't even reduce the number of GL calls. Setting it on entry is actually redundant if video covers the screen fully, because the handle_pass() unconditionally sets it anyway, but avoiding it would complicate the cases gl->Clear() is actually needed. Add a fbo argument to gl_video_render_frame(). This allows you to render into a FBO rather than the default framebuffer. It will be useful for providing an API to render on an external GL context. (If that will actually be added.)
* vo_opengl: print error number if framebuffer creation failswm42014-12-021-2/+4
| | | | | | | | Seems like a waste not to print this. Anyone with enough technical knowledge to have use for the exact error can map the number back to the GL symbol, so don't bother to convert it to a symbol.
* vd_lavc: use avcodec_is_open()wm42014-12-021-1/+1
| | | | | This is "better", although nobody seems to know how this API is supposed to work at all.
* cocoa: allow to black out other display when going fsStefano Pigozzi2014-12-013-1/+7
| | | fixes #1302
* vo_opengl: remove redundant GL state initializationwm42014-12-011-4/+0
| | | | | | | All of these are already the defaults. One exception is glDepthMask(), which is enabled by default. But if the framebuffer has no depth buffer anyway, it shouldn't make a difference.
* vd_lavc: don't crash if codec could not be openedwm42014-12-011-1/+1
| | | | Fixes #1307.
* vo_wayland: Add "multimedia" keyboard key bindings.Sergey Kvachonok2014-11-291-0/+14
| | | | | | | | libxkbcommon keysyms are the same as X11 keysyms (sans prefix), so I simply copied the missing subsection from x11_common.c. Signed-off-by: Sergey Kvachonok <ravenexp@gmail.com> Signed-off-by: wm4 <wm4@nowhere>
* vo_opengl: enable fancy-downscaling by default for opengl-hqwm42014-11-291-0/+1
|
* vo_opengl: disable fancy-downscaling for anamorphic videowm42014-11-291-20/+33
| | | | Includes some arbitrary minor refactoring.
* win32: add screen offset when handling overlarge windowswm42014-11-281-2/+2
| | | | | | | | | | | MS Windows doesn't allow windows larger than the screen, so we include a hack to make the window smaller. This hack recenters the window (what else would it do?). It didn't account for the virtual offset of the current screen, and it was reported that it forces the window to the first screen. Should fix #1292.
* vo_direct3d: check whether D3DFMT_A8 is availablewm42014-11-271-11/+29
| | | | | | | | I suspect this is what is happening in github issue #1265 (at least partially). If D3DFMT_A8 is not available, fall back to RGBA. This is less efficient in general, so we normally want to avoid it.
* gl_video: minor simplificationwm42014-11-271-4/+0
| | | | Not needed anymore.
* vo_opengl: Linearize non-RGB sRGB files correctly (eg. JPEG)Niklas Haas2014-11-263-7/+48
| | | | Signed-off-by: wm4 <wm4@nowhere>
* Do not call strerror()wm42014-11-262-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | ...because everything is terrible. strerror() is not documented as having to be thread-safe by POSIX and C11. (Which is pretty much bullshit, because both mandate threads and some form of thread-local storage - so there's no excuse why implementation couldn't implement this in a thread-safe way. Especially with C11 this is ridiculous, because there is no way to use threads and convert error numbers to strings at the same time!) Since we heavily use threads now, we should avoid unsafe functions like strerror(). strerror_r() is in POSIX, but GNU/glibc deliberately fucks it up and gives the function different semantics than the POSIX one. It's a bit of work to convince this piece of shit to expose the POSIX standard function, and not the messed up GNU one. strerror_l() is also in POSIX, but only since the 2008 standard, and thus is not widespread. The solution is using avlibc (libavutil, by its official name), which handles the unportable details for us, mostly. We avoid some pain.
* gl_common: factor context creationwm42014-11-264-50/+51
| | | | | | | Always create the context in mpgl_init(), instead of doing it when mpgl_config_window() is called the first time. This is a small step towards cleaning up the GL backend interface, and adding other things like perhaps GLES support, or a callback-driven backend for libmpv.
* vo_opengl: Reword comment in shaderNiklas Haas2014-11-261-2/+3
| | | | | I didn't quite understand this comment after looking at the code again months later, so I reworded it for better clarity.
* vo_opengl: make operator precedence explicitwm42014-11-261-1/+2
| | | | More readable.
* vo_opengl: fix srgb with certain inputswm42014-11-261-1/+1
| | | | | | | | | Sampling from the source texture and scaling must always be done separately in this mode. Fix suggested by haasn. Still looks a bit wrong, though.
* vo_opengl: somethingwm42014-11-261-1/+1
| | | | | | Insert explanation here. Fixes #1023.
* cocoa: don’t hand over view memory ownership to libmpv clientsStefano Pigozzi2014-11-251-1/+1
|
* x11: fix crashwm42014-11-231-1/+1
| | | | Broken by previous commit. Oops.
* x11: fix crash with --wid=0 and vo_xv/vo_x11wm42014-11-231-2/+5
| | | | | | | But seriously, don't use --wid=0, don't use vo_xv, and _especially_ don't use vo_x11. Fixes #1284.
* Silence some Coverity warningswm42014-11-211-1/+1
| | | | None of this really matters.
* vd_lavc: flush frames before uninitializing hw decoderwm42014-11-201-0/+3
| | | | | | This way, no surfaces are in use when uninitializing the hw decoders, which might help with -copy hw decoders (normal hw decoding is not affected).
* vo_direct3d: fix texture-memory sub-option, extend itwm42014-11-181-5/+13
| | | | | | | | | | This sub-option was turned into a flag when the sub-option parser was changed to the generic one (probably accidentally). Turn it into a proper choice-option. Also, adjust what the options do. Though none of this probably makes much sense; the default should work, and if it doesn't, the GPU/driver is probably beyond help.
* vo_opengl: allow setting different filters for downscalingwm42014-11-142-2/+6
|
* mp_image: slightly better image params verbose infowm42014-11-123-2/+9
|
* video: move formatting of image parameters to separate functionwm42014-11-123-21/+27
|
* vf: minor simplificationwm42014-11-122-16/+9
| | | | | | | | Remove the extra vf_chain.output field - there's absolutely no need for it, because there is always a last filter which will buffer the output. For some reason, vf_chain.last was never set, which we now need to fix too.
* ao_lavc, vo_lavc: Fix crashes in case of multiple init attempts.Rudolf Polzer2014-11-121-6/+16
| | | | | | | | | | | | When initialization failed, vo_lavc may cause an irrecoverable state in the ffmpeg-related structs. Therefore, we reject additional initialization attempts at least until we know a better way to clean up the mess. ao_lavc currently cannot be initialized more than once, yet it's good to do consistent changes there as well. Also, clean up uninit-after-failure handling to be less spammy.
* vf_sub: fix previous commitwm42014-11-111-3/+3
| | | | | | The previous fix breaks another obscure case: if the second vf_sub adds margins, the image is accidentally not extended, which would return in an assertion failure when returning the bogus image.
* vf_sub: don't crash if no subtitle context is availablewm42014-11-111-0/+3
| | | | Happens with --vf=sub,sub (only the first one gets the context).