From 277acef69cafbda40b8421a41b66180d9bcf90fd Mon Sep 17 00:00:00 2001 From: Iwan Timmer Date: Sun, 16 Aug 2015 15:52:32 +0200 Subject: [PATCH] Place slicing behind a flag as not all video decoders support it. --- limelight-common/Limelight.h | 4 ++++ limelight-common/SdpGenerator.c | 6 ++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/limelight-common/Limelight.h b/limelight-common/Limelight.h index c96ba85..dde10f9 100644 --- a/limelight-common/Limelight.h +++ b/limelight-common/Limelight.h @@ -62,6 +62,10 @@ typedef struct _DECODE_UNIT { // supports reference frame invalidation. This flag is only valid on video renderers. #define CAPABILITY_REFERENCE_FRAME_INVALIDATION 0x2 +// If set in the video renderer capabilities field, this flag specifies that the renderer +// supports slicing to increase decoding performance. This flag is only valid on video renderers. +#define CAPABILITY_SLICING 0x4 + // This callback is invoked to provide details about the video stream and allow configuration of the decoder typedef void(*DecoderRendererSetup)(int width, int height, int redrawRate, void* context, int drFlags); diff --git a/limelight-common/SdpGenerator.c b/limelight-common/SdpGenerator.c index 8a16bbb..2958441 100644 --- a/limelight-common/SdpGenerator.c +++ b/limelight-common/SdpGenerator.c @@ -139,8 +139,10 @@ static int addGen4Options(PSDP_OPTION *head, char* addrStr) { err |= addAttributeString(head, "x-nv-video[0].rateControlMode", "4"); - // Use slicing for increased performance on some decoders - err |= addAttributeString(head, "x-nv-video[0].videoEncoderSlicesPerFrame", "4"); + if (VideoCallbacks.capabilities & CAPABILITY_SLICING) { + // Use slicing for increased performance on some decoders + err |= addAttributeString(head, "x-nv-video[0].videoEncoderSlicesPerFrame", "4"); + } return err; }