Add NV21 pixel format support to SDL renderer

This commit is contained in:
Cameron Gutman 2019-05-02 22:51:28 -07:00
parent e6a48481a5
commit 99d9de35de

View file

@ -9,7 +9,8 @@
const std::vector<int> 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;