summaryrefslogtreecommitdiffstats
path: root/video/out/vo.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-04-20 21:36:56 +0200
committerwm4 <wm4@nowhere>2014-04-21 02:57:16 +0200
commitef2885e771d184ff39c688836a8f06595a6cdf86 (patch)
tree10d7beb187a504e75d46404493fb44750210620e /video/out/vo.c
parentcc00b3ff36692d42184d2b88cfabbef3151793d8 (diff)
downloadmpv-ef2885e771d184ff39c688836a8f06595a6cdf86.tar.bz2
mpv-ef2885e771d184ff39c688836a8f06595a6cdf86.tar.xz
vo: add some general support code for VOs that allow rotation
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.
Diffstat (limited to 'video/out/vo.c')
-rw-r--r--video/out/vo.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/video/out/vo.c b/video/out/vo.c
index 340817633d..9af1d59c6d 100644
--- a/video/out/vo.c
+++ b/video/out/vo.c
@@ -424,7 +424,11 @@ int vo_reconfig(struct vo *vo, struct mp_image_params *params, int flags)
int d_height = params->d_h;
if (vo_control(vo, VOCTRL_UPDATE_SCREENINFO, NULL) == VO_TRUE) {
- determine_window_geometry(vo, params->d_w, params->d_h);
+ int w = params->d_w, h = params->d_h;
+ if ((vo->driver->caps & VO_CAP_ROTATE90) &&
+ params->rotate % 180 == 90)
+ MPSWAP(int, w, h);
+ determine_window_geometry(vo, w, h);
d_width = vo->dwidth;
d_height = vo->dheight;
}
@@ -472,8 +476,9 @@ int lookup_keymap_table(const struct mp_keymap *map, int key) {
void vo_get_src_dst_rects(struct vo *vo, struct mp_rect *out_src,
struct mp_rect *out_dst, struct mp_osd_res *out_osd)
{
- mp_get_src_dst_rects(vo->log, vo->opts, vo->params, vo->dwidth, vo->dheight,
- vo->monitor_par, out_src, out_dst, out_osd);
+ mp_get_src_dst_rects(vo->log, vo->opts, vo->driver->caps, vo->params,
+ vo->dwidth, vo->dheight, vo->monitor_par,
+ out_src, out_dst, out_osd);
}
// Return the window title the VO should set. Always returns a null terminated