Skip to content

Commit

Permalink
Merge pull request #417 from chocomega/fix-hdr-metadata
Browse files Browse the repository at this point in the history
Fix hdr metadata
  • Loading branch information
mariotaku authored Apr 22, 2024
2 parents d321dfa + b71cd0f commit ff1cd13
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 7 additions & 4 deletions src/app/stream/session.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
#include "session_worker.h"
#include "stream/input/session_virt_mouse.h"

// Expected luminance values in SEI are in units of 0.0001 cd/m2
#define LUMINANCE_SCALE 10000

int streaming_errno = GS_OK;
char streaming_errmsg[1024];

Expand Down Expand Up @@ -192,19 +195,19 @@ void streaming_set_hdr(session_t *session, bool hdr) {
},
.whitePointX = hdr_metadata.whitePoint.x,
.whitePointY = hdr_metadata.whitePoint.y,
.maxDisplayMasteringLuminance = hdr_metadata.maxDisplayLuminance,
.maxDisplayMasteringLuminance = hdr_metadata.maxDisplayLuminance * LUMINANCE_SCALE,
.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},
.displayPrimariesX = {34000, 13250, 7500},
.displayPrimariesY = {16000, 34500, 3000},
.whitePointX = 15635,
.whitePointY = 16450,
.maxDisplayMasteringLuminance = 1000,
.maxDisplayMasteringLuminance = 1000 * LUMINANCE_SCALE,
.minDisplayMasteringLuminance = 50,
.maxContentLightLevel = 1000,
.maxPicAverageLightLevel = 400,
Expand Down

0 comments on commit ff1cd13

Please sign in to comment.