mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-08-27 04:37:41 +00:00
Select color range based on plane COLOR_RANGE property values
This commit is contained in:
@@ -2019,6 +2019,22 @@ int DrmRenderer::getDecoderColorspace()
|
|||||||
return COLORSPACE_REC_601;
|
return COLORSPACE_REC_601;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int DrmRenderer::getDecoderColorRange()
|
||||||
|
{
|
||||||
|
if (auto prop = m_VideoPlane.property("COLOR_RANGE")) {
|
||||||
|
// Prefer full range if the video plane supports it
|
||||||
|
if (prop->containsValue("YCbCr full range")) {
|
||||||
|
return COLOR_RANGE_FULL;
|
||||||
|
}
|
||||||
|
else if (prop->containsValue("YCbCr limited range")) {
|
||||||
|
return COLOR_RANGE_LIMITED;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Default to limited if we couldn't find a valid COLOR_RANGE property
|
||||||
|
return COLOR_RANGE_LIMITED;
|
||||||
|
}
|
||||||
|
|
||||||
const char* DrmRenderer::getDrmColorEncodingValue(AVFrame* frame)
|
const char* DrmRenderer::getDrmColorEncodingValue(AVFrame* frame)
|
||||||
{
|
{
|
||||||
switch (getFrameColorspace(frame)) {
|
switch (getFrameColorspace(frame)) {
|
||||||
|
|||||||
@@ -770,6 +770,7 @@ public:
|
|||||||
virtual bool testRenderFrame(AVFrame* frame) override;
|
virtual bool testRenderFrame(AVFrame* frame) override;
|
||||||
virtual bool isDirectRenderingSupported() override;
|
virtual bool isDirectRenderingSupported() override;
|
||||||
virtual int getDecoderColorspace() override;
|
virtual int getDecoderColorspace() override;
|
||||||
|
virtual int getDecoderColorRange() override;
|
||||||
virtual void setHdrMode(bool enabled) override;
|
virtual void setHdrMode(bool enabled) override;
|
||||||
virtual void notifyOverlayUpdated(Overlay::OverlayType type) override;
|
virtual void notifyOverlayUpdated(Overlay::OverlayType type) override;
|
||||||
#ifdef HAVE_EGL
|
#ifdef HAVE_EGL
|
||||||
|
|||||||
Reference in New Issue
Block a user