Skip to content
Merged
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
9 changes: 5 additions & 4 deletions video/out/wayland_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -2108,6 +2108,7 @@ static void image_description_failed(void *data, struct wp_image_description_v1
{
struct vo_wayland_state *wl = data;
MP_VERBOSE(wl, "Image description failed: %d, %s\n", cause, msg);
wp_color_management_surface_v1_unset_image_description(wl->color_surface);
wp_image_description_v1_destroy(image_description);
}

Expand Down Expand Up @@ -3450,24 +3451,23 @@ static void set_color_management(struct vo_wayland_state *wl)
if (!wl->color_surface)
return;

wp_color_management_surface_v1_unset_image_description(wl->color_surface);

struct pl_color_space color = wl->target_params.color;
int primaries = wl->primaries_map[color.primaries];
int transfer = wl->transfer_map[color.transfer];
if (!primaries)
MP_VERBOSE(wl, "Compositor does not support color primary: %s\n", m_opt_choice_str(pl_csp_prim_names, color.primaries));
if (!transfer)
MP_VERBOSE(wl, "Compositor does not support transfer function: %s\n", m_opt_choice_str(pl_csp_trc_names, color.transfer));
if (!primaries || !transfer)
if (!primaries || !transfer) {
wp_color_management_surface_v1_unset_image_description(wl->color_surface);
return;
}

struct wp_image_description_creator_params_v1 *image_creator_params =
wp_color_manager_v1_create_parametric_creator(wl->color_manager);
wp_image_description_creator_params_v1_set_primaries_named(image_creator_params, primaries);
wp_image_description_creator_params_v1_set_tf_named(image_creator_params, transfer);

pl_color_space_infer(&wl->target_params.color);
struct pl_hdr_metadata hdr = wl->target_params.color.hdr;
bool is_hdr = pl_color_transfer_is_hdr(color.transfer);
bool use_metadata = hdr_metadata_valid(&hdr);
Expand Down Expand Up @@ -4135,6 +4135,7 @@ void vo_wayland_handle_color(struct vo_wayland_state *wl)
if (!wl->vo->target_params)
return;
struct mp_image_params target_params = vo_get_target_params(wl->vo);
pl_color_space_infer(&target_params.color);
if (pl_color_space_equal(&target_params.color, &wl->target_params.color) &&
pl_color_repr_equal(&target_params.repr, &wl->target_params.repr) &&
target_params.chroma_location == wl->target_params.chroma_location)
Expand Down
Loading