From 6f408d0d9d6d0655faec75474bc3074812b41826 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 27 Oct 2012 22:10:32 +0200 Subject: VO: remove code duplication for setting up mp_osd_res vo_opengl, vo_vdpau, vo_direct3d had the code for setting up mp_osd_res duplicated. Make things simpler by making calc_src_dst_rects() setup the full mp_osd_res structure, instead of just "borders". Also, rename that function to vo_get_src_dst_rects(), and make it use mp_rect. Remove vo_rect, which was annoying because it contains redundant members (width/height additional to right/bottom). Add code to print the video rect etc. in verbose mode. There should be no actual change how the video rects are calculated. The only exception are the bottom/right subtitle margins, which are now computed slightly differently, but that shouldn't matter. --- libvo/video_out.h | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'libvo/video_out.h') diff --git a/libvo/video_out.h b/libvo/video_out.h index 5c8e10a008..4ea4144ffc 100644 --- a/libvo/video_out.h +++ b/libvo/video_out.h @@ -257,7 +257,7 @@ struct vo { int event_fd; // check_events() should be called when this has input int registered_fd; // set to event_fd when registered in input system - // requested position/resolution + // requested position/resolution (usually window position/window size) int dx; int dy; int dwidth; @@ -338,14 +338,13 @@ struct mp_keymap { int to; }; int lookup_keymap_table(const struct mp_keymap *map, int key); -struct vo_rect { - int left, right, top, bottom, width, height; -}; -void calc_src_dst_rects(struct vo *vo, int src_width, int src_height, - struct vo_rect *src, struct vo_rect *dst, - struct vo_rect *borders, const struct vo_rect *crop); + void vo_mouse_movement(struct vo *vo, int posx, int posy); +struct mp_osd_res; +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); + static inline int aspect_scaling(void) { return vo_keepaspect || vo_fs; -- cgit v1.2.3