diff options
author | Niklas Haas <git@haasn.dev> | 2022-01-06 08:39:51 +0100 |
---|---|---|
committer | Niklas Haas <github-daiK1o@haasn.dev> | 2022-01-09 13:06:27 +0100 |
commit | e3b835de7c91b8fcdd42652d25f7bafae979fc55 (patch) | |
tree | 508e06225087b51e6ce2f3a299b391e304328c65 | |
parent | 05ccc51d53424a771ece5bb818713d474d7874ce (diff) | |
download | mpv-e3b835de7c91b8fcdd42652d25f7bafae979fc55.tar.bz2 mpv-e3b835de7c91b8fcdd42652d25f7bafae979fc55.tar.xz |
vo_gpu_next: forward dovi metadata to libplacebo
-rw-r--r-- | video/out/vo_gpu_next.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/video/out/vo_gpu_next.c b/video/out/vo_gpu_next.c index 9bbb58101f..98c673eb57 100644 --- a/video/out/vo_gpu_next.c +++ b/video/out/vo_gpu_next.c @@ -508,6 +508,23 @@ static bool map_frame(pl_gpu gpu, pl_tex *tex, const struct pl_source_frame *src pl_chroma_location_offset(chroma, &plane->shift_x, &plane->shift_y); } +#ifdef PL_HAVE_LAV_DOLBY_VISION + if (mpi->dovi) { + const AVDOVIMetadata *metadata = (AVDOVIMetadata *) mpi->dovi->data; + struct pl_dovi_metadata *dovi = talloc_ptrtype(mpi, dovi); + const AVDOVIColorMetadata *color = av_dovi_get_color(metadata); + pl_map_dovi_metadata(dovi, metadata); + frame->repr.dovi = dovi; + frame->repr.sys = PL_COLOR_SYSTEM_DOLBYVISION; + frame->color.primaries = PL_COLOR_PRIM_BT_2020; + frame->color.transfer = PL_COLOR_TRC_PQ; + frame->color.hdr.min_luma = + pl_hdr_rescale(PL_HDR_PQ, PL_HDR_NITS, color->source_min_pq / 4095.0f); + frame->color.hdr.max_luma = + pl_hdr_rescale(PL_HDR_PQ, PL_HDR_NITS, color->source_max_pq / 4095.0f); + } +#endif + // Compute a unique signature for any attached ICC profile. Wasteful in // theory if the ICC profile is the same for multiple frames, but in // practice ICC profiles are overwhelmingly going to be attached to |