diff --git a/app/streaming/video/ffmpeg-renderers/vdpau.cpp b/app/streaming/video/ffmpeg-renderers/vdpau.cpp index bdbd2b49..b77dbee0 100644 --- a/app/streaming/video/ffmpeg-renderers/vdpau.cpp +++ b/app/streaming/video/ffmpeg-renderers/vdpau.cpp @@ -12,11 +12,16 @@ #define GET_PROC_ADDRESS(id, func) status = vdpauCtx->get_proc_address(m_Device, id, (void**)func); \ BAIL_ON_FAIL(status, id) -const VdpRGBAFormat VDPAURenderer::k_OutputFormats[] = { +const VdpRGBAFormat VDPAURenderer::k_OutputFormats8Bit[] = { VDP_RGBA_FORMAT_B8G8R8A8, VDP_RGBA_FORMAT_R8G8B8A8 }; +const VdpRGBAFormat VDPAURenderer::k_OutputFormats10Bit[] = { + VDP_RGBA_FORMAT_B10G10R10A2, + VDP_RGBA_FORMAT_R10G10B10A2 +}; + VDPAURenderer::VDPAURenderer() : m_HwContext(nullptr), m_PresentationQueueTarget(0), @@ -143,7 +148,11 @@ bool VDPAURenderer::initialize(PDECODER_PARAMETERS params) for (int i = 0; i < OUTPUT_SURFACE_FORMAT_COUNT; i++) { VdpBool supported; uint32_t maxWidth, maxHeight; - status = m_VdpOutputSurfaceQueryCapabilities(m_Device, k_OutputFormats[i], + VdpRGBAFormat candidateFormat = + params->videoFormat == VIDEO_FORMAT_H265_MAIN10 ? + k_OutputFormats10Bit[i] : k_OutputFormats8Bit[i]; + + status = m_VdpOutputSurfaceQueryCapabilities(m_Device, candidateFormat, &supported, &maxWidth, &maxHeight); if (status != VDP_STATUS_OK) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, @@ -154,7 +163,7 @@ bool VDPAURenderer::initialize(PDECODER_PARAMETERS params) if (supported) { if (m_DisplayWidth <= maxWidth && m_DisplayHeight <= maxHeight) { - m_OutputSurfaceFormat = k_OutputFormats[i]; + m_OutputSurfaceFormat = candidateFormat; foundFormat = true; break; } diff --git a/app/streaming/video/ffmpeg-renderers/vdpau.h b/app/streaming/video/ffmpeg-renderers/vdpau.h index 1e7a874f..9913143c 100644 --- a/app/streaming/video/ffmpeg-renderers/vdpau.h +++ b/app/streaming/video/ffmpeg-renderers/vdpau.h @@ -33,7 +33,8 @@ private: int m_NextSurfaceIndex; #define OUTPUT_SURFACE_FORMAT_COUNT 2 - static const VdpRGBAFormat k_OutputFormats[OUTPUT_SURFACE_FORMAT_COUNT]; + static const VdpRGBAFormat k_OutputFormats8Bit[OUTPUT_SURFACE_FORMAT_COUNT]; + static const VdpRGBAFormat k_OutputFormats10Bit[OUTPUT_SURFACE_FORMAT_COUNT]; VdpGetErrorString* m_VdpGetErrorString; VdpPresentationQueueTargetDestroy* m_VdpPresentationQueueTargetDestroy;