mirror of
https://github.com/moonlight-stream/moonlight-qt
synced 2024-12-17 14:43:09 +00:00
Add a decoder/renderer callback to specify the desired color range
This commit is contained in:
parent
7a39daf179
commit
c55af7fff3
7 changed files with 20 additions and 2 deletions
|
@ -426,8 +426,7 @@ bool Session::populateDecoderProperties(SDL_Window* window)
|
|||
m_StreamConfig.colorRange);
|
||||
}
|
||||
else {
|
||||
// Limited is the default for GFE
|
||||
m_StreamConfig.colorRange = COLOR_RANGE_LIMITED;
|
||||
m_StreamConfig.colorRange = decoder->getDecoderColorRange();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -68,6 +68,7 @@ public:
|
|||
virtual bool isHdrSupported() = 0;
|
||||
virtual int getDecoderCapabilities() = 0;
|
||||
virtual int getDecoderColorspace() = 0;
|
||||
virtual int getDecoderColorRange() = 0;
|
||||
virtual QSize getDecoderMaxResolution() = 0;
|
||||
virtual int submitDecodeUnit(PDECODE_UNIT du) = 0;
|
||||
virtual void renderFrameOnMainThread() = 0;
|
||||
|
|
|
@ -158,6 +158,11 @@ public:
|
|||
return COLORSPACE_REC_601;
|
||||
}
|
||||
|
||||
virtual int getDecoderColorRange() {
|
||||
// Limited is the default
|
||||
return COLOR_RANGE_LIMITED;
|
||||
}
|
||||
|
||||
virtual int getFrameColorspace(const AVFrame* frame) {
|
||||
// Prefer the colorspace field on the AVFrame itself
|
||||
switch (frame->colorspace) {
|
||||
|
|
|
@ -92,6 +92,11 @@ int FFmpegVideoDecoder::getDecoderColorspace()
|
|||
return m_FrontendRenderer->getDecoderColorspace();
|
||||
}
|
||||
|
||||
int FFmpegVideoDecoder::getDecoderColorRange()
|
||||
{
|
||||
return m_FrontendRenderer->getDecoderColorRange();
|
||||
}
|
||||
|
||||
QSize FFmpegVideoDecoder::getDecoderMaxResolution()
|
||||
{
|
||||
if (m_BackendRenderer->getRendererAttributes() & RENDERER_ATTRIBUTE_1080P_MAX) {
|
||||
|
|
|
@ -21,6 +21,7 @@ public:
|
|||
virtual bool isHdrSupported() override;
|
||||
virtual int getDecoderCapabilities() override;
|
||||
virtual int getDecoderColorspace() override;
|
||||
virtual int getDecoderColorRange() override;
|
||||
virtual QSize getDecoderMaxResolution() override;
|
||||
virtual int submitDecodeUnit(PDECODE_UNIT du) override;
|
||||
virtual void renderFrameOnMainThread() override;
|
||||
|
|
|
@ -68,6 +68,12 @@ SLVideoDecoder::getDecoderColorspace()
|
|||
return COLORSPACE_REC_709;
|
||||
}
|
||||
|
||||
int
|
||||
SLVideoDecoder::getDecoderColorRange()
|
||||
{
|
||||
return COLOR_RANGE_LIMITED;
|
||||
}
|
||||
|
||||
QSize SLVideoDecoder::getDecoderMaxResolution()
|
||||
{
|
||||
return QSize(1920, 1080);
|
||||
|
|
|
@ -15,6 +15,7 @@ public:
|
|||
virtual bool isAlwaysFullScreen() override;
|
||||
virtual int getDecoderCapabilities() override;
|
||||
virtual int getDecoderColorspace() override;
|
||||
virtual int getDecoderColorRange() override;
|
||||
virtual QSize getDecoderMaxResolution() override;
|
||||
virtual int submitDecodeUnit(PDECODE_UNIT du) override;
|
||||
virtual void notifyOverlayUpdated(Overlay::OverlayType) override;
|
||||
|
|
Loading…
Reference in a new issue