diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2019-09-22 16:51:23 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2019-09-22 16:51:51 +0200 |
commit | 4cb73ce5853d924c17381f3183226b8835172da7 (patch) | |
tree | 8670106bf6b216d7397bff0b104c7d1a4563f244 /video-ps3eye/shm-layout.hpp | |
parent | c8fb7bfa37555e5cbe68f368ebb98b161fb2771a (diff) |
video/ps3eye: buffer flush
Diffstat (limited to 'video-ps3eye/shm-layout.hpp')
-rw-r--r-- | video-ps3eye/shm-layout.hpp | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/video-ps3eye/shm-layout.hpp b/video-ps3eye/shm-layout.hpp new file mode 100644 index 00000000..7fa29115 --- /dev/null +++ b/video-ps3eye/shm-layout.hpp @@ -0,0 +1,40 @@ +#pragma once +#include <cstdint> + +namespace ps3eye { + +struct shm_out { + enum class mode : uint8_t { qvga, vga, }; + enum class status : uint8_t { starting, running, fail, terminate, }; + + uint8_t settings_updated; + uint16_t framerate; + mode resolution; + status status_; + uint8_t sharpness, contrast, brightness, hue, saturation; + uint8_t gain, exposure, auto_gain, awb, test_pattern; +}; + +struct shm_in { + uint8_t settings_updated_ack; + uint8_t timecode; + union { + uint8_t data_320x240[320][240][3]; + uint8_t data_640x480[640][480][3]; + }; +}; + +struct shm { + static constexpr unsigned _cacheline_len = 64; + static constexpr unsigned _padding_len = + (_cacheline_len - (sizeof(shm_in) & (_cacheline_len - 1))) & (_cacheline_len - 1); + + using resolution = shm_out::mode; + using status = shm_out::status; + + shm_out out; + const char* _padding[_padding_len]; + shm_in in; +}; + +} // ns ps3eye |