diff --git a/host/Capture/DXGI.cpp b/host/Capture/DXGI.cpp index 2d704958..8c4d191c 100644 --- a/host/Capture/DXGI.cpp +++ b/host/Capture/DXGI.cpp @@ -639,9 +639,10 @@ GrabStatus DXGI::GrabFrame(struct FrameInfo & frame, struct CursorInfo & cursor) frame.height = m_height; switch (m_frameType) - { - case FRAME_TYPE_ARGB: return GrabFrameRaw (frame, cursor); + { case FRAME_TYPE_NV12: return GrabFrameNV12(frame, cursor); case FRAME_TYPE_H264: return GrabFrameH264(frame, cursor); } + + return GrabFrameRaw(frame, cursor); } \ No newline at end of file diff --git a/host/TextureConverter.cpp b/host/TextureConverter.cpp index 25fc529e..23961870 100644 --- a/host/TextureConverter.cpp +++ b/host/TextureConverter.cpp @@ -105,27 +105,8 @@ bool TextureConverter::Initialize( texDesc.Usage = D3D11_USAGE_DEFAULT; texDesc.CPUAccessFlags = 0; texDesc.MiscFlags = 0; - - texDesc.Format = DXGI_FORMAT_D24_UNORM_S8_UINT; - texDesc.BindFlags = D3D11_BIND_DEPTH_STENCIL; - result = device->CreateTexture2D(&texDesc, NULL, &m_depthTexture); - if (FAILED(result)) - { - DeInitialize(); - DEBUG_ERROR("Failed to create the depth/stencil texture"); - return false; - } - - result = device->CreateDepthStencilView(m_depthTexture, NULL, &m_depthView); - if (FAILED(result)) - { - DeInitialize(); - DEBUG_ERROR("Failed to create the depth stencil view"); - return false; - } - - texDesc.Format = DXGI_FORMAT_B8G8R8A8_UNORM; - texDesc.BindFlags = D3D11_BIND_RENDER_TARGET | D3D11_BIND_SHADER_RESOURCE; + texDesc.Format = DXGI_FORMAT_B8G8R8A8_UNORM; + texDesc.BindFlags = D3D11_BIND_RENDER_TARGET | D3D11_BIND_SHADER_RESOURCE; result = device->CreateTexture2D(&texDesc, NULL, &m_targetTexture); if (FAILED(result)) { @@ -276,7 +257,6 @@ void TextureConverter::DeInitialize() SafeRelease(&m_vertexBuffer ); SafeRelease(&m_shaderView ); SafeRelease(&m_renderView ); - SafeRelease(&m_depthTexture ); SafeRelease(&m_targetTexture); SafeRelease(&m_vertexShader ); SafeRelease(&m_pixelShader ); @@ -320,7 +300,6 @@ bool TextureConverter::Convert(ID3D11Texture2DPtr &texture) m_deviceContext->OMSetRenderTargets(1, renderViews, NULL); m_deviceContext->ClearRenderTargetView(m_renderView, color); - m_deviceContext->ClearDepthStencilView(m_depthView , D3D11_CLEAR_DEPTH | D3D11_CLEAR_STENCIL, 1.0f, 0); stride = sizeof(VS_INPUT); offset = 0; diff --git a/host/TextureConverter.h b/host/TextureConverter.h index 9679d6af..6783facf 100644 --- a/host/TextureConverter.h +++ b/host/TextureConverter.h @@ -56,8 +56,6 @@ private: DXGI_FORMAT m_format; ID3D11Texture2DPtr m_targetTexture; - ID3D11Texture2DPtr m_depthTexture; - ID3D11DepthStencilViewPtr m_depthView; ID3D11RenderTargetViewPtr m_renderView; ID3D11ShaderResourceViewPtr m_shaderView; ID3D11InputLayoutPtr m_layout;