Skip to content

Commit df40da2

Browse files
committed
wayland: assume all image description is parametric until icc_file event
If we used get_preferred_parametric to get this image description, then it is guaranteed to be parametric. If we used get_preferred to get this image description, then it may or may not be parametric depending on the compositor. If we receive an icc_file event, then the image description is not parametric.
1 parent e7b8b77 commit df40da2

File tree

1 file changed

+2
-17
lines changed

1 file changed

+2
-17
lines changed

video/out/wayland_common.c

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2179,8 +2179,7 @@ static void info_icc_file(void *data, struct wp_image_description_info_v1 *image
21792179
int32_t icc, uint32_t icc_size)
21802180
{
21812181
struct vo_wayland_preferred_description_info *wd = data;
2182-
if (wd->is_parametric)
2183-
return;
2182+
wd->is_parametric = false;
21842183

21852184
void *icc_file = mmap(NULL, icc_size, PROT_READ, MAP_PRIVATE, icc, 0);
21862185
close(icc);
@@ -2201,8 +2200,6 @@ static void info_primaries_named(void *data, struct wp_image_description_info_v1
22012200
uint32_t primaries)
22022201
{
22032202
struct vo_wayland_preferred_description_info *wd = data;
2204-
if (!wd->is_parametric)
2205-
return;
22062203
wd->csp.primaries = map_primaries(primaries);
22072204
}
22082205

@@ -2215,17 +2212,13 @@ static void info_tf_named(void *data, struct wp_image_description_info_v1 *image
22152212
uint32_t tf)
22162213
{
22172214
struct vo_wayland_preferred_description_info *wd = data;
2218-
if (!wd->is_parametric)
2219-
return;
22202215
wd->csp.transfer = map_tf(tf);
22212216
}
22222217

22232218
static void info_luminances(void *data, struct wp_image_description_info_v1 *image_description_info,
22242219
uint32_t min_lum, uint32_t max_lum, uint32_t reference_lum)
22252220
{
22262221
struct vo_wayland_preferred_description_info *wd = data;
2227-
if (!wd->is_parametric)
2228-
return;
22292222
wd->min_luma = min_lum / (float)WAYLAND_MIN_LUM_FACTOR;
22302223
wd->max_luma = max_lum;
22312224
wd->ref_luma = reference_lum;
@@ -2236,8 +2229,6 @@ static void info_target_primaries(void *data, struct wp_image_description_info_v
22362229
int32_t w_x, int32_t w_y)
22372230
{
22382231
struct vo_wayland_preferred_description_info *wd = data;
2239-
if (!wd->is_parametric)
2240-
return;
22412232
wd->csp.hdr.prim.red.x = (float)r_x / WAYLAND_COLOR_FACTOR;
22422233
wd->csp.hdr.prim.red.y = (float)r_y / WAYLAND_COLOR_FACTOR;
22432234
wd->csp.hdr.prim.green.x = (float)g_x / WAYLAND_COLOR_FACTOR;
@@ -2252,8 +2243,6 @@ static void info_target_luminance(void *data, struct wp_image_description_info_v
22522243
uint32_t min_lum, uint32_t max_lum)
22532244
{
22542245
struct vo_wayland_preferred_description_info *wd = data;
2255-
if (!wd->is_parametric)
2256-
return;
22572246
wd->csp.hdr.min_luma = (float)min_lum / WAYLAND_MIN_LUM_FACTOR;
22582247
wd->csp.hdr.max_luma = (float)max_lum;
22592248
}
@@ -2262,17 +2251,13 @@ static void info_target_max_cll(void *data, struct wp_image_description_info_v1
22622251
uint32_t max_cll)
22632252
{
22642253
struct vo_wayland_preferred_description_info *wd = data;
2265-
if (!wd->is_parametric)
2266-
return;
22672254
wd->csp.hdr.max_cll = (float)max_cll;
22682255
}
22692256

22702257
static void info_target_max_fall(void *data, struct wp_image_description_info_v1 *image_description_info,
22712258
uint32_t max_fall)
22722259
{
22732260
struct vo_wayland_preferred_description_info *wd = data;
2274-
if (!wd->is_parametric)
2275-
return;
22762261
wd->csp.hdr.max_fall = (float)max_fall;
22772262
}
22782263

@@ -3102,7 +3087,7 @@ static void get_compositor_preferred_description(struct vo_wayland_state *wl, bo
31023087
#if HAVE_WAYLAND_PROTOCOLS_1_41
31033088
struct vo_wayland_preferred_description_info *wd = talloc_zero(NULL, struct vo_wayland_preferred_description_info);
31043089
wd->wl = wl;
3105-
wd->is_parametric = parametric;
3090+
wd->is_parametric = true;
31063091

31073092
struct wp_image_description_v1 *image_description;
31083093
if (parametric) {

0 commit comments

Comments
 (0)