summaryrefslogtreecommitdiffstats
path: root/video/out/aspect.c
Commit message (Collapse)AuthorAgeFilesLines
* aspect: change license to LGPLwm42017-06-171-7/+7
| | | | | | | | | | | | | | | Quite chaotic history, which code being moved, refactored, duplicated, unified a bunch of times. But I think everything is covered by LGPL agreements. In one case, cehoyos (who didn't agree) applied a patch by someone who agreed, but didn't change anything (except weirdly adding German translations). In another case, cehoyos moved code covered by LGPL agreements (without changing it), which was later used for some other code. We consider both cases not relevant for copyright. win_state.c/.h is similar, but pending for reply by the author of 2ab259e68 (I guess).
* aspect: use nominal width instead of actual width for video-unscaledNiklas Haas2016-09-221-3/+3
| | | | | | | | The documentation claims that --video-unscaled will still perform anamorphic adjustments, and it rightfully should. The current reality is that it does not, because the video-unscaled size was based on the wrong set of variables. (encoded width/height instead of nominal display width/height)
* aspect: add --video-unscaled=downscale-bigrr-2016-08-191-3/+7
|
* aspect: rework --video-unscaledNiklas Haas2016-04-101-22/+12
| | | | | | | | | | | | | | | | | | | In the past, --video-unscaled also disabled zooming and aspect ratio corrections. But this didn't make much sense in terms of being a useful option. The new behavior just sets the initial video size to be unscaled, but it's still affected by zoom commands and aspect ratio corrections. To get the old behavior back, --video-aspect=0 --video-zoom=0 need to be added as well (in the general case). Most of the time it should not make a difference though. Also, there seems to have been some additional dst_rect clamping code inside src_dst_split_scaling that didn't seem to either be necessary nor ever get triggered. (The code immediately above it already makes sure to crop the video if it's larger than the dst_rect) No idea why it was there, but I just removed it.
* aspect: remove useless debug messageswm42016-04-101-10/+2
| | | | Never needed them. This makes the code slightly more readable.
* aspect: make video-zoom logarithmicNiklas Haas2016-04-031-1/+2
| | | | | | | | | | | | | The past behavior was a bit weird, especially when zooming out. There was no simple way to zoom in or out in consistent increments using keybindings alone. The new behavior preserves most of the old behavior's semantics but scales out to infinity better. It coincidentally also makes it really easy to get clean power of 2 ratios (e.g. 2x, 4x, 8x and their inverses). Fixes #3004.
* video: switch from using display aspect to sample aspectwm42015-12-191-4/+4
| | | | | | | | | | | | | | | | MPlayer traditionally always used the display aspect ratio, e.g. 16:9, while FFmpeg uses the sample (aka pixel) aspect ratio. Both have a bunch of advantages and disadvantages. Actually, it seems using sample aspect ratio is generally nicer. The main reason for the change is making mpv closer to how FFmpeg works in order to make life easier. It's also nice that everything uses integer fractions instead of floats now (except --video-aspect option/property). Note that there is at least 1 user-visible change: vf_dsize now does not set the display size, only the display aspect ratio. This is because the image_params d_w/d_h fields did not just set the display aspect, but also the size (except in encoding mode).
* video: fix panscan in vertical casewm42015-06-291-3/+8
| | | | | If the black bars appeared on the left/right borders, panscan=1 didn't make the video cover the whole screen.
* video: do not align source position to 2wm42015-05-211-6/+2
| | | | | vo_direct3d still seems to require this (tested on Windows 8.1 with Intel graphics). Do it in vo_direct3d instead of messing with all VOs.
* Update license headersMarcin Kurczewski2015-04-131-5/+4
| | | | Signed-off-by: wm4 <wm4@nowhere>
* vo: add some general support code for VOs that allow rotationwm42014-04-211-8/+15
| | | | | | For rotation, we assume that the source image will be rotated within the VO, so the aspect/panscan code needs to calculate its param using rotated coordinates. VOs which support rotation natively can use this.
* aspect: remove a small ffmpeg dependencywm42014-01-221-4/+2
| | | | | Not strictly needed, but probably saves us pain the next time ffmpeg mess up their headers.
* vo: merge get rid of vo.aspdat fieldwm42014-01-221-81/+56
| | | | | | | | | | | | Rename vo_get_src_dst_rects() to mp_get_src_dst_rects() and make it independent from the VO (it takes a comical amount of parameters now to pass all required state). Add a convenience wrapper with the name vo_get_src_dst_rects() to vo.c. Replace all aspdat and vo usages with immediate parameters. Functionally, nothing should change, except that the window size is clamped to a minimum of size 1 much earlier, and some log messages change the prefix (don't bother with vo.vo_log stuff).
* vo: move vo_get_src_dst_rects to aspect.cwm42014-01-221-0/+130
| | | | | | | The plan is to make all the code in aspect.c independent from vo.c, which should make the code easier to understand, will allow removal of vo->aspdat, and reduces the amount of code that accesses weird mutable struct vo fields.
* video/out: simplify monitor aspect handlingwm42014-01-111-23/+2
| | | | | | | | For some reason, this made all VO backends both set the screen resolution in opts->screenwidth/height, and call aspect_save_screenres(). Remove the latter. Move the code to calculate the PAR-corrected window size from aspect.c to vo.c, and make it so that the monitor PAR is recalculated when it makes sense.
* video/out: remove fallback handling for screensize/monitor pixel aspectwm42014-01-111-7/+1
| | | | | | | When using --monitoraspect, but either the screen width or height or both are unknown, a fallback is applied. This is a completely useless obscure corner case that's going to help nobody, so get it out of the way.
* Split mpvcore/ into common/, misc/, bstr/wm42013-12-171-1/+1
|
* Move options/config related files from mpvcore/ to options/wm42013-12-171-1/+1
| | | | | | | | | Since m_option.h and options.h are extremely often included, a lot of files have to be changed. Moving path.c/h to options/ is a bit questionable, but since this is mainly about access to config files (which are also handled in options/), it's probably ok.
* aspect: mp_msg conversionwm42013-09-121-6/+5
|
* options: remove --panscanrange optionwm42013-08-191-8/+3
| | | | | | This option allowed you to extend the range of the panscan controls, so that you could essentially use it to scale the video. This will be replaced by a separate option to set the zoom factor directly.
* core: move contents to mpvcore (2/2)Stefano Pigozzi2013-08-061-2/+2
| | | | Followup commit. Fixes all the files references.
* vo: remove aspdat.asp memberwm42013-07-181-2/+1
| | | | | | This was bad, because it was the only aspdat member updated by vo_get_src_dst_rects() instead of vo_reconfig(). Now it isn't accessed anymore, so remove it.
* video: deal with 0x0 window sizewm42013-03-191-2/+4
| | | | If this happens, don't set a NaN aspect ratio.
* 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: 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: simplify aspect calculation stuffwm42013-03-171-63/+28
| | | | | | | 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: Separate vo options from MPOptsAlexander Preisinger2013-03-041-11/+11
| | | | | | | 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
* vo: remove and cleanup globalsAlexander Preisinger2013-03-041-9/+9
| | | | | | | | 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.
* options: move -geometry parsing to m_option.cwm42013-01-231-2/+1
| | | | | | | | | 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.
* Rename directories, move files (step 2 of 2)wm42012-11-121-4/+4
| | | | | | | | | | | | Finish renaming directories and moving files. Adjust all include statements to make the previous commit compile. The two commits are separate, because git is bad at tracking renames and content changes at the same time. Also take this as an opportunity to remove the separation between "common" and "mplayer" sources in the Makefile. ("common" used to be shared between mplayer and mencoder.)
* Rename directories, move files (step 1 of 2) (does not compile)wm42012-11-121-0/+148
Tis drops the silly lib prefixes, and attempts to organize the tree in a more logical way. Make the top-level directory less cluttered as well. Renames the following directories: libaf -> audio/filter libao2 -> audio/out libvo -> video/out libmpdemux -> demux Split libmpcodecs: vf* -> video/filter vd*, dec_video.* -> video/decode mp_image*, img_format*, ... -> video/ ad*, dec_audio.* -> audio/decode libaf/format.* is moved to audio/ - this is similar to how mp_image.* is located in video/. Move most top-level .c/.h files to core. (talloc.c/.h is left on top- level, because it's external.) Park some of the more annoying files in compat/. Some of these are relicts from the time mplayer used ffmpeg internals. sub/ is not split, because it's too much of a mess (subtitle code is mixed with OSD display and rendering). Maybe the organization of core is not ideal: it mixes playback core (like mplayer.c) and utility helpers (like bstr.c/h). Should the need arise, the playback core will be moved somewhere else, while core contains all helper and common code.