From 2a86339b1d1b1235a5b65680f64a6ca29d5a56a8 Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Wed, 2 Jan 2019 10:28:43 +1100 Subject: [PATCH] [host] [Patch 1/2] fix copy of padded resolutions --- host/Capture/DXGI.cpp | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/host/Capture/DXGI.cpp b/host/Capture/DXGI.cpp index 26fb7142..50de68bb 100644 --- a/host/Capture/DXGI.cpp +++ b/host/Capture/DXGI.cpp @@ -735,19 +735,10 @@ GrabStatus Capture::DXGI::GrabFrameRaw(FrameInfo & frame) return GRAB_STATUS_ERROR; } - frame.pitch = m_width * 4; - frame.stride = m_width; - - if (frame.pitch == mapping.RowPitch) - memcpySSE(frame.buffer, mapping.pData, frame.pitch * m_height); - else - for(unsigned int y = 0; y < m_height; ++y) - memcpySSE( - (uint8_t *)frame.buffer + (frame.pitch * y), - (uint8_t *)mapping.pData + (mapping.RowPitch * y), - frame.pitch - ); + frame.pitch = mapping.RowPitch; + frame.stride = mapping.RowPitch / 4; + memcpySSE(frame.buffer, mapping.pData, frame.pitch * m_height); m_deviceContext->Unmap(m_texture[0], 0); return GRAB_STATUS_OK;