void spoutDirectX::UnlockD3D11Texture(ID3D11Texture2D* pD3D11Texture) { if(pD3D11Texture == NULL) return; IDXGIKeyedMutex* pDXGIKeyedMutex; pD3D11Texture->QueryInterface(_uuidof(IDXGIKeyedMutex), (void**)&pDXGIKeyedMutex); if (pDXGIKeyedMutex) { HRESULT hr = pDXGIKeyedMutex->ReleaseSync(0); if (FAILED(hr)) { // printf("Failed to unlock the shared texture"); } } }