Don't try to initialize VDPAU on Wayland

This commit is contained in:
Cameron Gutman
2021-12-06 19:38:28 -06:00
parent 3e9aea1f7a
commit c09559ade5
+21 -22
View File
@@ -93,6 +93,27 @@ bool VDPAURenderer::initialize(PDECODER_PARAMETERS params)
#endif #endif
}; };
SDL_VERSION(&info.version);
if (!SDL_GetWindowWMInfo(params->window, &info)) {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,
"SDL_GetWindowWMInfo() failed: %s",
SDL_GetError());
return false;
}
if (info.subsystem == SDL_SYSWM_WAYLAND) {
SDL_LogWarn(SDL_LOG_CATEGORY_APPLICATION,
"VDPAU is not supported on Wayland");
return false;
}
else {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,
"VDPAU is not supported on the current subsystem: %d",
info.subsystem);
return false;
}
m_VideoWidth = params->width; m_VideoWidth = params->width;
m_VideoHeight = params->height; m_VideoHeight = params->height;
@@ -158,18 +179,8 @@ bool VDPAURenderer::initialize(PDECODER_PARAMETERS params)
SDL_GetWindowSize(params->window, (int*)&m_DisplayWidth, (int*)&m_DisplayHeight); SDL_GetWindowSize(params->window, (int*)&m_DisplayWidth, (int*)&m_DisplayHeight);
SDL_VERSION(&info.version);
if (!SDL_GetWindowWMInfo(params->window, &info)) {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,
"SDL_GetWindowWMInfo() failed: %s",
SDL_GetError());
return false;
}
SDL_assert(info.subsystem == SDL_SYSWM_X11); SDL_assert(info.subsystem == SDL_SYSWM_X11);
if (info.subsystem == SDL_SYSWM_X11) {
GET_PROC_ADDRESS(VDP_FUNC_ID_PRESENTATION_QUEUE_TARGET_CREATE_X11, GET_PROC_ADDRESS(VDP_FUNC_ID_PRESENTATION_QUEUE_TARGET_CREATE_X11,
&m_VdpPresentationQueueTargetCreateX11); &m_VdpPresentationQueueTargetCreateX11);
status = m_VdpPresentationQueueTargetCreateX11(m_Device, status = m_VdpPresentationQueueTargetCreateX11(m_Device,
@@ -181,18 +192,6 @@ bool VDPAURenderer::initialize(PDECODER_PARAMETERS params)
m_VdpGetErrorString(status)); m_VdpGetErrorString(status));
return false; return false;
} }
}
else if (info.subsystem == SDL_SYSWM_WAYLAND) {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,
"VDPAU backend does not currently support Wayland");
return false;
}
else {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,
"Unsupported VDPAU rendering subsystem: %d",
info.subsystem);
return false;
}
const char* infoString; const char* infoString;
if (m_VdpGetInformationString(&infoString) == VDP_STATUS_OK) { if (m_VdpGetInformationString(&infoString) == VDP_STATUS_OK) {