From 58e27875ae20f2da7e8dda91f5ff288a26503c1b Mon Sep 17 00:00:00 2001 From: Dylan Frankcom Date: Tue, 30 Apr 2024 21:31:00 -0400 Subject: [PATCH] Fix Raised Black Levels on Steam Deck OLED (#1265) Add getDecoderColorRange to plvk --- app/streaming/video/ffmpeg-renderers/plvk.cpp | 6 ++++++ app/streaming/video/ffmpeg-renderers/plvk.h | 1 + 2 files changed, 7 insertions(+) diff --git a/app/streaming/video/ffmpeg-renderers/plvk.cpp b/app/streaming/video/ffmpeg-renderers/plvk.cpp index 596e1c4c..8e95d0b0 100644 --- a/app/streaming/video/ffmpeg-renderers/plvk.cpp +++ b/app/streaming/video/ffmpeg-renderers/plvk.cpp @@ -905,6 +905,12 @@ int PlVkRenderer::getRendererAttributes() return attributes; } +int PlVkRenderer::getDecoderColorRange() +{ + // Explicitly set the color range to full to fix raised black levels on OLED displays + return COLOR_RANGE_FULL; +} + int PlVkRenderer::getDecoderCapabilities() { return CAPABILITY_REFERENCE_FRAME_INVALIDATION_HEVC | diff --git a/app/streaming/video/ffmpeg-renderers/plvk.h b/app/streaming/video/ffmpeg-renderers/plvk.h index 366c74c0..3596002e 100644 --- a/app/streaming/video/ffmpeg-renderers/plvk.h +++ b/app/streaming/video/ffmpeg-renderers/plvk.h @@ -23,6 +23,7 @@ public: virtual void notifyOverlayUpdated(Overlay::OverlayType) override; virtual bool notifyWindowChanged(PWINDOW_STATE_CHANGE_INFO) override; virtual int getRendererAttributes() override; + virtual int getDecoderColorRange() override; virtual int getDecoderCapabilities() override; virtual bool needsTestFrame() override; virtual bool isPixelFormatSupported(int videoFormat, enum AVPixelFormat pixelFormat) override;