summaryrefslogtreecommitdiffstats
path: root/video
Commit message (Collapse)AuthorAgeFilesLines
* Fix some cppcheck / scan-build warningswm42013-05-063-3/+3
| | | | | | | | These were found by the cppcheck and scan-build static analyzers. Most of these aren't interesting (the 2 previous commits fix some interesting cases found by these analyzers), and they don't nearly fix all warnings. (Most of the unfixed warnings are spam, things MPlayer never cared about, or false positives.)
* vf_yadif: actually set PTS for output frameswm42013-05-061-0/+1
| | | | The original frame PTS was used instead. Oops...
* img_format: fix broken conditionwm42013-05-061-1/+1
| | | | | | This caused all formats with fewer than 8 bits per component marked as little endian. (Normally, only some messed up packed RGB formats are endian-specific in this case.)
* csputils: use AVCOL_SPC_YCOCG instead of AVCOL_SPC_YCGCO (fixes Libav build)wm42013-05-051-2/+2
| | | | | | | | This one should probably be blamed on ffmpeg. Its headers contain: #define AVCOL_SPC_YCGCO AVCOL_SPC_YCOCG Uh, ok...
* video: add --hwdec-codecs option to whitelist codecs for hw decodingwm42013-05-041-3/+16
|
* vd_lavc: allow explicitly selecting vdpau hw decoderswm42013-05-041-1/+11
| | | | | | | | | | | | This allows using the vdpau decoders with -vd without having to use the -hwdec switch (basically like in mplayer). Note that this way of selecting the hardware decoder is still deprecated. libavcodec went away from adding special decoder entries for hardware decoding, and instead makes use of the "hwaccel" architecture, where hardware decoders use the same decoder names as the software decoders. The old vdpau special decoders will probably be deprecated and removed in the future.
* video: support YCgCo colorspacewm42013-05-042-0/+13
| | | | | | | YCgCo can be manually selected, but will also be used if the decoder reports YCgCo. To make things more fun, files are sometimes marked incorrectly, which will display such broken files incorrectly starting with this commit.
* vo_opengl: XYZ input supportwm42013-05-044-12/+70
| | | | | | | | | | | | | | | | Useful for the j2k decoder. Matrix taken from http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html (XYZ to sRGB, whitepoint D65) Gamma conversion follows what libswscale does (2.6 in, 2.2 out). If linear RGB is used internally for scaling, the gamma conversion will be undone by setting the exponent to 1. Unfortunately, the two gamma values don't compensate each others exactly (2.2 vs. 1/0.45=2.22...), so output is a little bit incorrect in sRGB or color-managed mode. But for now try hard to match libswscale output, which may or may not be correct.
* video: fix setting XYZ flagwm42013-05-041-4/+4
| | | | Commit 9e0b68a didn't really do this correctly, failure at basic logic.
* gl_video: use GL_SRGB only if it's really RGBwm42013-05-041-2/+3
| | | | | Use the proper RGB flag instead of !YUV. Currently, this doesn't change anything, because only RGB and YUV formats are supported.
* vf_rotate: fix for some obscure pixel formatswm42013-05-031-7/+6
| | | | | Repurpose the 3 byte case for any unhandled pixel width. Fixes rotation with e.g. rgb48. Very inefficient, but works.
* wayland: fix wrong poll comment, check for errorsAlexander Preisinger2013-05-021-2/+4
| | | | | | | | We only print an error message when POLLERR or POLLHUP occurrs, as the something did go horribly wrong and the server will either deal with it or crash. Also add POLLOUT to the events.
* wayland: avoid iterating over all outputsAlexander Preisinger2013-05-021-15/+18
| | | | | If we use the output itself as user data we don't have to iterate over all outputs when the handle_mode event comes.
* wayland: remove unused stuffAlexander Preisinger2013-05-022-17/+0
|
* wayland: use new function xkb_keymap_from_bufferAlexander Preisinger2013-05-021-9/+5
| | | | | | Bump xkbcommon version and use the new xkb_keymap_from_buffer. This is more secure, because the from_string expects a 0 terminated string, but this cannot be guaranteed with mmap.
* Fix compilation with Libavwm42013-05-011-1/+1
|
* video: add XYZ supportwm42013-05-014-0/+19
| | | | Needed for the ffmpeg j2k decoder.
* wayland: remove input modifier variableAlexander Preisinger2013-05-012-14/+0
| | | | This variable was never used anywhere.
* wayland: use GetTimerMS for hiding mouse cursorAlexander Preisinger2013-05-012-161/+39
| | | | | | This commit remove a lot of linux specific code, like epoll. It also reduces the complexity of the code. Instead of epoll we use poll which makes the wayland backend more portable to other platforms.
* wayland: use mpv internal key auto-repeat handlingAlexander Preisinger2013-05-012-61/+5
| | | | | | This removes a good chunk of code trying to recreate key repeat. Because the wayland protocol and xkbcommon don't have an interface for auto-repeating pressed keys.
* cocoa_common: fix window sizingStefano Pigozzi2013-04-281-2/+2
| | | | | | The code was attempting to get the ceiling of the double. Too bad NSSize has floats inside of it and the int cast is nowhere to be seen. This caused rounding errors by one pixel in the window size.
* vd_lavc: fix decoder init failure pathwm42013-04-271-14/+18
| | | | | | | | | libavcodec decoder initialization failure caused a segfault, because it wasn't properly reported back in init(). Also remove the return value from init_avctx(), which actually makes things simpler. Instead, ctx->avctx can be checked to see whether initialization was ok.
* vf_lavfi: move compat crap to the start of the filewm42013-04-261-18/+18
|
* vf_lavfi: silence stupid deprecation warningwm42013-04-261-2/+12
| | | | | | | | | | | | | | | | | | | libavfilter changed the way a format list is passed to vf_format. Now you have to separate formats with "|" instead of ":". If you use "|", it prints an annoying message on every reinit: [format @ 0x8bbaaa0]This syntax is deprecated. Use '|' to separate the list items. ...and it will probably stop working without warning at some point in the future. We need some very annoying ifdeffery to detect this case, because libavfilter version numbers are just plain incompatible between Libav and ffmpeg. There is no other way to detect this. (Sometimes I wonder whether ffmpeg and especially Libav actually like causing unnecessary pain for their users, and intentionally break stuff in the most annoying way possible. Sigh...)
* vf_lavfi: recreate filter graph on seekwm42013-04-251-14/+41
| | | | | | | | | | | | | | Resetting the filter graph helps dealing with filters which save state between frames. This is important especially if they modify frame timing or emit additional frames. Unfortunately the libavfilter API doesn't have a way to do this directly, so we have to use a dirty trick: we recreate the whole graph, including format negotiation down and filter string parsing. ffplay does this too. If libavfilter somehow decides to change output format or size from what the first run in config() returned, mpv will explode. The same applies to vf_next_query_format() return values (although this could be mitigated, should it really happen).
* x11: use mpv internal key auto-repeat handling if possiblewm42013-04-242-2/+24
| | | | | | | | | | | | | | | | | Block X11's native key repeat, and use mpv's key repeat handling in input.c instead. No configure check for XKB. Even though it's an extension, it has been part of most (all?) xlibs since 1996. If XKB appears to be missing, just refuse enabling x11. This is a potentially controversial change. mpv will use its own key repeat rate, instead of X11's. This should be better, because seeking will have a standardized "speed" (seek events per seconds when keeping a seek key held down). It will also allow disabling key repears for certain commands, though this is not done anywhere yet. The new behavior can be disabled with the --native-keyrepeat option.
* vo_opengl_old: remove nomanyfmts warningwm42013-04-231-3/+0
| | | | | | The VO warns by default that the nomanyfmts option should be used if video display fails. This is almost completely useless, but people keep asking what it means.
* vf_lavfi: add libavfilter bridgewm42013-04-212-0/+315
| | | | | | | | | | | | | | | | | Requires recent FFmpeg/Libav git versions. Earlier versions will not be supported, as the API is different. (A libavfilter version that uses AVFrame instead of AVFilterBuffer is needed.) Note that this is sort of useless, because the option parser prevents you from making use of the full libavfilter graph syntax. This has to be fixed later. Most of the filter creation code (half of the config() function) has been taken from avplay.c. This code is not based on MPlayer's vf_lavfi. The MPlayer code doesn't compile as it hasn't been updated through multiple libavfilter API changes, making it completely useless as a starting point.
* mp_image: provide function to convert mp_image to AVFramewm42013-04-212-0/+53
| | | | | | Note that this does not pass through QP information (qscale field). The only filter for which this matters is vf_pp, and we have this natively.
* x11_common: minor simplificationwm42013-04-211-13/+6
|
* cocoa_common: keep aspect ratio when clipping windowStefano Pigozzi2013-04-171-7/+35
| | | | | With commit 33ffc283 resizing to double size would cause the window to lose aspect ratio. This commit fixes this bug.
* change reverse DNS strings to io.mpv.*Stefano Pigozzi2013-04-161-1/+1
| | | | fixes #60
* cocoa_common: refactor centered resizeStefano Pigozzi2013-04-161-24/+21
| | | | | | This refactor makes the code easier to understand. Also corrects a bug that caused the window to move to the left when the new size was bigger than the visible frame.
* vf_divtc, vf_phase: Fix handling of subsampled formatsMartin Herkt2013-04-102-3/+4
| | | | | | These filters incorrectly calculated the amount of bytes per line in each plane for chroma subsampled formats, causing undefined behavior.
* wayland: use vo flags for enabling alpha supportAlexander Preisinger2013-04-021-3/+5
| | | | I missed the VOFLAG for enabling alpha support
* wayland: enable alpha supportAlexander Preisinger2013-04-021-1/+1
| | | | | | It is now possible to show images and videos with alpha information correctly. This was disalbed before, because there was a bug that made black parts of videos also transparent.
* gl_video: remove double const qualifierStefano Pigozzi2013-03-301-1/+1
| | | | This fixes a warning when compiling with clang.
* gl_video: add some missing includeswm42013-03-301-0/+8
| | | | On most platforms, they are recursively included, but not all.
* gl_lcms: fix compilation when lcms2 is not availablewm42013-03-301-3/+10
|
* gl_video: actually fix shader compilation on OSXwm42013-03-282-2/+3
| | | | | | | | | | | | | The previous attempt was missing some code paths, so there were still shaders generated that triggered the shader compilation error. Fix it instead by special handling USE_CONV in the shader. By the way, the shader compiler did not accept: #if defined(USE_CONV) && (USE_CONV == ...) In my opinion this should be perfectly fine, but it gives the same error as before. So test USE_CONV separately with #ifndef.
* gl_video: fix OSX by not using undefined name in GLSL "#if"wm42013-03-281-0/+2
| | | | | | | | | | | | | | | | | | | The OSX shader compiler was giving this error: ERROR: 0:235: '' : syntax error incorrect preprocessor directive on this line: [235] #if USE_CONV == CONV_PLANAR USE_CONV was undefined in some cases. The expected behavior is that the shader preprocessor interprets this as branch not taken (AFAIK exactly as in C), which is probably what the standard would dictate. This is possible an OSX bug. But admittedly, I'm not sure whether this is really standard behavior (in C or GLSL), and doing this is extremely weird at best, so make sure that USE_CONV is always defined. Should fix behavior on OSX.
* gl_header_fixes: add GL_RGBA32Fwm42013-03-281-0/+3
| | | | Should fix compilation on OSX 10.8.3 and maybe other platforms.
* gl_video: use choice option type for dither-depth suboptionwm42013-03-282-7/+8
| | | | | Replaces the numeric magic values -1 and 0 with "no" and "auto". The numeric values are still allowed for compatibility.
* vo: rename vo_draw_image to vo_queue_imagewm42013-03-282-7/+4
|
* vo: remove two unused symbolswm42013-03-281-6/+0
|
* gl_video: add some alpha FBO formatswm42013-03-281-1/+5
|
* vo_opengl: add alpha outputwm42013-03-286-11/+73
| | | | | | | | | | | | | | | | | | | Allows playing video with alpha information on X11, as long as the video contains alpha and the window manager does compositing. See vo.rst. Whether a window can be transparent is decided by the choice of the X Visual used for window creation. Unfortunately, there's no direct way to request such a Visual through the GLX or the X API, and use of the XRender extension is required to find out whether a Visual implies a framebuffer with alpha used by XRender (see for example [1]). Instead of depending on the XRender wrapper library (which would require annoying configure checks, even though XRender is virtually always supported), use a simple heuristics to find out whether a Visual has alpha. Since getting it wrong just means an optional feature will not work as expected, we consider this ok. [1] http://stackoverflow.com/questions/4052940/how-to-make-an-opengl- rendering-context-with-transparent-background/9215724#9215724
* gl_video: always upload all planeswm42013-03-281-15/+2
| | | | | | | When displaying YUV with alpha plane (an extremely rare special case), we didn't upload the alpha plane, because we don't do anything with it. This actually created some annoying special cases, so upload the alpha planes as well, even if they're unused.
* gl_video: support NV21 toowm42013-03-282-2/+6
|
* gl_video: add support for NV12wm42013-03-282-2/+20
| | | | | There's really no reason for this, but it feels nice being able to support a weird pixel format.
* gl_video: make it possible for planes to have different formatswm42013-03-281-38/+56
| | | | | | Preparation for NV12 support. Also adds support for IMGFMT_YA8.
* gl_video: move video image fields into a structwm42013-03-281-42/+68
| | | | | | This is a bit cleaner. Also don't repeat the chroma shift calculations over and over, but store the image size instead, which is simpler and will give us a chance to fix display of non-mod-2 image sizes.
* vo_opengl: split into multiple files, convert to new option APIwm42013-03-289-1963/+2177
| | | | | | gl_video.c contains all rendering code, gl_lcms.c the .icc loader and creation of 3D LUT (and all LittleCMS specific code). vo_opengl.c is reduced to interfacing between the various parts.
* gl_common: split into platform specific fileswm42013-03-2810-805/+891
| | | | | | | | | | | Do this instead of stuffing all x11/cocoa/win32/wayland specific code into gl_common.c. The cocoa specific parts could probably go directly into cocoa_common.m, possibly same with wayland. Also redo how the list of backends is managed. Get rid of the GLTYPE_ constants. Instead of having a big switch() on GLTYPE_, each backend entry has a function pointer to setup the MPGLContext callback (e.g. mpgl_set_backend_x11()).
* core: always pass data via packet fields to video decoderswm42013-03-284-16/+11
| | | | | | | Makes the code a bit simpler to follow, at least in the "modern" decoding path (update_video_nocorrect_pts() is used with old demuxers, which don't return proper packets and need further parsing, so this code looks less simple now).
* w32_common: Cygwin64 fixesKovensky2013-03-231-3/+4
| | | | | | | | | | | | | Good news: MPV worked fine even without the fixes, but pointer size mismatch warnings aren't the nicest things to leave lying around. Fix macro that assumed HWND is uint32_t-sized. Win64 is also a special butterfly and is an LLP64 platform on amd64 CPUs, while all the other amd64 platforms are LP64. Cygwin decided to go with the other platforms, and thus sizeof(long) != sizeof(int), and in cygwin's windows headers LONG is int-sized. Fix an mp_msg that assumed LONG is long.
* wayland: fully support cursor autohide optionsAlexander Preisinger2013-03-231-15/+15
| | | | I missed the special cases in the previous commits.
* w32_common: reset internal display size to the window sizewm42013-03-191-0/+5
| | | | | vo->dwidth/dheight are overwritten by vo.c at this point (which is not nice, but it's how things are currently).
* video: deal with 0x0 window sizewm42013-03-191-2/+4
| | | | If this happens, don't set a NaN aspect ratio.
* x11_common: remove assumption that video is always centeredwm42013-03-174-33/+28
| | | | | | | | | | The vo_x11_clearwindow_part() function assumed that the video is always centered. Replace it with a new vo_x11_clear_background() function instead, which essentially does the same as the old function. It takes the video rectangle instead of just the video size, and doesn't have to make the assumption that the video rectangle is centered. Also make vo_x11 use it (seems advantageous).
* video: enable panscan calculations even in windowed modewm42013-03-171-3/+2
| | | | | | | | This was probably enabled to guarantee that panscan is always reset in windowed mode. However, the window size should be exactly the video size in windowed mode, unless in cases where the user forcibly changed the window size (e.g. --geometry). In the former case, panscan will have no influence at all, and in the latter case we want it to have influence.
* video: apply --no-keepaspect even on fullscreenwm42013-03-171-1/+1
| | | | | | | | | If that's what the user asked for, there's no reason to introduce special cases to ignore it on fullscreen. The old behavior is perhaps accidentally due to the fact that aspect calculations used to be disabled in windowed mode, rather than a deliberate decision.
* video: remove rounding of display size to multiples of 2wm42013-03-171-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | The code that is changed is responsible for scaling the video size to display size, so that the resulting video rectangle is letter-boxed inside the display window. This is before panscan calculations, which can actually enlarge the video and make it larger than the display size again. (src_dst_split_scaling() in vo.c takes cares of clipping the video size to window size.) I'm not sure why this rounding is done, as using panscan controls can introduce odd sizes again. The rounding has been part of the code since the initial commit. On the other hand, this rounding can slightly influence the aspect ratio of the displayed image to the worse. It forces the image to be scaled by an additional pixel, without actually correcting the display size into the other direction. Although video sizes are usually at least aligned on 2 (and often more), odd sizes can still happen when playing e.g. anamorphic DVDs. Remove the additional rounding. (Note that we still round the _source_ image position and size when the displayed image is larger than the screen, e.g. when panscan is used. This is needed by some VOs so that the image source rectangle starts on full chroma pixels. Maybe this rounding should be moved to the respective VOs, which includes at least vo_direct3d.)
* video: remove aspect.h includes from files which don't need itwm42013-03-178-8/+0
|
* video: simplify aspect calculation stuffwm42013-03-174-93/+38
| | | | | | | Remove lots of weird logic and dead code. The only difference is that when specifying a monitor aspect ratio, it will always upscale and never downscale.
* vo_xv: minor simplificationswm42013-03-171-17/+4
| | | | | | The draw_osd change is a bit tricky: I guess originally, there was some intention not to second-guess the generic a