mirror of
https://github.com/moonlight-stream/moonlight-common-c.git
synced 2026-06-16 22:00:55 +00:00
Add color space and color range options
This commit is contained in:
@@ -18,6 +18,16 @@ extern "C" {
|
|||||||
#define STREAM_CFG_REMOTE 1
|
#define STREAM_CFG_REMOTE 1
|
||||||
#define STREAM_CFG_AUTO 2
|
#define STREAM_CFG_AUTO 2
|
||||||
|
|
||||||
|
// Values for the 'colorSpace' field below.
|
||||||
|
// Rec. 2020 is only supported with HEVC video streams.
|
||||||
|
#define COLORSPACE_REC_601 0
|
||||||
|
#define COLORSPACE_REC_709 1
|
||||||
|
#define COLORSPACE_REC_2020 2
|
||||||
|
|
||||||
|
// Values for the 'colorRange' field below
|
||||||
|
#define COLOR_RANGE_LIMITED 0
|
||||||
|
#define COLOR_RANGE_FULL 1
|
||||||
|
|
||||||
typedef struct _STREAM_CONFIGURATION {
|
typedef struct _STREAM_CONFIGURATION {
|
||||||
// Dimensions in pixels of the desired video stream
|
// Dimensions in pixels of the desired video stream
|
||||||
int width;
|
int width;
|
||||||
@@ -68,6 +78,14 @@ typedef struct _STREAM_CONFIGURATION {
|
|||||||
// of GFE for enhanced frame pacing.
|
// of GFE for enhanced frame pacing.
|
||||||
int clientRefreshRateX100;
|
int clientRefreshRateX100;
|
||||||
|
|
||||||
|
// If specified, sets the encoder colorspace to the provided COLORSPACE_*
|
||||||
|
// option (listed above). If not set, the encoder will default to Rec 601.
|
||||||
|
int colorSpace;
|
||||||
|
|
||||||
|
// If specified, sets the encoder color range to the provided COLOR_RANGE_*
|
||||||
|
// option (listed above). If not set, the encoder will default to Limited.
|
||||||
|
int colorRange;
|
||||||
|
|
||||||
// AES encryption data for the remote input stream. This must be
|
// AES encryption data for the remote input stream. This must be
|
||||||
// the same as what was passed as rikey and rikeyid
|
// the same as what was passed as rikey and rikeyid
|
||||||
// in /launch and /resume requests.
|
// in /launch and /resume requests.
|
||||||
|
|||||||
@@ -393,6 +393,11 @@ static PSDP_OPTION getAttributesList(char*urlSafeAddr) {
|
|||||||
AudioPacketDuration = 5;
|
AudioPacketDuration = 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (AppVersionQuad[0] >= 7) {
|
||||||
|
sprintf(payloadStr, "%d", (StreamConfig.colorSpace << 1) | StreamConfig.colorRange);
|
||||||
|
err |= addAttributeString(&optionHead, "x-nv-video[0].encoderCscMode", payloadStr);
|
||||||
|
}
|
||||||
|
|
||||||
if (err == 0) {
|
if (err == 0) {
|
||||||
return optionHead;
|
return optionHead;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user