MCPcopy Create free account
hub / github.com/WallBreaker2/op / write_shared_frame

Function write_shared_frame

libop/hook/D3D10Capture.cpp:30–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28}
29
30void write_shared_frame(std::span<std::byte> sharedFrame, HWND hwnd, UINT width, UINT height, const void *source,
31 int sourceRows, int sourceCols, int rowPitch, int format) {
32 // 使用 span 明确区分帧头和像素区,避免共享内存裸指针偏移散落在捕获逻辑里。
33 auto frameInfoBytes = sharedFrame.first(sizeof(FrameInfo));
34 auto pixelBytes = sharedFrame.subspan(sizeof(FrameInfo));
35
36 reinterpret_cast<FrameInfo *>(frameInfoBytes.data())->format(hwnd, width, height);
37 CopyImageData(reinterpret_cast<char *>(pixelBytes.data()), static_cast<const char *>(source), sourceRows,
38 sourceCols, rowPitch, format);
39}
40
41} // namespace
42

Callers 1

dx10_captureFunction · 0.70

Calls 3

CopyImageDataFunction · 0.85
formatMethod · 0.80
dataMethod · 0.45

Tested by

no test coverage detected