mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-04-24 00:47:23 +00:00
Add 10-bit output support to VDPAU renderer
This commit is contained in:
@@ -12,11 +12,16 @@
|
|||||||
#define GET_PROC_ADDRESS(id, func) status = vdpauCtx->get_proc_address(m_Device, id, (void**)func); \
|
#define GET_PROC_ADDRESS(id, func) status = vdpauCtx->get_proc_address(m_Device, id, (void**)func); \
|
||||||
BAIL_ON_FAIL(status, id)
|
BAIL_ON_FAIL(status, id)
|
||||||
|
|
||||||
const VdpRGBAFormat VDPAURenderer::k_OutputFormats[] = {
|
const VdpRGBAFormat VDPAURenderer::k_OutputFormats8Bit[] = {
|
||||||
VDP_RGBA_FORMAT_B8G8R8A8,
|
VDP_RGBA_FORMAT_B8G8R8A8,
|
||||||
VDP_RGBA_FORMAT_R8G8B8A8
|
VDP_RGBA_FORMAT_R8G8B8A8
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const VdpRGBAFormat VDPAURenderer::k_OutputFormats10Bit[] = {
|
||||||
|
VDP_RGBA_FORMAT_B10G10R10A2,
|
||||||
|
VDP_RGBA_FORMAT_R10G10B10A2
|
||||||
|
};
|
||||||
|
|
||||||
VDPAURenderer::VDPAURenderer()
|
VDPAURenderer::VDPAURenderer()
|
||||||
: m_HwContext(nullptr),
|
: m_HwContext(nullptr),
|
||||||
m_PresentationQueueTarget(0),
|
m_PresentationQueueTarget(0),
|
||||||
@@ -143,7 +148,11 @@ bool VDPAURenderer::initialize(PDECODER_PARAMETERS params)
|
|||||||
for (int i = 0; i < OUTPUT_SURFACE_FORMAT_COUNT; i++) {
|
for (int i = 0; i < OUTPUT_SURFACE_FORMAT_COUNT; i++) {
|
||||||
VdpBool supported;
|
VdpBool supported;
|
||||||
uint32_t maxWidth, maxHeight;
|
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);
|
&supported, &maxWidth, &maxHeight);
|
||||||
if (status != VDP_STATUS_OK) {
|
if (status != VDP_STATUS_OK) {
|
||||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,
|
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,
|
||||||
@@ -154,7 +163,7 @@ bool VDPAURenderer::initialize(PDECODER_PARAMETERS params)
|
|||||||
|
|
||||||
if (supported) {
|
if (supported) {
|
||||||
if (m_DisplayWidth <= maxWidth && m_DisplayHeight <= maxHeight) {
|
if (m_DisplayWidth <= maxWidth && m_DisplayHeight <= maxHeight) {
|
||||||
m_OutputSurfaceFormat = k_OutputFormats[i];
|
m_OutputSurfaceFormat = candidateFormat;
|
||||||
foundFormat = true;
|
foundFormat = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,7 +33,8 @@ private:
|
|||||||
int m_NextSurfaceIndex;
|
int m_NextSurfaceIndex;
|
||||||
|
|
||||||
#define OUTPUT_SURFACE_FORMAT_COUNT 2
|
#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;
|
VdpGetErrorString* m_VdpGetErrorString;
|
||||||
VdpPresentationQueueTargetDestroy* m_VdpPresentationQueueTargetDestroy;
|
VdpPresentationQueueTargetDestroy* m_VdpPresentationQueueTargetDestroy;
|
||||||
|
|||||||
Reference in New Issue
Block a user