mirror of
https://github.com/moonlight-stream/moonlight-common-c.git
synced 2025-07-03 16:26:13 +00:00
Add HDR and colorspace fields to DECODE_UNIT
This commit is contained in:
parent
02f12e4448
commit
c9426a6a71
@ -172,6 +172,18 @@ typedef struct _DECODE_UNIT {
|
||||
|
||||
// Head of the buffer chain (never NULL)
|
||||
PLENTRY bufferList;
|
||||
|
||||
// Determines if this frame is SDR or HDR
|
||||
//
|
||||
// Note: This is not currently parsed from the actual bitstream, so if your
|
||||
// client has access to a bitstream parser, prefer that over this field.
|
||||
bool hdrActive;
|
||||
|
||||
// Provides the colorspace of this frame (see COLORSPACE_* defines above)
|
||||
//
|
||||
// Note: This is not currently parsed from the actual bitstream, so if your
|
||||
// client has access to a bitstream parser, prefer that over this field.
|
||||
uint8_t colorspace;
|
||||
} DECODE_UNIT, *PDECODE_UNIT;
|
||||
|
||||
// Specifies that the audio stream should be encoded in stereo (default)
|
||||
|
@ -453,6 +453,13 @@ static void reassembleFrame(int frameNumber) {
|
||||
qdu->decodeUnit.presentationTimeMs = firstPacketPresentationTime;
|
||||
qdu->decodeUnit.enqueueTimeMs = LiGetMillis();
|
||||
|
||||
// These might be wrong for a few frames during a transition between SDR and HDR,
|
||||
// but the effects shouldn't very noticable since that's an infrequent operation.
|
||||
//
|
||||
// If we start sending this state in the frame header, we can make it 100% accurate.
|
||||
qdu->decodeUnit.hdrActive = LiGetCurrentHostDisplayHdrMode();
|
||||
qdu->decodeUnit.colorspace = (uint8_t)(qdu->decodeUnit.hdrActive ? COLORSPACE_REC_2020 : StreamConfig.colorSpace);
|
||||
|
||||
// IDR frames will have leading CSD buffers
|
||||
if (nalChainHead->bufferType != BUFFER_TYPE_PICDATA) {
|
||||
qdu->decodeUnit.frameType = FRAME_TYPE_IDR;
|
||||
|
Loading…
x
Reference in New Issue
Block a user