summaryrefslogtreecommitdiffstats
path: root/video
Commit message (Collapse)AuthorAgeFilesLines
* 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).
* encode: don't segfault when bailing out due to resolution changewm42014-11-111-1/+1
| | | | Somehow this code expects lastimg is always set.
* vo_opengl: don't reset user-set gamma when using vo_cmdlinewm42014-11-111-0/+3
|
* video/out: minor simplification to event query functionwm42014-11-092-6/+5
| | | | The "clear" parameter is confusing and useless.
* mp_image: check memory allocationwm42014-11-081-0/+4
|
* w32_common: open window menu on Alt+SpaceJames Ross-Gowan2014-11-081-0/+10
| | | | | | Since mpv doesn't call TranslateMessage, this must be done manually. Should fix #1254
* Revert "w32_common: don't override alt+space"wm42014-11-081-16/+8
| | | | | | | | This reverts commit d859549424174179768fcd0310c75823a5ff7cb1. Going to apply the alternative fix through PR #1256, which came just some seconds after pushing the reverted commit. The reverted commit was reported as not actually working.
* w32_common: don't override alt+spacewm42014-11-081-8/+16
| | | | | | Apparently, stealing this from the WM is bad form, just like with F10. Fixes #1254.
* vo_opengl: initialize renderer after setting sizewm42014-11-072-2/+4
| | | | | | | | | | | This silences the warning: video/out/gl_video.c:1091:51: runtime error: division by zero when running with clang -fsanitize=undefined. Division by zero is legal according to IEEE, but I guess clang doesn't care about standard. While triggering this warning isn't actually avoided in all cases, it's avoided in the common case and also makes people shut up about it.
* vo/x11: implement VOCTRL_GET_DISPLAY_NAMES with xrandr names (e.g., "LVDS1")Kevin Mitchell2014-11-073-2/+23
| | | | | | | | XRRGetOutputInfo contains a "name" element which corresponds to to the display names given to the user by the "xrandr" command line utility. Copy it into the xrandr_display struct for each display. On VOCTRL_GET_DISPLAY_NAMES, send a copy of the names of the displays spanned by the mpv window on.
* vo_wayland: drop redundant "const"wm42014-11-071-1/+1
|
* vo_vaapi: fix broken error checkswm42014-11-071-2/+2
|
* video: remove swapped-endian image format aliaseswm42014-11-055-175/+73
| | | | | Like the previous commit, this removes names only, not actual support for these formats.
* vo_wayland: don't use endian-specific defineswm42014-11-051-18/+22
| | | | | | | | | | | | Instead, use the native-endian alias, and switch the wayland format depending on the target platform's endian. This drops support for swapped-endian formats, but I think that is ok. Not only are the affected formats rather ancient and backwards, but using swapped formats probably does not make any sense for performance either. Untested.
* video: remove aliases for some rarely referenced image formatswm42014-11-052-82/+0
| | | | | | | | | These formats are still supported; you just can't reference them via a defined constants directly. They are now handled via the generic passthrough. (If you want to use such a format, you either have to add the entry back, or use AV_PIX_FMT_* directly.)
* video: add image format test programwm42014-11-051-0/+63
|
* video: passthrough unknown AVPixelFormatswm42014-11-053-1/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a rather radical change: instead of maintaining a whitelist of FFmpeg formats we support, we automatically support all formats. In general, a format which doesn't have an explicit IMGFMT_* name will be converted to a known format through libswscale, or will be handled by code which can treat pixel formats in a generic way using the pixel format description, like vo_opengl. AV_PIX_FMT_UYYVYY411 is a special-case. It's packed YUV with chroma subsampling by 4 in both directions. Its component order is documented as "Cb Y0 Y1 Cr Y2 Y3", meaning there's one UV sample for 4 Y samples. This means each pixel uses 1.5 bytes (4 pixels have 1 UV sample, so 4 bytes + 2 bytes). FFmpeg can actually handle this format with its generic mechanism in an extremely awkward way, but it doesn't work for us. Blacklist it, and hope no similar formats will be added in the future. Currently, the AV_PIX_FMT_*s allowed are limited to a numeric value of 500. More is not allowed, and there are some fixed size arrays that need to contain any possible format (look for IMGFMT_END dependencies). We could have this simpler by replacing IMGFMT_* with AV_PIX_FMT_* through the whole codebase. But for now, this is better, because we can compensate for formats missing in Libav or older FFmpeg versions, like AV_PIX_FMT_RGB0 and others.
* video: handle endian detection in a more generic waywm42014-11-051-7/+21
| | | | | | | | | | | | | FFmpeg has only a AV_PIX_FMT_FLAG_BE flag, not a LE one, which causes problems for us: we want to have the LE flag too, so code can actually detect whether a format is non-native endian. Basically, we want to reconstruct the LE/BE suffix all AV_PIX_FMT_*s have. Doing this is hard due to the (messed up) way AVPixFmtDescriptor works. The worst is AV_PIX_FMT_RGB444: this group of formats describe an endian-independent access (since no component actually spans 2 bytes, you only need byte accesses with a fixed offset), so we have to go through some pain.
* video: refuse to allocate image data for hwaccel formatswm42014-11-051-1/+1
| | | | Makes no sense.
* video: get hwaccel flag from pixdescwm42014-11-052-5/+8
|
* vo_opengl: minimal EGL on X11 supportwm42014-11-043-0/+171
| | | | | | Pretty useless and only good for testing. Does not include any form of GLES support.
* x11: rely on the Atom cachewm42014-11-032-15/+9
| | | | | XInternAtom() has a 64 entry hash table to avoid network accesses. Rely on this cache, instead of caching these manually.
* command: add window-minimized property (X11 only)wm42014-11-023-1/+28