From c8182dfab3a82459c573d6bc79d77843143d1f2d Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Tue, 5 Sep 2023 19:28:22 -0500 Subject: [PATCH] Use BT.709 for DrmRenderer --- app/streaming/video/ffmpeg-renderers/drm.cpp | 8 ++++++++ app/streaming/video/ffmpeg-renderers/drm.h | 1 + 2 files changed, 9 insertions(+) diff --git a/app/streaming/video/ffmpeg-renderers/drm.cpp b/app/streaming/video/ffmpeg-renderers/drm.cpp index 40a01dd4..6c382262 100644 --- a/app/streaming/video/ffmpeg-renderers/drm.cpp +++ b/app/streaming/video/ffmpeg-renderers/drm.cpp @@ -1064,6 +1064,14 @@ bool DrmRenderer::isDirectRenderingSupported() return m_SupportsDirectRendering; } +int DrmRenderer::getDecoderColorspace() +{ + // Some DRM implementations (VisionFive) don't support BT.601 color encoding, + // so let's default to BT.709, which all drivers that support COLOR_ENCODING + // seem to support. + return COLORSPACE_REC_709; +} + const char* DrmRenderer::getDrmColorEncodingValue(AVFrame* frame) { switch (getFrameColorspace(frame)) { diff --git a/app/streaming/video/ffmpeg-renderers/drm.h b/app/streaming/video/ffmpeg-renderers/drm.h index 086437fc..2cd58c8e 100644 --- a/app/streaming/video/ffmpeg-renderers/drm.h +++ b/app/streaming/video/ffmpeg-renderers/drm.h @@ -55,6 +55,7 @@ public: virtual bool needsTestFrame() override; virtual bool testRenderFrame(AVFrame* frame) override; virtual bool isDirectRenderingSupported() override; + virtual int getDecoderColorspace() override; virtual void setHdrMode(bool enabled) override; #ifdef HAVE_EGL virtual bool canExportEGL() override;