mp_image: add force_window field

It's useful for some VOs (dmabuf-wayland) to know if the image params
are actually real or fake ones sent by the core for the purpose of
force_window.
This commit is contained in:
Dudemanguy 2023-09-20 13:18:26 -05:00
parent d48e4eb1f6
commit 69b7af3106
3 changed files with 3 additions and 0 deletions

View File

@ -1034,6 +1034,7 @@ int handle_force_window(struct MPContext *mpctx, bool force)
.imgfmt = config_format,
.w = w, .h = h,
.p_w = 1, .p_h = 1,
.force_window = true,
};
if (vo_reconfig(vo, &p) < 0)
goto err;

View File

@ -835,6 +835,7 @@ bool mp_image_params_equal(const struct mp_image_params *p1,
p1->hw_subfmt == p2->hw_subfmt &&
p1->w == p2->w && p1->h == p2->h &&
p1->p_w == p2->p_w && p1->p_h == p2->p_h &&
p1->force_window == p2->force_window &&
mp_colorspace_equal(p1->color, p2->color) &&
p1->chroma_location == p2->chroma_location &&
p1->rotate == p2->rotate &&

View File

@ -46,6 +46,7 @@ struct mp_image_params {
enum mp_imgfmt hw_subfmt; // underlying format for some hwaccel pixfmts
int w, h; // image dimensions
int p_w, p_h; // define pixel aspect ratio (undefined: 0/0)
bool force_window; // fake image created by handle_force_window
struct mp_colorspace color;
enum mp_chroma_location chroma_location;
// The image should be rotated clockwise (0-359 degrees).