From 2ccfcfd7947cd1a65696e74ae2f48c36e121ecef Mon Sep 17 00:00:00 2001 From: dec05eba Date: Wed, 6 Jul 2022 10:57:38 +0200 Subject: Fix nvfbc recording at 3440 width (set linesize to width * 4) Thanks to Hans Gaiser for debugging and fixing it! --- src/main.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/main.cpp b/src/main.cpp index bcac239..d631aa3 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1433,6 +1433,8 @@ int main(int argc, char **argv) { // TODO: Remove this copy, which is only possible by using nvenc directly and encoding window_pixmap.target_texture_id + frame->linesize[0] = frame->width * 4; + CUDA_MEMCPY2D memcpy_struct; memcpy_struct.srcXInBytes = 0; memcpy_struct.srcY = 0; @@ -1452,6 +1454,8 @@ int main(int argc, char **argv) { frame_captured = true; } else { // TODO: Check when src_cu_device_ptr changes and re-register resource + frame->linesize[0] = frame->width * 4; + uint32_t byte_size = 0; CUdeviceptr src_cu_device_ptr = 0; frame_captured = nv_fbc_library.capture(&src_cu_device_ptr, &byte_size); -- cgit v1.2.3