summaryrefslogtreecommitdiffstats
path: root/video
Commit message (Collapse)AuthorAgeFilesLines
* cleanup: replace OPT_FLAG_ON and OPT_MAKE_FLAGS with OPT_FLAGwm42013-02-094-7/+7
| | | | | | | | | | OPT_MAKE_FLAGS() used to emit two options (one with "no" prefixed), but that has been long removed by special casing flag options in the option parser. OPT_FLAG_ON() used to imply that there's no "no-" prefixed option, but this hasn't been the case for a while either. (Conceptually, it has been replaced by OPT_FLAG_STORE().) Remove OPT_FLAG_OFF, which was unused.
* options: change handling of "no-" optionswm42013-02-091-1/+0
| | | | | | | | | | | | | | | | Normally, all flag options can be negated by prepending a "no-", for example "--no-opt" becomes "--opt=no". Some flag options can't actually be negated, so add a CONF_TYPE_STORE option type to disallow the "no-" fallback. Do the same for choice options. Remove the explicit "no-" prefixed options, add "no" as choice. Move the handling of automatic "no-" options from parser-mpcmd.c to m_config.c, and use it in m_config_set_option/m_config_parse_option. This makes these options available in the config file. It also simplifies sub-option parsing, because it doesn't need to handle "no-" anymore.
* audio/out, video/out: hide encoding VO/AOwm42013-02-063-4/+12
| | | | | | mpv -ao help and mpv -vo help shouldn't show the encoding outputs (named "lavc" on both cases). Also make it impossible to select these manually when not encoding.
* video/out: change autoprobe orderwm42013-02-061-16/+12
| | | | | | | | | | Basically, move vo_opengl above the other VOs (except vo_vdpau). This changes preferences on Windows and Linux. Move vo_opengl_old further down and make it the last fallback (before vo_x11). vo_caca is crap (no pun intended), and should never be autoprobed.
* vf_stereo3d: add support for green-magenta and yellow-blue duboiscehoyos2013-02-031-1/+11
| | | | | | | | | | | | | | Add more vf_stereo3d output formats. Adds high quality green-magenta and yellow-blue dubois anaglyph 3D output support. Patch by thomas schorpp, thomas.schorpp gmail git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35906 b3059339-0415-0410-9bf9-f77b7e298cf2 Conflicts: video/filter/vf_stereo3d.c
* vf_dlopen: fix external pixel format nameswm42013-02-031-7/+35
| | | | | "yv12" stopped working a while ago, and so did other FourCC-like names. Make "yv12" work again, so that the examples in TOOLS/vf_dlopen/ work.
* cocoa_common: fix `--ontop` behaviour when windowedStefano Pigozzi2013-02-031-4/+4
| | | | | | | | | | Apply setLevel hacks for fullscreen switching with ontop active only in fullscreen. This keeps the window correctly on top even when losing focus. Fixes #21 I also reverted NSScreenSaverWindowLevel to NSNormalWindowLevel + 1, so that the cmd-tab UI is visible
* cocoa_common: fix focus with --ontop and space switchingStefano Pigozzi2013-02-031-4/+5
| | | | | | | | | | | | | | | The main problem this commit addresses is when you switched spaced back and forth with `--ontop` active the video window didn't recive focus again. Turns out that setting a normal window level just before conceding focus to other apps / spaces fixes the problem. I think Cocoa is misbehaving here, and should probably file a radar. I found 3 related improvements while fixing this: * fullscreen_window_level is a dead body from an older implementation. * Use NSScreenSaverWindowLevel for ontop. This should be a really high window level. Definitely higher than NSNormalWindowLevel + 1. * The window level was set correctly only when out of fullscreen.
* cocoa_common: make the resize window menu items use video sizeStefano Pigozzi2013-02-031-10/+5
| | | | | | | Make the window resizing menu items calculate the new window size based on the video size and not the current window size. This only makes a difference when using `--autofit`.
* cocoa_events: remove this functionalityStefano Pigozzi2013-02-021-0/+1
| | | | | | | | | | | | | This functionality looked smart but created problems with some kinds of multi touch events. Moreover some events coming from the windows server – like hovering a corner for window resize – didn't cause the player to wake up immediately. The "correct" non hacky way to implement async event polling with cocoa would be having the vanilla cocoa event loop driving the player and setting up mpv's terminal FDs as event sources for the cocoa event loop. Fixes #20
* build: make it work on somewhat older ffmpeg versionswm42013-01-311-1/+1
| | | | | | Tested with n0.10.4. All these version checks are rather tricky, because Libav and FFmpeg change the same thing at slightly different versions.
* screenshot: minor simplification, prefer VF over VOwm42013-01-302-13/+0
| | | | | | | | | | | | | Remove screenshot_force and associated logic. Always try to use the screenshot video filter before trying taking screenshots with the VO, which means that --vf=screenshot now takes the role of --vf=screenshot_force. (To make this clear, not adding a video filter is still the recommended way to take screenshots; we just change how VF screenshots are forced.) Preferring VO over VF and having --vf=screenshot_force used to make sense when not all VOs supported screenshots, and some VOs had somewhat broken screenshots (like vo_xv taking screenshots with OSD in it). But all these issues are fixed now, so just get rid of the cruft.
* osx_common: cache OSX version numberStefano Pigozzi2013-01-272-37/+34
| | | | | | | | | | This commit makes `is_osx_version_at_least` cache the result of reading `/System/Library/CoreServices/SystemVersion.plist`. Since that is a file read operation it was bad to use this function frequently (i.e.: when processing user events). Remove `is_lion_or_above` (introduced in c9396c0a) as that was a more specialized wrapper which had the only advantage of adding it's own cache.
* vo_x11: fix redrawing on expose eventswm42013-01-271-9/+2
| | | | This part wasn't converted when changing to the new OSD redrawing way.
* x11: simplify handling of X Visuals and Colormaps in VOswm42013-01-276-101/+71
| | | | | | | | | | | | | | | | | Don't force VOs to pick an arbitrary default Visual and Colormap. They still can override them if needed. This simplifies the X11 VO interface. Always create a Colormap for simplicity. Using CopyFromParent fails if the selected visual is not the same of that of the parent window, which happens for me with vo_opengl. vo_vdpau and vo_xv explicitly set CWBorderPixel, do that in x11_common instead (it was already done for native windows, but not for slave mode windows). What gl_common did was incorrect in theory: freeing a colormap while a window uses it will change the colormap of the window to "None", and the color mapping for such windows is "undefined".
* x11: fix some obvious video mode switching bugswm42013-01-272-20/+31
| | | | | | | | | | | | | | | The original video mode wasn't reliably restored, so just store the mode separately. For some reason, window decorations got into the picture, possibly due to an incorrect initial window position or something like this. Normally, the window is positioned and sized such that it covers the screen entirely, even though the window still has decorations and is not in fullscreen mode (fullscreen wouldn't be correct, because the virtual desktop size is not screen size). Hack-fix by forcing window decorations off when VM-switching. All in all, VM switching is still buggy and useless.
* x11: reduce VO mode switching code duplicationwm42013-01-275-85/+35
| | | | | | | | | | | | | | Some parts for initiating mode switches were duplicated in every VO supporting X11 (except vo_opengl/gl_common, which didn't support mode switching). Move this to x11_common.c. Note that this might be slightly risky: is it really guaranteed that no VO needed to do "special" setup that depends on X parameters changing after a mode switch, such as bit depth, visuals etc.? From what I can see, this shouldn't be the case (X probably can't even change depth on the fly). Even if this should be a one-way road, VM switching is in general very useless, and its implementation buggy, so it can just be removed should unfixable problems arise.
* x11_common: do not set custom error handler when calling XSelectInputwm42013-01-271-47/+21
| | | | | | | | | | | | | Do this because we want to remove the global variables required with the old code. In particular, there doesn't seem any way to set a secure user data pointer with xlib. XSelectInput() causes a BadAccess error when some of the requested event flags are reserved (for exclusive flags like ButtonPress). The custom error handler caught this and set a global variable, so that the code could retry the XSelectInput() call without the conflicting flags. Use a different approach that doesn't need a custom error handler. (Although we still assume that the error handler doesn't terminate the program.)
* x11: cleanup, refactorwm42013-01-276-968/+774
| | | | | | | | | | | | | | | | Move things that are used by vo_xv only into vo_xv, same for vo_x11. Rename some functions exported by x11_common, like vo_init to vo_x11_common. Make functions not used outsode of x11_common.c private to that file. Eliminate all global variables defined by x11_common (except error handler and colormap stuff). There shouldn't be any functional changes, and only code is moved around. There are some minor simplifications in the X11 init code, as we completely remove the ability to initialize X11 and X11+VO separately (see commit b4d9647 "mplayer: do not create X11 state in player frontend"), and the respective functions are conflated into vo_x11_init() and vo_x11_uninit().
* vf_scale: fix warningwm42013-01-271-1/+0
|
* sws_utils: use libswscale for GBRP output if availablewm42013-01-271-1/+1
| | | | libswscale added support for this recently.
* vo_opengl: always ditherWessel Dankers2013-01-271-25/+12
| | | | | | | | | | | | Dithering was disabled if the input bit depth was not larger than the output bit depth of the screen framebuffer. But since scaling, RGB conversion, and other filters change the number of significant bits anyway, dithering could still benefit image quality even in these cases. Always do dithering, unless dithering is completely disabled. The original intention of this mechanism was not to change the image needlessly when playing video that matches the native bit depth of the screen.
* vd_lavc: add stupid hack to fix decoding of some files with Libav 0.8.xwm42013-01-241-5/+8
| | | | | | | | | | The decoder returns with AVFrame.format not correctly set for some h264 files (strangely only some). We have to access AVCodecContext.pix_fmt instead. On newer libavcodec versions, it's the other way around: the AVCodecContext.pix_fmt may be incorrectly set on pixel format changes, and you are supposed to use AVFrame.format. The same problem probably exists on older ffmpeg versions too.
* vo_xv: always try to use native bit depthwm42013-01-231-5/+2
| | | | | | Exactly the same issue as with the previous commit. Just like the vdpau code, this was apparently copy-pasted from the vo_x11 code, even though it doesn't make much sense.
* vo_vdpau: always try to native bit depth (makes 30 bit work)wm42013-01-231-5/+2
| | | | | | | | | | | | | Using vdpau on an X server configured to a bit depth of 30 (10 bit per component) failed finding a visual. The cause was a hack that tried to normalize the bit depth to 24 if it was not a known depth. It's unknown why/if this is needed, but the following things speak against it: - it prevented unusual bit depths like 30 bit from working - it wasn't needed with normal bit depth like 24 bit - it's probably copy-pasted from vo_x11 (where this code possibly makes sense, unlike in vo_vdpau) Just remove this code and look for a visual with native depth.
* video: remove -x/-y/-xy optionswm42013-01-231-32/+0
| | | | | | | | | | | | | | | -x/-y were rather useless and obscure. The only use I can see is forcing a specific aspect ratio without having to calculate the aspect ratio float value (although --aspect takes values of the form w:h). This can be also done with --geometry and --no-keepaspect. There was also a comment that -x/-y is useful for -vm, although I don't see how this is useful as it still messes up aspect ratio. -xy is mostly obsolete. It does two things: a) set the window width to a pixel value, b) scale the window size by a factor. a) is already done by --autofit (--autofit=num does exactly the same thing as --xy=num, if num >= 8). b) is not all that useful, so we just drop that functionality.
* video: add --autofit and --autofit-larger optionswm42013-01-231-2/+33
| | | | | | | | | --autofit=WxH sets the window size to a maximum width and/or height, without changing the window's aspect ratio. --autofit-larger=WxH does the same, but only if the video size is actually larger than the window size that would result when using the --autofit=WxH option with the same arguments.
* options: move -geometry parsing to m_option.cwm42013-01-238-159/+11
| | | | | | | | | This also means the option is verified on program start, not when the VO is created. The actual code becomes a bit more complex, because the screen width/height is not available at program start. The actual parsing code is still the same, with its unusual sscanf() usage.
* video: move handling of -x/-y/-xy options to VOwm42013-01-2311-88/+94
| | | | | | | | | Now the calculations of the final display size are done after the filter chain. This makes the difference between display aspect ratio and window size a bit more clear, especially in the -xy case. With an empty filter chain, the behavior of the options should be the same, except that they don't affect vo_image and vo_lavc anymore.
* cocoa_common: improved trackpad scrollingMad Fish2013-01-201-5/+45
|
* cocoa_common: handle all pending events instead of just oneMad Fish2013-01-201-19/+24
|
* video: reset filters on seekwm42013-01-204-0/+31
| | | | | | | | | | | | | | | | Drop queued frames on seek. Reset the internal state of some filters that seem to need it as well: at least vf_divtc still produced some frames using the previous PTS. This fixes weird behavior with some filters on seeking. In particular, this could lead to A/V desync or apparent lockups due to the PTS of filtered frames being too far away from audio PTS. This commit does only the minimally required work to fix these PTS related issues. Some filters have state dependent on previously filtered frames, and these are not automatically reset with this commit (even vf_divtc and vf_softpulldown reset the PTS info only). Filters that actually require a full reset can implement VFCTRL_SEEK_RESET.
* vf_format: fix forcing output formatwm42013-01-171-1/+11
| | | | | This failed with an assert, because the format of the format of the output image was not set correctly.
* options: also accept ffmpeg pixel format nameswm42013-01-172-6/+20
| | | | | | | | | | | | Options that take pixel format names now also accept ffmpeg names. mpv internal names are preferred. We leave this undocumented intentionally, and may be removed once libswscale stops printing ffmpeg pixel format names to the terminal (or if we stop passing the SWS_PRINT_INFO flag to it, which makes it print these). (We insist on keeping the mpv specific names instead of dropping them in favor of ffmpeg's name due to NIH, and also because ffmpeg always appends the endian suffixes "le" and "be".)
* osxbundle: cocoa_common: change playlist on fileopen eventsStefano Pigozzi2013-01-163-0/+42
| | | | | | | When opening new files in Finder when `mpv` is running from an application bundle, the new files will now replace the current playlist. Fixes #14
* Silence two compiler warningswm42013-01-161-1/+0
| | | | Both should be harmless.
* vo_opengl_old: add missing include statementwm42013-01-151-0/+1
| | | | | | <ctype.h> is needed at least for isalnum(). Most time this worked, because some ffmpeg or Libav versions recursively include this header from libavutil/common.h. Fix it so it always works.
* vo_sdl: I think the XVidmode hack is no longer neededRudolf Polzer2013-01-151-5/+0
| | | | I can no longer reproduce the XVidmode related hang.
* vo_sdl: request "desktop" fullscreen mode if -vm is not usedRudolf Polzer2013-01-151-8/+7
| | | | | This is a lot cleaner than our current workaround that first queries the desktop resolution.
* vo_corevideo: make compile with recent changesStefano Pigozzi2013-01-151-1/+1
| | | | Width and height were removed from mp_image. Use w and h instead.
* video: print filter chain in verbose modewm42013-01-143-10/+42
| | | | | Somewhat useful to see where filters are auto-inserted and which formats they take.
* img_format: do not mark hwaccel formats as planar yuv formatswm42013-01-141-7/+8
|
* gl_common: move things used by vo_opengl_old.c only to vo_opengl_old.cwm42013-01-133-1244/+1241
| | | | Having this in gl_common is confusing.
* vd_lavc: remove -lavdopts vstats suboptionwm42013-01-132-97/+0
| | | | | | This printed per-frame statistics into a file, like bitrate or frame type. Not very useful and accesses obscure AVCodecContext fields (danger of deprecation/breakage), so get rid of it.
* vd_lavc: remove lowres decodingwm42013-01-131-11/+2
| | | | | | | | | | This was a "broken misfeature" according to Libav developers. It wasn't implemented for modern codecs (like h264), and has been removed from Libav a while ago (the AVCodecContext field has been marked as deprecated and its value is ignored). FFmpeg still supports it, but isn't much useful due to aforementioned reasons. Remove the code to enable it.
* vo_x11: use two buffers like XvRudolf Polzer2013-01-131-71/+94
|
* vo_x11, vo_xv: XShmCompletion event supportRudolf Polzer2013-01-134-16/+73
| | | | This fixes OSD flicker with vo_xv at high frame rates.
* vo_direct3d: remove 2ch hack for 10 bit playbackwm42013-01-133-261/+5
| | | | | | | | | | | This was an awkward hack that attempted to avoid the use of 16 bit textures, while still allowing rendering 10-16 bit YUV formats. The idea was that even if the hardware doesn't support 16 bit textures, an A8L8 textures could be used to convert 10 bit (etc.) to 8 bit in the shader, instead of doing this on the CPU. This was an experiment, disabled by default, and was (probably) rarely used. I've never heard of this being used successfully. Remove it.
* vo_sdl: avoid copying just for taking screenshotswm42013-01-131-5/+3
| | | | Use reference counting instead.
* vd_lavc: prefer AVFrame over AVCodecContext fieldswm42013-01-131-18/+17
| | | | | | This is more correct. Not all frame specific fields are in AVFrame, such as colorspace and color_range, and these are still queried through the decoder context.
* mp_image: remove mp_image.bppwm42013-01-135-12/+5
| | | | | | | | This field contained the "average" bit depth per pixel. It serves no purpose anymore. Remove it. Only vo_opengl_old still uses this in order to allocate a buffer that is shared between all planes.
* imgfmt: add more ffmpeg pixel formatswm42013-01-133-2/+136
| | | | | | Most of these probably don't have much actual use, but at least allow images of these formats to be handed to swscale, should any decoder output them.
* img_format: change meaning of MP_IMGFLAG_PLANARwm42013-01-132-2/+2
| | | | | | | | | | | | | This used to mean that there is more than one plane. This is not very useful: IMGFMT_Y8 was not considered planar, but it's just a Y plane, and could be treated the same as actual planar formats. On the other hand, IMGFMT_NV12 is partially packed, and usually requires special handling, but was considered planar. Change its meaning. Now the flag is set if the format has a separate plane for each component. IMGFMT_Y8 is now planar, IMGFMT_NV12 is not. As an odd special case, IMGFMT_MONO (1 bit per pixel) is like a planar RGB format with a single plane.
* vf_sub: allow more formats, simplify codewm42013-01-131-82/+15
| | | | | | | | | In theory, vf_sub could take any format supported by swscale. But to be sure that it's reasonably fast, only 420P was allowed. However, other similar 8 bit planar formats will be just as fast and there's no reason to exclude them. Even for completely different formats there doesn't seem to be any significant advantage to force vf_sub to convert to a simpler/more common format.
* vf_expand: support more image formatswm42013-01-134-109/+88
| | | | | | | | | | | This did random things with some image formats, including 10 bit formats. Fixes the mp_image_clear() function too. This still has some caveats: - doesn't clear alpha to opaque (too hard with packed RGB, and is rarely needed) - sets luma to 0 for mpeg-range YUV, instead of the lowest possible value (e.g. 16 for 8 bit)
* vf_rotate: support more image formatswm42013-01-131-34/+25
|
* vf_softpulldown: reject unsupported image formats, fix code duplicationwm42013-01-131-47/+24
| | | | Not really tested.
* vf_yadif: Y8 is not supportedwm42013-01-131-1/+0
| | | | Crashes.
* vf_swapuv: support more image formatswm42013-01-131-12/+8
|
* vf_pullup: remove check for MP_IMGFLAG_PLANARwm42013-01-131-4/+0
| | | | It supports 420p only, so the check is useless.
* vf_phase: reject unsupported image formatswm42013-01-131-21/+20