summaryrefslogtreecommitdiffstats
path: root/video
Commit message (Collapse)AuthorAgeFilesLines
* gl_common: remove compatibility aliases for backend sub-optionwm42013-02-261-6/+0
| | | | | | The backend sub-option for vo_opengl and vo_opengl-old accepted numeric values (like -1, 0, ...) for compatibility with MPlayer. This was added in mplayer2 times, and is not important anymore.
* img_format: add pixel format name for IMGFMT_MONO_Wwm42013-02-261-0/+1
| | | | This should have been in commit 90efe7c.
* vf_yadif: remove dead codewm42013-02-261-2/+0
| | | | Commit 2e1063d changed the option parsing, and args is always NULL now.
* Remove --rootwin option and rootwin propertywm42013-02-243-6/+0
| | | | | | | | You can just use --wid=0 if you really want this. This only worked/works for X11, and even then it might interact badly with most desktop environments. All the option did was setting --wid to 0, and the property did nothing.
* demux_mf: support .xbmwm42013-02-243-0/+3
| | | | | | | And support the PIX_FMT_MONOWHITE pixel format. (This is really weird: unlike PIX_FMT_MONOBLACK, it uses white pixels. I have no idea why libavcodec doesn't just convert the pixel format on the fly, instead of bothering everyone with really special pixel formats.)
* vo_caca: remove OSD supportwm42013-02-241-86/+1
| | | | | | Recent changes to the OSD code made vo_caca crash when showing OSD. Since this is a joke VO (== I'd rather not waste my time with it), remove the OSD support. It wasn't that great anyway.
* vo_direct3d: always clear window before drawing videowm42013-02-241-15/+2
| | | | | | | | | | | | | This fixes the issue that black borders (e.g. on fullscreen) are not redrawn, even if OSD rendering changes these areas. In theory, the code could try some clever things to determine whether clearing the window is really necessary, but that's probably not worth the trouble and won't bring any significant performance gain, or might even make things slower (because the GPU can't discard the old contents). Also fix redrawing when changing panscan with OSD disabled.
* vf_yadif: switch to option parser, allow disabling by defaultwm42013-02-231-7/+21
| | | | | | | | | Use the option parser instead of sscanf. Remove the parameter changing the field dominance (it has been marked deprecated for ages). Add a new suboption "enabled", which can be used to disable the filter by default, until it's enabled at runtime: mpv -vf yadif=enabled=no
* vf_scale: remove video dimension presets ("presize" suboption)wm42013-02-231-41/+0
| | | | | This wasn't really useful, and the option preset mechanism is awfully complex.
* vf_stereo3d: get rid of m_obj_presets_t usagewm42013-02-231-49/+3
| | | | The code becomes amazingly simpler.
* options: drop --opt:subopt option nameswm42013-02-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For all suboptions, "flat" options were available by separating the parent option and the sub option with ":", e.g. "--rawvideo:w=123". Drop this syntax and use "-" as separator. This means even suboptions are available as normal options now, e.g. "--rawvideo-w=123". The old syntax doesn't work anymore. Note that this is completely separate from actual suboptions. For example, "-rawvideo w=123:h=123" still works. (Not that this syntax is worth supporting, but it's needed anyway, for for other things like vf and vo suboptions.) As a consequence of this change, we also have to add new "no-" prefixed options for flag suboptions, so that "--no-input-default-bindings" works. ("--input-no-default-bindings" also works as a consequence of allowing "-input no-default-bindings" - they are handled by the same underlying option.) For --input, always use the full syntax in the manpage. There exist suboptions other than --input (like --tv, --rawvideo, etc.), but since they might be handled differently in the future, don't touch these yet. M_OPT_PREFIXED becomes the default, so remove it. As a minor unrelated cleanup, get rid of M_OPT_MERGE too and use the OPT_SUBSTRUCT() macro in some places. Unrelated: remove the duplicated --tv:buffersize option, fix a typo in changes.rst.
* core: add fs-screen option for fullscreen display selectionStefano Pigozzi2013-02-215-47/+77
| | | | | | | | | | | | `--fs-screen` allows to decide what display to go fullscreen into. The semantics of `--screen` changed and now it is only used to select the windowed display when starting the application. This is useful for people using mpv with an external TV. They will start windowed on their laptop's screen and switch to fullscreen on the TV. @wm4 worked on the x11 and w32 parts of the code. All is squashed in one commit for history clarity.
* core: move `xineramascreen` to `MPOpts` as `vo_screen_id`Stefano Pigozzi2013-02-215-14/+16
| | | | This is a small cleanup in preparation for the next commit.
* x11_common: uncrustifywm42013-02-212-390/+328
| | | | | | | | Also some other cosmetic changes. And reformat the two remaining doxygen comments. Removing MSGLEN in x11_errorhandler() is technically not just a cosmetic change, but the result is the same anyway.
* vd_lavc: fix software decoding fallbackwm42013-02-211-1/+1
| | | | | | The string is deallocated by the callee after initialization, so fallback at runtime passes a deallocated string to libavcodec, which results in random crashes. Regression introduced by commit 4d016a9.
* cocoa_common: fix crash with dead key input and simplify related codeStefano Pigozzi2013-02-191-9/+20
| | | | | | | | | Fixes #29. When a user used dead input keys (like the accent key), `mpv` crashed because the code tried to access the 0 element of a characters array (which was empty). While I was closing this bug, I refactored some related conditionals to make the code more readable.
* vo_xv: fix green border on the rightwm42013-02-141-0/+1
|
* dec_video: fix bogus assertwm42013-02-131-1/+1
| | | | Basically a typo. Made playing ordered chapters crash.
* Prefix keycode defines with MP_wm42013-02-126-182/+188
| | | | | | | | | | Do this to reduce conflicts with <linux/input.h>, which contains some conflicting defines. This changes the meaning of MP_KEY_DOWN: KEY_DOWN is renamed to MP_KEY_DOWN (cursor down key) MP_KEY_DOWN is renamed to MP_KEY_STATE_DOWN (modifier for key down state)
* demux_lavf, ad_lavc, vd_lavc: pass codec header data directlywm42013-02-101-6/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | Instead of putting codec header data into WAVEFORMATEX and BITMAPINFOHEADER, pass it directly via AVCodecContext. To do this, we add mp_copy_lav_codec_headers(), which copies the codec header data from one AVCodecContext to another (originally, the plan was to use avcodec_copy_context() for this, but it looks like this would turn decoder initialization into an even worse mess). Get rid of the silly CodecID <-> codec_tag mapping. This was originally needed for codecs.conf: codec tags were used to identify codecs, but libavformat didn't always return useful codec tags (different file formats can have different, overlapping tag numbers). Since we don't go through WAVEFORMATEX etc. and pass all header data directly via AVCodecContext, we can be absolutely sure that the codec tag mapping is not needed anymore. Note that this also destroys the "standard" MPlayer method of exporting codec header data. WAVEFORMATEX and BITMAPINFOHEADER made sure that other non-libavcodec decoders could be initialized. However, all these decoders have been removed, so this is just cruft full of old hacks that are not needed anymore. There's still ad_spdif and ad_mpg123, bu neither of these need codec header data. Should we ever add non-libavcodec decoders, better data structures without the past hacks could be added to export the headers.
* demux_lavf, ad_lavc, vd_lavc: refactor, cleanupwm42013-02-101-54/+61
| | | | | | | | | Rearrange some code to make it easier readable. Remove some dead code, and stop printing AVI headers in demux_lavf. (These are not actual AVI headers, just for internal use.) There should be no functional changes, other than reducing output in verbose mode.
* core: redo how codecs are mapped, remove codecs.confwm42013-02-108-241/+131
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use codec names instead of FourCCs to identify codecs. Rewrite how codecs are selected and initialized. Now each decoder exports a list of decoders (and the codec it supports) via add_decoders(). The order matters, and the first decoder for a given decoder is preferred over the other decoders. E.g. all ad_mpg123 decoders are preferred over ad_lavc, because it comes first in the mpcodecs_ad_drivers array. Likewise, decoders within ad_lavc that are enumerated first by libavcodec (using av_codec_next()) are preferred. (This is actually critical to select h264 software decoding by default instead of vdpau. libavcodec and ffmpeg/avconv use the same method to select decoders by default, so we hope this is sane.) The codec names follow libavcodec's codec names as defined by AVCodecDescriptor.name (see libavcodec/codec_desc.c). Some decoders have names different from the canonical codec name. The AVCodecDescriptor API is relatively new, so we need a compatibility layer for older libavcodec versions for codec names that are referenced internally, and which are different from the decoder name. (Add a configure check for that, because checking versions is getting way too messy.) demux/codec_tags.c is generated from the former codecs.conf (minus "special" decoders like vdpau, and excluding the mappings that are the same as the mappings libavformat's exported RIFF tables). It contains all the mappings from FourCCs to codec name. This is needed for demux_mkv, demux_mpg, demux_avi and demux_asf. demux_lavf will set the codec as determined by libavformat, while the other demuxers have to do this on their own, using the mp_set_audio/video_codec_from_tag() functions. Note that the sh_audio/video->format members don't uniquely identify the codec anymore, and sh->codec takes over this role. Replace the --ac/--vc/--afm/--vfm with new --vd/--ad options, which provide cover the functionality of the removed switched. Note: there's no CODECS_FLAG_FLIP flag anymore. This means some obscure container/video combinations (e.g. the sample Film_200_zygo_pro.mov) are played flipped. ffplay/avplay doesn't handle this properly either, so we don't care and blame ffmeg/libav instead.
* 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