Commit 2fd859d0 authored by Steve Lhomme's avatar Steve Lhomme

direct3d11: the rendering is "windowless" with an external callback

In that case we don't call CommonInit.

We also check that on Winstore the legacy "winrt-d3dcontext" variable is set if
an external callback is not used.
parent 70a5b446
......@@ -428,38 +428,37 @@ static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
if (ret != VLC_SUCCESS)
return ret;
ID3D11DeviceContext *d3d11_ctx = NULL;
#if VLC_WINSTORE_APP
if (d3d11_ctx == NULL)
d3d11_ctx = var_InheritInteger(vd, "winrt-d3dcontext");
if (d3d11_ctx == NULL)
bool uses_external_callbacks = true;
if (!sys->swapCb || !sys->starRenderCb || !sys->endRenderCb || !sys->resizeCb)
{
msg_Err(vd, "missing direct3d context for winstore");
goto error;
sys->outside_opaque = vd;
sys->swapCb = Swap;
sys->starRenderCb = StartRendering;
sys->endRenderCb = NULL;
sys->resizeCb = Resize;
uses_external_callbacks = false;
}
#endif
InitArea(vd, &sys->area, cfg);
#if !VLC_WINSTORE_APP
if (d3d11_ctx == NULL)
if ( !uses_external_callbacks )
{
#if VLC_WINSTORE_APP
/* LEGACY, the d3dcontext and swapchain were given by the host app */
if (var_InheritInteger(vd, "winrt-d3dcontext") == 0)
{
msg_Err(vd, "missing direct3d context for winstore");
goto error;
}
#else /* !VLC_WINSTORE_APP */
if (CommonInit(VLC_OBJECT(vd), &sys->area, &sys->sys,
vd->source.projection_mode != PROJECTION_MODE_RECTANGULAR))
goto error;
}
#endif /* !VLC_WINSTORE_APP */
}
if (vd->source.projection_mode != PROJECTION_MODE_RECTANGULAR && sys->sys.hvideownd)
sys->p_sensors = HookWindowsSensors(vd, sys->sys.hvideownd);
if (!sys->swapCb || !sys->starRenderCb || !sys->endRenderCb || !sys->resizeCb)
{
sys->outside_opaque = vd;
sys->swapCb = Swap;
sys->starRenderCb = StartRendering;
sys->endRenderCb = NULL;
sys->resizeCb = Resize;
}
if (Direct3D11Open(vd, fmtp)) {
msg_Err(vd, "Direct3D11 could not be opened");
goto error;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment