From 4dffac3c781707c60e46bd4176731af8c97928c3 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Tue, 2 Feb 2021 19:40:06 -0600 Subject: [PATCH] Ask for NV12 buffers for DRMRenderer --- app/streaming/video/ffmpeg-renderers/drm.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/streaming/video/ffmpeg-renderers/drm.cpp b/app/streaming/video/ffmpeg-renderers/drm.cpp index d01e0769..7608b8d0 100644 --- a/app/streaming/video/ffmpeg-renderers/drm.cpp +++ b/app/streaming/video/ffmpeg-renderers/drm.cpp @@ -48,8 +48,12 @@ DrmRenderer::~DrmRenderer() } } -bool DrmRenderer::prepareDecoderContext(AVCodecContext* context, AVDictionary**) +bool DrmRenderer::prepareDecoderContext(AVCodecContext* context, AVDictionary** options) { + // The out-of-tree LibreELEC patches use this option to control the type of the V4L2 + // buffers that we get back. We only support NV12 buffers now. + av_dict_set_int(options, "pixel_format", AV_PIX_FMT_NV12, 0); + context->hw_device_ctx = av_buffer_ref(m_HwContext); SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION,