From fcb3f8dc2a45132fe1f0b562dd5ad9c5ee846ed4 Mon Sep 17 00:00:00 2001 From: Elia Zammuto Date: Tue, 12 Nov 2024 21:56:51 +0100 Subject: [PATCH 1/2] Started Intra Refresh Support --- src/Limelight.h | 4 ++++ src/SdpGenerator.c | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/src/Limelight.h b/src/Limelight.h index b2bb550..a85879a 100644 --- a/src/Limelight.h +++ b/src/Limelight.h @@ -277,6 +277,10 @@ typedef struct _DECODE_UNIT { // number of slices per frame. This capability is only valid on video renderers. #define CAPABILITY_SLICES_PER_FRAME(x) (((unsigned char)(x)) << 24) +// If set in the video renderer capabilities field, this flag specifies that the renderer +// needs to opt-in to intra refresh, some clients (like the Xbox client with NVEnc) needs it +#define CAPABILITY_INTRA_REFRESH 0x40 + // This callback is invoked to provide details about the video stream and allow configuration of the decoder. // Returns 0 on success, non-zero on failure. typedef int(*DecoderRendererSetup)(int videoFormat, int width, int height, int redrawRate, void* context, int drFlags); diff --git a/src/SdpGenerator.c b/src/SdpGenerator.c index a2f9789..1aedad3 100644 --- a/src/SdpGenerator.c +++ b/src/SdpGenerator.c @@ -309,6 +309,13 @@ static PSDP_OPTION getAttributesList(char*urlSafeAddr) { else { err |= addAttributeString(&optionHead, "x-ss-video[0].chromaSamplingType", "0"); } + + // Add intra-refresh if opted in + if (VideoCallbacks.capabilities & CAPABILITY_INTRA_REFRESH){ + err |= addAttributeString(&optionHead, "x-ss-video[0].intraRefresh", "1"); + } else { + err |= addAttributeString(&optionHead, "x-ss-video[0].intraRefresh", "0"); + } } snprintf(payloadStr, sizeof(payloadStr), "%d", StreamConfig.width); From a56638e86c9197f3e626f2beefad079b11df79f3 Mon Sep 17 00:00:00 2001 From: TheElixZammuto Date: Mon, 23 Dec 2024 16:09:06 +0100 Subject: [PATCH 2/2] Changed value of bitmask --- src/Limelight.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Limelight.h b/src/Limelight.h index a85879a..4745ae2 100644 --- a/src/Limelight.h +++ b/src/Limelight.h @@ -279,7 +279,7 @@ typedef struct _DECODE_UNIT { // If set in the video renderer capabilities field, this flag specifies that the renderer // needs to opt-in to intra refresh, some clients (like the Xbox client with NVEnc) needs it -#define CAPABILITY_INTRA_REFRESH 0x40 +#define CAPABILITY_INTRA_REFRESH 0x80 // This callback is invoked to provide details about the video stream and allow configuration of the decoder. // Returns 0 on success, non-zero on failure.