From 69b7af3106a158e9fe4f985d19d57ea7ca51d046 Mon Sep 17 00:00:00 2001 From: Dudemanguy Date: Wed, 20 Sep 2023 13:18:26 -0500 Subject: [PATCH] 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. --- player/playloop.c | 1 + video/mp_image.c | 1 + video/mp_image.h | 1 + 3 files changed, 3 insertions(+) diff --git a/player/playloop.c b/player/playloop.c index dc74e6b849..e492e15724 100644 --- a/player/playloop.c +++ b/player/playloop.c @@ -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; diff --git a/video/mp_image.c b/video/mp_image.c index b12588e7c2..eb7daf7925 100644 --- a/video/mp_image.c +++ b/video/mp_image.c @@ -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 && diff --git a/video/mp_image.h b/video/mp_image.h index 5c4f7186e3..0408aab3df 100644 --- a/video/mp_image.h +++ b/video/mp_image.h @@ -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).