diff --git a/NDIlib_Recv.cpp b/NDIlib_Recv.cpp index 154c150..0da37f4 100644 --- a/NDIlib_Recv.cpp +++ b/NDIlib_Recv.cpp @@ -77,9 +77,9 @@ int main(int argc, char* argv[]) std::cout << std::endl; // cv::Mat frame(video_frame.yres, video_frame.xres, CV_8UC4, video_frame.p_data); - cv::Mat frame = cv::Mat::zeros(cv::Size(video_frame.xres, video_frame.yres), CV_8UC4); + cv::Mat frame = cv::Mat::zeros(cv::Size(video_frame.xres-1, video_frame.yres), CV_8UC4); std::cout << std::endl; - memcpy(frame.data, video_frame.p_data, video_frame.xres * video_frame.yres * 4); + memcpy(frame.data, video_frame.p_data, (double)video_frame.xres * (double)video_frame.yres * (double)4); for (int i = 0; i < 100; i++){ std::cout << frame.at(0, i) << " "; } diff --git a/NDIlib_Send_Video.cpp b/NDIlib_Send_Video.cpp index 0d12bc2..4852683 100644 --- a/NDIlib_Send_Video.cpp +++ b/NDIlib_Send_Video.cpp @@ -160,7 +160,7 @@ int main(int argc, char* argv[]) // Fill in the buffer. It is likely that you would do something much smarter than this. // memset((void*)NDI_video_frame.p_data, (idx & 1) ? 255 : 0, NDI_video_frame.xres*NDI_video_frame.yres * 4 * sizeof(uint8_t)); // Why used void* the guy in GitHub? - memcpy((void*)NDI_video_frame.p_data, imLeft.ptr(0, 0), NDI_video_frame.xres * NDI_video_frame.yres * 3); + memcpy((void*)NDI_video_frame.p_data, imLeft.ptr(0, 0), (double)NDI_video_frame.xres * (double)NDI_video_frame.yres * (double)3); std::cout << std::endl << "From the video_frame.p_data array first elements of the rows: " << std::endl; for (int i = 0; i < 100; i++){ diff --git a/cmake-build-debug/NDIlib_Recv b/cmake-build-debug/NDIlib_Recv index a8426a6..0355997 100755 Binary files a/cmake-build-debug/NDIlib_Recv and b/cmake-build-debug/NDIlib_Recv differ diff --git a/cmake-build-debug/NDIlib_Send_Video b/cmake-build-debug/NDIlib_Send_Video index d9278db..e2a8815 100755 Binary files a/cmake-build-debug/NDIlib_Send_Video and b/cmake-build-debug/NDIlib_Send_Video differ