From 84fc5f3008f1bd1e70c8cdf10c652bfe9f541b3c Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Fri, 14 Oct 2022 19:23:51 -0500 Subject: [PATCH] Use colorspace helper with VAAPI direct rendering --- app/streaming/video/ffmpeg-renderers/vaapi.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/app/streaming/video/ffmpeg-renderers/vaapi.cpp b/app/streaming/video/ffmpeg-renderers/vaapi.cpp index 34c42b8a..5ebfb717 100644 --- a/app/streaming/video/ffmpeg-renderers/vaapi.cpp +++ b/app/streaming/video/ffmpeg-renderers/vaapi.cpp @@ -632,19 +632,15 @@ VAAPIRenderer::renderFrame(AVFrame* frame) // NB: Not all VAAPI drivers respect these flags. Many drivers // just ignore them and do the color conversion as Rec 601. - switch (frame->colorspace) { - case AVCOL_SPC_BT709: + switch (getFrameColorspace(frame)) { + case COLORSPACE_REC_709: flags |= VA_SRC_BT709; break; - case AVCOL_SPC_BT470BG: - case AVCOL_SPC_SMPTE170M: + case COLORSPACE_REC_601: flags |= VA_SRC_BT601; break; - case AVCOL_SPC_SMPTE240M: - flags |= VA_SRC_SMPTE_240; - break; default: - // Unknown colorspace + // Unsupported colorspace SDL_assert(false); break; }