diff options
Diffstat (limited to 'src/camera/innomakerov9281.h')
| -rw-r--r-- | src/camera/innomakerov9281.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/camera/innomakerov9281.h b/src/camera/innomakerov9281.h new file mode 100644 index 0000000..bcafc12 --- /dev/null +++ b/src/camera/innomakerov9281.h @@ -0,0 +1,36 @@ +#pragma once + +#include <cstdint> + +#include "constants.h" +#include "image.h" + +class InnoMakerOV9281 +{ +public: + using buffer_t = std::array<uint8_t, img_size>; + +public: + InnoMakerOV9281(); + ~InnoMakerOV9281(); + +public: + bool init(); + + bool setExposureTimeMs(int value); + bool setGain(int value); + + bool getImage(Image &image); + +private: + bool setCamParam(unsigned int v4l2controlId, int value); + bool openCam(); + bool selectCam(int camIdx = 0); + bool initCam(); + +private: + int m_cam_fd{-1}; + static constexpr uint8_t BUFFER_COUNT{3}; + uint8_t *video_buffer_ptr[BUFFER_COUNT]; + // buffer_t m_buf; +}; |
