From 8babfb4caff1c32d74a4f58d28eba13bd3b23f21 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 8 Mar 2020 06:05:45 +0100 Subject: video/ps3eye: copy from memory mapping --- video-ps3eye/module.cpp | 3 ++- video-ps3eye/module.hpp | 1 + video-ps3eye/wrapper.cxx | 1 - 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/video-ps3eye/module.cpp b/video-ps3eye/module.cpp index 2c9ce100..3ee43ec1 100644 --- a/video-ps3eye/module.cpp +++ b/video-ps3eye/module.cpp @@ -203,7 +203,8 @@ fail: static_assert(offsetof(decltype(ptr.out), data_640x480) == offsetof(decltype(ptr.out), data_320x240)); ok: - fr.data = (unsigned char*)ptr.out.data_640x480; + memcpy(data, (unsigned char*)ptr.out.data_640x480,sizeof(ptr.out.data_640x480)); + fr.data = data; return { fr, true}; } diff --git a/video-ps3eye/module.hpp b/video-ps3eye/module.hpp index 6e0addfc..957e221e 100644 --- a/video-ps3eye/module.hpp +++ b/video-ps3eye/module.hpp @@ -28,6 +28,7 @@ struct ps3eye_camera final : video::impl::camera shm_wrapper shm { "ps3eye-driver-shm", nullptr, sizeof(ps3eye::shm) }; settings s; frame fr; + unsigned char data[640 * 480 * 3] = {}; int framerate = 30; bool open = false; unsigned timecode = 0; diff --git a/video-ps3eye/wrapper.cxx b/video-ps3eye/wrapper.cxx index 291f3e8f..eca8968d 100644 --- a/video-ps3eye/wrapper.cxx +++ b/video-ps3eye/wrapper.cxx @@ -26,7 +26,6 @@ static void error(volatile ps3eye::shm_out& out, const char (&error)[N], const x static void update_settings(ps3eye::camera& camera, const volatile ps3eye::shm_in& in) { - // TODO //camera.set_framerate(in.framerate); camera.set_auto_gain(in.auto_gain); camera.set_gain(in.gain); -- cgit v1.2.3