diff options
author | wm4 <wm4@nowhere> | 2012-10-27 22:10:32 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2012-11-01 02:07:46 +0100 |
commit | 6f408d0d9d6d0655faec75474bc3074812b41826 (patch) | |
tree | 973ef09419d166790c4d909eb2bd90d8709278ab /libvo/video_out.h | |
parent | 3466057febaf5790b3ce88db1726058d9852f28d (diff) | |
download | mpv-6f408d0d9d6d0655faec75474bc3074812b41826.tar.bz2 mpv-6f408d0d9d6d0655faec75474bc3074812b41826.tar.xz |
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.
Diffstat (limited to 'libvo/video_out.h')
-rw-r--r-- | libvo/video_out.h | 13 |
1 files changed, 6 insertions, 7 deletions
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; |