aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2022-07-06 10:57:38 +0200
committerdec05eba <dec05eba@protonmail.com>2022-07-06 10:58:00 +0200
commit2ccfcfd7947cd1a65696e74ae2f48c36e121ecef (patch)
treea23f586edb469f2f5b3cc18a21c28d8f80886900
parentc8b9542f0daf052ed040adbc7f7d04fa513ae44c (diff)
Fix nvfbc recording at 3440 width (set linesize to width * 4)
Thanks to Hans Gaiser for debugging and fixing it!
-rw-r--r--src/main.cpp4
1 files changed, 4 insertions, 0 deletions
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);