summaryrefslogtreecommitdiffstats
path: root/video
Commit message (Collapse)AuthorAgeFilesLines
* 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 aspect code, but the result is the same and the code is more confusing.
* vo_x11: accept all swscale formatswm42013-03-171-6/+6
| | | | There's no reason why there should be a separate vf_scale stage.
* vo_corevideo: use generic aspect ratio codewm42013-03-171-62/+38
| | | | | | | | | The rescaling is rather silly. vo_get_src_dst_rects() doesn't return an uncropped image, so the texture coordinates have to be recalculated, which looks more complicated, but is actually what the other OpenGL VOs also do. Tested and fixed by Stefano Pigozzi.
* vo_opengl_old: use generic aspect ratio codewm42013-03-171-45/+42
| | | | | Make sure scaled_osd still works. Although this is a completely worthless feature for a deprecated VO.
* vo_x11: use generic aspect ratio code, refactorwm42013-03-171-149/+77
| | | | | | | | | | | | | | Instead of manually calculating aspect ratio etc., use vo_get_src_dst_rects(). This has the advantage that we can drop some special cases in aspect.c later. Simplify the code, and move resizing the X images from draw_image() to a new resize() function. Do some other simplifications. The gXErrorFlag check was actually dead code, even in mplayer-svn. Special-casing on WinID is not needed anymore (we created an embedded window, and its size is updated by x11_common.c).
* cocoa_common: fix regression when changing videos in fullscreenStefano Pigozzi2013-03-151-3/+4
| | | | | | | | I introuced this regression in 8fc0b618d5. The backend would go into incosistent state caused by calling `vo_cocoa_fullscreen` where it wasn't needed. Fixes #44
* video: use new method to get QP tablewm42013-03-151-5/+9
| | | | | | | | | | | | | | | | | | | | This only matters for those who want to use vf_pp. The old API is marked as deprecated, and doesn't work on Libav. It was broken on FFmpeg, but has recently started working again - the fields in question were not un- deprecated though. Instead you're supposed to use a new API, which does exactly the same thing (what...?). Also don't pass the QP table with mp_image_copy_attributes() - it probably does more harm than it's useful. By the way, with -vf=dlopen=TOOLS/vf_dlopen/showqscale.so, it appears the table as output by recent FFmpeg is offset by 1 macroblock in X direction and 2 macroblocks in Y direction, which most likely will interfere with normal vf_pp operation. However, this is not my problem. The only real reason for this commit is that we can finally get rid of all libav* related deprecation warnings. (Though they are constantly deprecating APIs, so this will not last long.)
* video: make use of libavcodec refcountingwm42013-03-134-10/+106
| | | | Now lavc_dr1.c is not used anymore if libavcodec is recent enough.
* video: prepare for libavcodec refcountingwm42013-03-133-62/+84
| | | | | Some minor refactoring and moving code around. There should be no functional changes.
* Prefix CODEC_ID_ with AV_wm42013-03-131-6/+6
| | | | | | | | | The old names have been deprecated a while ago, but were needed for supporting older ffmpeg/libav versions. The deprecated identifiers have been removed from recent Libav and FFmpeg git. This change breaks compatibility with Libav 0.8.x and equivalent FFmpeg releases.
* image_writer: switch to avcodec_encode_video2()wm42013-03-131-14/+11
| | | | | | | | avcodec_encode_video() was deprecated, and was finally removed from Libav and FFmpeg git. This change breaks compatibility with Libav 0.8.x. Thank the Libav developers, not me.
* wayland: remove asserts from egl_create_contextAlexander Preisinger2013-03-131-17/+7
| | | | | Instead of assert return false on most check. Removes the redundant second inclusion of the assert header.
* wayland: simplify egl_create_windowAlexander Preisinger2013-03-131-13/+4
| | | | | | Removes the local ret because it was only in an assert statement and also removes the window size assignments, because they are already done in config_wnidow_wayland.
* wayland: use the cursor_autohide_delay optionAlexander Preisinger2013-03-111-6/+9
| | | | | In the previous implemention the backend always assumed 1 second instead of honoring the cursor_autohide_delay option
* wayland: move window by grabing itAlexander Preisinger2013-03-111-0/+8
| | | | | Because the are no server-side-decorations in the available wayland compositors use grabbing the surface to move it.
* vo_opengl: insert a magical glFlush callwm42013-03-111-0/+6
| | | | | Helps a little bit with stuttering with pans and "heavy" subtitles covering the screen.
* cocoa_common: fix window position when bigger than displayStefano Pigozzi2013-03-101-4/+4
| | | | | | | | | | Fix a regression introduced in commit 979ce46c64 causing a window to take up more space than what the display allows. Add keepCentered:YES, so that the video area is always clipped to the current visible frame (even when using scale). Fixes #38.
* vo_sdl: we don't want to minize the window when losing focusRudolf Polzer2013-03-061-0/+2
| | | | | Because: this makes multi-monitor use entirely useless (as soon as pointer leaves left screen, mpv gets auto minimized).
* options: remove --no-vsyncwm42013-03-063-9/+8
| | | | | | Latest nvidia drivers ignore the application setting, so this switch makes even less sense than before. It's still possible to control this with VO specific suboptions.
* w32_common: fix compilationwm42013-03-051-10/+10
| | | | Broken by commit 1198c03.
* vo: Separate vo options from MPOptsAlexander Preisinger2013-03-0414-204/+204
| | | | | | | Separate the video output options from the big MPOpts structure and also only pass the new mp_vo_opts structure to the vo backend. Move video_driver_list into mp_vo_opts
* cocoa_common: fix crashStefano Pigozzi2013-03-041-1/+5
|
* cocoa_common: fix compilationStefano Pigozzi2013-03-041-7/+7
| | | | 7686cd7f broke some stuff
* Remove vo_fps global variablewm42013-03-042-4/+0
| | | | | This is needed by the encode stuff for some reason, so we have to explicitly pass it. Functionality shouldn't change.
* wayland: remove unnecessary function pointersAlexander Preisinger2013-03-041-10/+1
| | | | Remove the usage of getdladdr as it only adds to code complexity
* vo: remove and cleanup globalsAlexander Preisinger2013-03-0416-267/+243
| | | | | | | | Removes almost every global variabel in vo.h and puts them in a special struct in MPOpts for video output related options. Also we completly remove the options/globals pts and refresh rate because they were unused.
* cocoa_common: make windows appear againStefano Pigozzi2013-03-031-17/+23
| | | | | | | | | Commit 9efe32120 stops recreating the hidden window used for OpenGL's extensions autodetection. The `cocoa_common` code assumed the hidden flag could only come when creating a window which is now not true anymore. Move some code around so that hidden, fullscreen and window position are respected on subsequent calls of config.
* gl_common: get rid of symbol redefinition warnings with recent Mesawm42013-03-033-0/+17
| | | | | | | | | | | | | Apparently newer Mesa versions changed their <GL/glx.h> header, and unconditionally define GLX_CONTEXT_MAJOR_VERSION_ARB and others. This clashed with gl_header_fixes.h, a header which quarantines bad hacks to make compilation possible on systems with outdated GL headers. Specifically, our header was included before glx.h, so the hacks were always active, and somehow Mesa's glx.h used to deal with this by not redefining existing identifiers. Fix the gl_header_fixes.h logic so the hacks are checked after including glx.h.
* x11_common: fix --cursor-autohide when pausedwm42013-03-033-27/+44
| | | | | | | | When paused, --cursor-autohide worked with a precision of 500ms, which is the main loop's default sleep time when paused. Cursor hiding is polled in x11_common, and the main loop never called the X11 code at the right time. Fix this by allowing the VO to set a time when it should be called next.
* vo_opengl: don't destroy VOFLAG_HIDDEN windowwm42013-03-034-35/+1
| | | | | | | This was done so because the X11 code had a hard to track down issue with some window managers, and caused the VO window to be placed incorrectly. This was fixed in the previous commit. Consequently, we can remove this bad hack.
* x11_common: fix window mapping, refactor window creation/resize handlingwm42013-03-032-136/+148
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | vo_opengl creates an invisible window with VOFLAG_HIDDEN in order to test whether the OpenGL context is useable. The visible window is created at a later point. This has been broken forever (in vo_gl, now called vo_opengl_old, it could be avoided by disabling auto- detection explicitly using the "yuv" sub-option). Avoiding VOFLAG_HIDDEN only mitigates the issue, and a related bug can still happen with some window managers (see below). As a hack, code was added to vo_gl to destroy the (hidden) window so that all state was destroyed. Later, more hacks were added to deal with some caveats that came with recreating the window, such as probing for the context up to 4 times. Attempt to fix the problem properly. There were two problems: first, the window was not resized to video size before mapping. This was the main cause for the placement issue, e.g. mapping the window as 320x200, and then resizing it. Second, mpv tried to force the window position with XSetWMNormalHints and PPosition with values it just read with XGetGeometry. This messes up the window manager's default placement. It seems to be a race condition, and behavior is different across various WMs too: with IceWM, the wind