From b5f2092e9c7a897c4465ff1e98387e5d2a2b8ae8 Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Fri, 29 Dec 2017 21:01:02 +1100 Subject: [PATCH] [host] return the compressed frame size in the pitch field --- common/KVMFR.h | 4 ++-- host/Capture/DXGI.cpp | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/common/KVMFR.h b/common/KVMFR.h index f7236bc3..70a0a4c9 100644 --- a/common/KVMFR.h +++ b/common/KVMFR.h @@ -63,8 +63,8 @@ typedef struct KVMFRFrame FrameType type; // the frame data type uint32_t width; // the width uint32_t height; // the height - uint32_t stride; // the row stride (zero if cursor data) - uint32_t pitch; // the row pitch (stride in bytes) + uint32_t stride; // the row stride (zero if compressed data) + uint32_t pitch; // the row pitch (stride in bytes or the compressed frame size) uint64_t dataPos; // offset to the frame } KVMFRFrame; diff --git a/host/Capture/DXGI.cpp b/host/Capture/DXGI.cpp index 885e609b..2c2440af 100644 --- a/host/Capture/DXGI.cpp +++ b/host/Capture/DXGI.cpp @@ -885,8 +885,11 @@ GrabStatus Capture::DXGI::GrabFrameH264(FrameInfo & frame) buffer->Lock(&pixels, &maxLen, &curLen); m_memcpy.Copy(frame.buffer, pixels, curLen); buffer->Unlock(); - SafeRelease(&buffer); + + frame.stride = 0; + frame.pitch = curLen; + TRACE_END; return GRAB_STATUS_OK; }