Skip to content

Commit

Permalink
updated SS4S
Browse files Browse the repository at this point in the history
requests less IDR frames
  • Loading branch information
mariotaku committed Apr 25, 2024
1 parent c2c0931 commit 4f5fb38
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/app/stream/session.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,12 +205,13 @@ void streaming_set_hdr(session_t *session, bool hdr) {
populate_hdr_info_vui(&info, &session->config.stream);
SS4S_PlayerVideoSetHDRInfo(session->player, &info);
} else {
// Magic numbers from Stadia
SS4S_VideoHDRInfo info = {
.displayPrimariesX = {34000, 13250, 7500},
.displayPrimariesY = {16000, 34500, 3000},
.whitePointX = 15635,
.whitePointY = 16450,
.maxDisplayMasteringLuminance = 1000 * LUMINANCE_SCALE,
.maxDisplayMasteringLuminance = 1000,
.minDisplayMasteringLuminance = 50,
.maxContentLightLevel = 1000,
.maxPicAverageLightLevel = 400,
Expand Down
12 changes: 8 additions & 4 deletions src/app/stream/video/session_video.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,13 @@ int vdec_delegate_setup(int videoFormat, int width, int height, int redrawRate,
}

switch (SS4S_PlayerVideoOpen(player, &info)) {
case SS4S_VIDEO_OPEN_ERROR:
return CALLBACKS_SESSION_ERROR_VDEC_ERROR;
case SS4S_VIDEO_OPEN_OK: {
return 0;
}
case SS4S_VIDEO_OPEN_UNSUPPORTED_CODEC:
return CALLBACKS_SESSION_ERROR_VDEC_UNSUPPORTED;
default:
return 0;
return CALLBACKS_SESSION_ERROR_VDEC_ERROR;
}
}

Expand Down Expand Up @@ -169,8 +170,11 @@ int vdec_delegate_submit(PDECODE_UNIT decodeUnit) {
} else if (result == SS4S_VIDEO_FEED_ERROR) {
session_interrupt(session, false, STREAMING_INTERRUPT_DECODER);
return DR_OK;
} else {
} else if (result == SS4S_VIDEO_FEED_REQUEST_KEYFRAME) {
return DR_NEED_IDR;
} else {
commons_log_debug("Session", "Ignoring frame %d, feed result %d", decodeUnit->frameNumber, result);
return DR_OK;
}
}

Expand Down

0 comments on commit 4f5fb38

Please sign in to comment.