summaryrefslogtreecommitdiffhomepage
path: root/video-ps3eye/shm-layout.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'video-ps3eye/shm-layout.hpp')
-rw-r--r--video-ps3eye/shm-layout.hpp39
1 files changed, 39 insertions, 0 deletions
diff --git a/video-ps3eye/shm-layout.hpp b/video-ps3eye/shm-layout.hpp
new file mode 100644
index 00000000..65b0a4f1
--- /dev/null
+++ b/video-ps3eye/shm-layout.hpp
@@ -0,0 +1,39 @@
+#pragma once
+#include <cstdint>
+
+namespace ps3eye {
+
+static constexpr unsigned num_channels = 3;
+
+struct shm_in {
+ enum class mode : uint8_t { qvga, vga, };
+
+ uint32_t settings_updated;
+ uint8_t framerate, channels;
+ mode resolution;
+ //uint8_t sharpness, contrast, brightness hue, saturation;
+ uint8_t gain, exposure, auto_gain, test_pattern;
+ uint8_t do_exit;
+};
+
+struct shm_out
+{
+ enum class status : uint8_t { starting, running, fail, terminate, };
+
+ uint32_t timecode;
+ uint32_t settings_updated_ack;
+ status status_;
+ char error_string[256];
+ union {
+ uint8_t data_320x240[320][240][num_channels];
+ uint8_t data_640x480[640][480][num_channels];
+ };
+};
+
+struct alignas(64) shm {
+ shm_out out;
+ [[maybe_unused]] const char _padding[128 - sizeof(shm_out) % 128]; // NOLINT
+ shm_in in;
+};
+
+} // ns ps3eye