From 99d9de35deb085a8f0e4da5bfcafb6dc44403398 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Thu, 2 May 2019 22:51:28 -0700 Subject: [PATCH] Add NV21 pixel format support to SDL renderer --- app/streaming/video/ffmpeg-renderers/sdlvid.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/streaming/video/ffmpeg-renderers/sdlvid.cpp b/app/streaming/video/ffmpeg-renderers/sdlvid.cpp index ce0ff967..682d826a 100644 --- a/app/streaming/video/ffmpeg-renderers/sdlvid.cpp +++ b/app/streaming/video/ffmpeg-renderers/sdlvid.cpp @@ -9,7 +9,8 @@ const std::vector SdlRenderer::k_SwFormats({ AV_PIX_FMT_YUV420P, - AV_PIX_FMT_NV12 + AV_PIX_FMT_NV12, + AV_PIX_FMT_NV21 }); SdlRenderer::SdlRenderer() @@ -285,6 +286,9 @@ void SdlRenderer::renderFrame(AVFrame* frame) case AV_PIX_FMT_NV12: sdlFormat = SDL_PIXELFORMAT_NV12; break; + case AV_PIX_FMT_NV21: + sdlFormat = SDL_PIXELFORMAT_NV21; + break; default: SDL_assert(false); goto Exit;