mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-12-23 14:03:40 +00:00
[host] correct YUV output, do not copy padding bytes
This commit is contained in:
parent
b899a65726
commit
d292d46fcb
@ -594,7 +594,7 @@ GrabStatus Capture::DXGI::GrabFrameYUV420(struct FrameInfo & frame, struct Curso
|
|||||||
return GRAB_STATUS_ERROR;
|
return GRAB_STATUS_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
const unsigned int size = desc.Height * mapping.RowPitch;
|
const unsigned int size = desc.Height * desc.Width;
|
||||||
if (size > remain)
|
if (size > remain)
|
||||||
{
|
{
|
||||||
m_deviceContext->Unmap(m_texture[i], 0);
|
m_deviceContext->Unmap(m_texture[i], 0);
|
||||||
@ -602,10 +602,15 @@ GrabStatus Capture::DXGI::GrabFrameYUV420(struct FrameInfo & frame, struct Curso
|
|||||||
return GRAB_STATUS_ERROR;
|
return GRAB_STATUS_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
memcpySSE(data, mapping.pData, size);
|
const uint8_t * src = (uint8_t *)mapping.pData;
|
||||||
data += size;
|
for(unsigned int y = 0; y < desc.Height; ++y)
|
||||||
remain -= size;
|
{
|
||||||
|
memcpySSE(data, src, desc.Width);
|
||||||
|
data += desc.Width;
|
||||||
|
src += mapping.RowPitch;
|
||||||
|
}
|
||||||
m_deviceContext->Unmap(m_texture[i], 0);
|
m_deviceContext->Unmap(m_texture[i], 0);
|
||||||
|
remain -= size;
|
||||||
}
|
}
|
||||||
|
|
||||||
frame.pitch = m_width;
|
frame.pitch = m_width;
|
||||||
|
@ -129,8 +129,8 @@ bool TextureConverter::Initialize(
|
|||||||
if (m_texFormats[i] == DXGI_FORMAT_UNKNOWN)
|
if (m_texFormats[i] == DXGI_FORMAT_UNKNOWN)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
texDesc .Format = m_texFormats[i];
|
texDesc .Format = m_texFormats[i];
|
||||||
targetDesc.Format = m_texFormats[i];
|
targetDesc.Format = m_texFormats[i];
|
||||||
shaderDesc.Format = m_texFormats[i];
|
shaderDesc.Format = m_texFormats[i];
|
||||||
|
|
||||||
result = device->CreateTexture2D(&texDesc, NULL, &m_targetTexture[i]);
|
result = device->CreateTexture2D(&texDesc, NULL, &m_targetTexture[i]);
|
||||||
|
Loading…
Reference in New Issue
Block a user