1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-27 09:32:40 +00:00
mpv/video/out/win_state.h
Avi Halachmi (:avih) 2b1579b1c8 win_state: add vo_calc_window_geometry3
vo_calc_window_geometry2 (VCWG2) calculates both the pixelaspect and
the autofit sizes based on one "screen" rectangle.

However, these two calculations might need two different "screen"
rects if the fit should take into account decorations and/or taskbar
etc, while pixelaspect should be based on the full (monitor) rect.

VCWG3 does just that. It's the same as VCWG2, but with an additional
monitor rect which is used exclussively to calculate pixelaspect,
while the "screen" argument is used for fitting (like before).

VCWG2 now uses/calls VCWG3 with the same screen and monitor rects.

Currently yet unused.
2021-09-06 10:16:10 +03:00

36 lines
1.2 KiB
C

#ifndef MP_WIN_STATE_H_
#define MP_WIN_STATE_H_
#include "common/common.h"
struct vo;
enum {
// By user settings, the window manager's chosen window position should
// be overridden.
VO_WIN_FORCE_POS = (1 << 0),
};
struct vo_win_geometry {
// Bitfield of VO_WIN_* flags
int flags;
// Position & size of the window. In xinerama coordinates, i.e. they're
// relative to the virtual desktop encompassing all screens, not the
// current screen.
struct mp_rect win;
// Aspect ratio of the current monitor.
// (calculated from screen size and options.)
double monitor_par;
};
void vo_calc_window_geometry(struct vo *vo, const struct mp_rect *screen,
struct vo_win_geometry *out_geo);
void vo_calc_window_geometry2(struct vo *vo, const struct mp_rect *screen,
double dpi_scale, struct vo_win_geometry *out_geo);
void vo_calc_window_geometry3(struct vo *vo, const struct mp_rect *screen,
const struct mp_rect *monitor,
double dpi_scale, struct vo_win_geometry *out_geo);
void vo_apply_window_geometry(struct vo *vo, const struct vo_win_geometry *geo);
#endif