summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2020-03-08 06:05:45 +0100
committerStanislaw Halik <sthalik@misaki.pl>2020-03-08 06:05:45 +0100
commit8babfb4caff1c32d74a4f58d28eba13bd3b23f21 (patch)
tree9b0a8f4f847bfe41a7ada02b67b00fe0972aa1d7
parent98502444b0c5881797e4833ee1fc79388b94ba82 (diff)
video/ps3eye: copy from memory mapping
-rw-r--r--video-ps3eye/module.cpp3
-rw-r--r--video-ps3eye/module.hpp1
-rw-r--r--video-ps3eye/wrapper.cxx1
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);