summaryrefslogtreecommitdiffstats
path: root/video
Commit message (Collapse)AuthorAgeFilesLines
* player: respect --untimed on last framewm42015-01-251-2/+1
| | | | | | | | | | | | | | The last video frame is another case that has a separate code path, although it's pretty similar to the one in commit 73e5aa87. Fix this in a different way, which also takes care of the last frame case, although without context the code becomes slightly more tricky. As further cleanup, move the decision about framedropping itself to the same place, so the check in vo.c becomes much simpler. The check for the vo->driver->encode flag, which is remvoed completely, was redundant too. Fixes #1480.
* image_writer: check for conversion errorswm42015-01-253-11/+17
| | | | | This can happen when e.g. a VO returns a screenshot in an unsupported format.
* x11: always use glXGetProcAddressARB()wm42015-01-251-1/+1
| | | | | | | | | | glXGetProcAddress() is outdated, and as far as I know doesn't give all the guarantees the "new" ARB function gives. Probably doesn't matter too much, because until now it always appeared to work. On the other hand, since this function is (bogusly) used only on the gl3 code path, it could have happened that users hit this, and just reverted to vo_opengl_old instead.
* video/out/win_state.c: fix --monitoraspectSoeren D. Schulze2015-01-251-1/+1
|
* x11: make display-names property stricterwm42015-01-251-1/+3
| | | | | | | | | | | | | | Returning the property before the window is mapped could lead to confusing behavior, and in particular strange differences between vo_vdpau and vo_opengl. (vo_opengl creates the window right at the start, while vdpau waits until the first reconfigure event.) It might even be possible that for vo_opengl random results were returned, because the hidden window can have different placement than the actual, final one on initial video reconfig. Fix this by returning the property only if the window is considered mapped. command.c handles this case specifically, and makes the property unavailable, instead of returning an empty list.
* command: make empty vf-metadata not an errorwm42015-01-251-3/+4
| | | | | | | | If a filter exists, but has no metadata, just return success. This allows the user to distinguish between no metadata available, and filter not inserted. See #1408.
* vf: fix crash if filter doesn't provide control entrypointwm42015-01-251-1/+1
| | | | | | | | This input command crashed: vf add @mf:format=yuv420p ; show_text "${vf-metadata/mf}" Fixes #1408.
* vo_opengl, x11: make legacy context warning not an errorwm42015-01-251-1/+1
| | | | | | Really, this doesn't actually matter. It's printed as error only because it was once thought to be an mostly unneeded fallback, but it turned out this is still frequently needed, and users are getting confused.
* vo_opengl: fix broken rejection of extended scalingwm42015-01-251-3/+2
| | | | | Possibly explains why some users got mysterious FBO errors on crappy hardware.
* mp_image: reject invalid display aspect ratiowm42015-01-251-1/+1
| | | | | | | | | | Having any of these set to 0 makes no sense. I think some code might still be using 0/0 aspect ratio to signal unset aspect ratio, but I didn't find it. If there is still code like this, it should be fixed instead. Fixes #1467.
* gl_video.c: invalidate image_params in uninit_video()xylosper2015-01-251-0/+4
| | | | | | | | | | | | | When the given mp_image_params does not match with that of gl_video, gl_video_config() always calls uninit_video() but calls init_video() only if valid format is given. Since uninit_video() does not change image_params of gl_video, when the same params as the previous one is given to gl_video_config() after gl_video is unitialized with invalid format, gl_video_config() never calls init_video(). To prevent this, invalidate image_params of gl_video in uninit_video().
* dxva2: copy mp_image attributes to sw_imgJames Ross-Gowan2015-01-251-0/+1
|
* mp_image: copy missing attributesJames Ross-Gowan2015-01-251-0/+2
| | | | | This adds a couple of missing fields to mp_image_copy_attributes so things like rotation metadata work.
* cocoa: fix build on 10.9Stefano Pigozzi2015-01-251-1/+1
| | | | Use -isInFullScreenMode instead of the property introduced with the 10.10 SDK.
* cocoa: fix NSMapGet errorStefano Pigozzi2015-01-251-2/+4
| | | | regression from 64b6b2ea45
* cocoa: fix uninitialization while in fullscreenStefano Pigozzi2015-01-253-2/+36
| | | | | | | | This is only needed for switching video track with `_`, since Cocoa automatically handles cleaning up the application's presentation options when quitting the process. Fixes #1399
* screenshots: set AVFrame parameterswm42015-01-251-0/+3
| | | | | | | Currently, libavcodec is rather lenient, but it might get stricter in the future. Fixes #1398.
* cocoa: mark window for redraw after title changeStefano Pigozzi2015-01-141-1/+3
| | | | | | | This used to work correctly without the call to displayIfNeeded. I think this may only be needed for Yosemite. Fixes #1330
* vo_opengl: clamp filters to their sizewm42014-12-191-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: don't change app activation policy in libmpvStefano Pigozzi2014-12-171-3/+4
| | | | /cc @mpv-player/stable
* vo_x11: don't attempt to resize when unconfiguredwm42014-12-171-2/+3
| | | | | | Fixes #1347. The previous commit actually fixes the crash.
* vo_x11: check allocation errorswm42014-12-171-3/+10
| | | | Avoids a crash if allocation fails.
* vd_lavc: fix error handling pathwm42014-12-171-11/+12
| | | | The ctx->pic check must uninitialize the decoder.
* mp_image: check for malloc failurewm42014-12-171-0/+2
| | | | | Or rather, the only reason av_buffer_create() can fail is a malloc failure.
* Check some mallocswm42014-12-171-0/+4
| | | | Fixes #1337.
* vo_opengl: fix linkage typewm42014-12-171-1/+1
| | | | Can happen on Windows, I suppose.
* vo_opengl: don't crash if framebuffers are not availablewm42014-12-171-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.
* w32_common: fix GUID linking in CygwinJames Ross-Gowan2014-12-171-0/+1
|
* cocoa: don't create Dock icon for audio only filesStefano Pigozzi2014-12-081-0/+21
| | | | fixes #635
* cocoa: don't async redraw when waiting for VO redrawStefano Pigozzi2014-12-071-1/+3
| | | | | This fixes the very annoying glitch where the black bars disappear for a single frame when going fullscreen.
* vo_opengl: Linearize non-RGB sRGB files correctly (eg. JPEG)Niklas Haas2014-12-013-7/+48
| | | | Signed-off-by: wm4 <wm4@nowhere>
* vo_opengl: Reword comment in shaderNiklas Haas2014-12-011-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-12-011-1/+2
| | | | More readable.
* vo_opengl: fix srgb with certain inputswm42014-12-011-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-12-011-1/+1
| | | | | | Insert explanation here. Fixes #1023.
* vd_lavc: don't crash if codec could not be openedwm42014-12-011-1/+1
| | | | Fixes #1307.
* win32: add screen offset when handling overlarge windowswm42014-12-011-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.
* 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 o