Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions video/out/wayland_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@ struct vo_wayland_preferred_description_info {
struct pl_color_space csp;
void *icc_file;
uint32_t icc_size;
float reference_luminance;
};

static bool single_output_spanned(struct vo_wayland_state *wl);
Expand Down Expand Up @@ -2195,6 +2196,10 @@ static void info_tf_named(void *data, struct wp_image_description_info_v1 *image
static void info_luminances(void *data, struct wp_image_description_info_v1 *image_description_info,
uint32_t min_lum, uint32_t max_lum, uint32_t reference_lum)
{
struct vo_wayland_preferred_description_info *wd = data;
if (!wd->is_parametric)
return;
wd->reference_luminance = (float)reference_lum;
}

static void info_target_primaries(void *data, struct wp_image_description_info_v1 *image_description_info,
Expand All @@ -2221,7 +2226,7 @@ static void info_target_luminance(void *data, struct wp_image_description_info_v
if (!wd->is_parametric)
return;
wd->csp.hdr.min_luma = (float)min_lum / WAYLAND_MIN_LUM_FACTOR;
wd->csp.hdr.max_luma = (float)max_lum;
wd->csp.hdr.max_luma = (float)max_lum * (203.0/wd->reference_luminance);
}

static void info_target_max_cll(void *data, struct wp_image_description_info_v1 *image_description_info,
Expand All @@ -2230,7 +2235,7 @@ static void info_target_max_cll(void *data, struct wp_image_description_info_v1
struct vo_wayland_preferred_description_info *wd = data;
if (!wd->is_parametric)
return;
wd->csp.hdr.max_cll = (float)max_cll;
wd->csp.hdr.max_cll = (float)max_cll * (203.0/wd->reference_luminance);
}

static void info_target_max_fall(void *data, struct wp_image_description_info_v1 *image_description_info,
Expand Down Expand Up @@ -4702,4 +4707,4 @@ void vo_wayland_wakeup(struct vo *vo)
{
struct vo_wayland_state *wl = vo->wl;
(void)write(wl->wakeup_pipe[1], &(char){0}, 1);
}
}
Loading