diff --git a/src/app/stream/session.c b/src/app/stream/session.c index 9a873d357..cbe8bce07 100644 --- a/src/app/stream/session.c +++ b/src/app/stream/session.c @@ -142,7 +142,31 @@ void streaming_enter_overlay(session_t *session, int x, int y, int w, int h) { } void streaming_set_hdr(session_t *session, bool hdr) { - if (hdr) { + commons_log_info("Session", "HDR is %s", hdr ? "enabled" : "disabled"); + SS_HDR_METADATA hdr_metadata; + if (!hdr) { + SS4S_PlayerVideoSetHDRInfo(session->player, NULL); + } else if (LiGetHdrMetadata(&hdr_metadata)) { + SS4S_VideoHDRInfo info = { + .displayPrimariesX = { + hdr_metadata.displayPrimaries[0].x, + hdr_metadata.displayPrimaries[1].x, + hdr_metadata.displayPrimaries[2].x + }, + .displayPrimariesY = { + hdr_metadata.displayPrimaries[0].y, + hdr_metadata.displayPrimaries[1].y, + hdr_metadata.displayPrimaries[2].y + }, + .whitePointX = hdr_metadata.whitePoint.x, + .whitePointY = hdr_metadata.whitePoint.y, + .maxDisplayMasteringLuminance = hdr_metadata.maxDisplayLuminance, + .minDisplayMasteringLuminance = hdr_metadata.minDisplayLuminance, + .maxContentLightLevel = hdr_metadata.maxContentLightLevel, + .maxPicAverageLightLevel = hdr_metadata.maxFrameAverageLightLevel, + }; + SS4S_PlayerVideoSetHDRInfo(session->player, &info); + } else { SS4S_VideoHDRInfo info = { .displayPrimariesX = {13250, 7500, 34000}, .displayPrimariesY = {34500, 3000, 16000}, @@ -154,8 +178,6 @@ void streaming_set_hdr(session_t *session, bool hdr) { .maxPicAverageLightLevel = 400, }; SS4S_PlayerVideoSetHDRInfo(session->player, &info); - } else { - SS4S_PlayerVideoSetHDRInfo(session->player, NULL); } } diff --git a/third_party/ss4s b/third_party/ss4s index 7acc95276..2037404d3 160000 --- a/third_party/ss4s +++ b/third_party/ss4s @@ -1 +1 @@ -Subproject commit 7acc95276840e3d1b7b598b2a271018a26170f27 +Subproject commit 2037404d37c4c296082f5db394aca3fca8f77314