mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-06-17 14:11:33 +00:00
Plumb HDR mode information to the decoders
This commit is contained in:
@@ -28,6 +28,23 @@ typedef struct _VIDEO_STATS {
|
||||
uint32_t measurementStartTimestamp;
|
||||
} VIDEO_STATS, *PVIDEO_STATS;
|
||||
|
||||
typedef struct _HDR_MASTERING_METADATA {
|
||||
uint8_t eotf;
|
||||
uint8_t staticMetadataDescriptorId;
|
||||
struct {
|
||||
uint16_t x;
|
||||
uint16_t y;
|
||||
} displayPrimaries[3];
|
||||
struct {
|
||||
uint16_t x;
|
||||
uint16_t y;
|
||||
} whitePoint;
|
||||
uint16_t maxDisplayMasteringLuminance;
|
||||
uint16_t minDisplayMasteringLuminance;
|
||||
uint16_t maxContentLightLevel;
|
||||
uint16_t maxFrameAverageLightLevel;
|
||||
} HDR_MASTERING_METADATA, *PHDR_MASTERING_METADATA;
|
||||
|
||||
typedef struct _DECODER_PARAMETERS {
|
||||
SDL_Window* window;
|
||||
StreamingPreferences::VideoDecoderSelection vds;
|
||||
@@ -38,6 +55,7 @@ typedef struct _DECODER_PARAMETERS {
|
||||
int frameRate;
|
||||
bool enableVsync;
|
||||
bool enableFramePacing;
|
||||
HDR_MASTERING_METADATA hdrMetadata;
|
||||
} DECODER_PARAMETERS, *PDECODER_PARAMETERS;
|
||||
|
||||
class IVideoDecoder {
|
||||
@@ -51,4 +69,5 @@ public:
|
||||
virtual QSize getDecoderMaxResolution() = 0;
|
||||
virtual int submitDecodeUnit(PDECODE_UNIT du) = 0;
|
||||
virtual void renderFrameOnMainThread() = 0;
|
||||
virtual void setHdrMode(bool enabled) = 0;
|
||||
};
|
||||
|
||||
@@ -150,6 +150,10 @@ public:
|
||||
return getPreferredPixelFormat(videoFormat) == pixelFormat;
|
||||
}
|
||||
|
||||
virtual void setHdrMode(bool) {
|
||||
// Nothing
|
||||
}
|
||||
|
||||
// IOverlayRenderer
|
||||
virtual void notifyOverlayUpdated(Overlay::OverlayType) override {
|
||||
// Nothing
|
||||
|
||||
@@ -57,6 +57,11 @@ bool FFmpegVideoDecoder::isAlwaysFullScreen()
|
||||
return m_FrontendRenderer->getRendererAttributes() & RENDERER_ATTRIBUTE_FULLSCREEN_ONLY;
|
||||
}
|
||||
|
||||
void FFmpegVideoDecoder::setHdrMode(bool enabled)
|
||||
{
|
||||
m_FrontendRenderer->setHdrMode(enabled);
|
||||
}
|
||||
|
||||
int FFmpegVideoDecoder::getDecoderCapabilities()
|
||||
{
|
||||
int capabilities = m_BackendRenderer->getDecoderCapabilities();
|
||||
|
||||
@@ -23,6 +23,7 @@ public:
|
||||
virtual QSize getDecoderMaxResolution() override;
|
||||
virtual int submitDecodeUnit(PDECODE_UNIT du) override;
|
||||
virtual void renderFrameOnMainThread() override;
|
||||
virtual void setHdrMode(bool enabled) override;
|
||||
|
||||
virtual IFFmpegRenderer* getBackendRenderer();
|
||||
|
||||
|
||||
@@ -20,6 +20,9 @@ public:
|
||||
// Unused since rendering is done directly from the decode thread
|
||||
virtual void renderFrameOnMainThread() {}
|
||||
|
||||
// HDR is not supported by SLVideo
|
||||
virtual void setHdrMode(bool) {}
|
||||
|
||||
private:
|
||||
static void slLogCallback(void* context, ESLVideoLog logLevel, const char* message);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user