Skip to content

Commit b71cd0f

Browse files
committed
Fix HDR metadata
1 parent f18548f commit b71cd0f

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/app/stream/session.c

+7-4
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
#include "session_worker.h"
1919
#include "stream/input/session_virt_mouse.h"
2020

21+
// Expected luminance values in SEI are in units of 0.0001 cd/m2
22+
#define LUMINANCE_SCALE 10000
23+
2124
int streaming_errno = GS_OK;
2225
char streaming_errmsg[1024];
2326

@@ -192,19 +195,19 @@ void streaming_set_hdr(session_t *session, bool hdr) {
192195
},
193196
.whitePointX = hdr_metadata.whitePoint.x,
194197
.whitePointY = hdr_metadata.whitePoint.y,
195-
.maxDisplayMasteringLuminance = hdr_metadata.maxDisplayLuminance,
198+
.maxDisplayMasteringLuminance = hdr_metadata.maxDisplayLuminance * LUMINANCE_SCALE,
196199
.minDisplayMasteringLuminance = hdr_metadata.minDisplayLuminance,
197200
.maxContentLightLevel = hdr_metadata.maxContentLightLevel,
198201
.maxPicAverageLightLevel = hdr_metadata.maxFrameAverageLightLevel,
199202
};
200203
SS4S_PlayerVideoSetHDRInfo(session->player, &info);
201204
} else {
202205
SS4S_VideoHDRInfo info = {
203-
.displayPrimariesX = {13250, 7500, 34000},
204-
.displayPrimariesY = {34500, 3000, 16000},
206+
.displayPrimariesX = {34000, 13250, 7500},
207+
.displayPrimariesY = {16000, 34500, 3000},
205208
.whitePointX = 15635,
206209
.whitePointY = 16450,
207-
.maxDisplayMasteringLuminance = 1000,
210+
.maxDisplayMasteringLuminance = 1000 * LUMINANCE_SCALE,
208211
.minDisplayMasteringLuminance = 50,
209212
.maxContentLightLevel = 1000,
210213
.maxPicAverageLightLevel = 400,

0 commit comments

Comments
 (0)