summaryrefslogtreecommitdiff
path: root/src/camera/innomakerov9281.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/camera/innomakerov9281.h')
-rw-r--r--src/camera/innomakerov9281.h25
1 files changed, 17 insertions, 8 deletions
diff --git a/src/camera/innomakerov9281.h b/src/camera/innomakerov9281.h
index 51485cb..2c1fb7c 100644
--- a/src/camera/innomakerov9281.h
+++ b/src/camera/innomakerov9281.h
@@ -2,18 +2,17 @@
#include <cstdint>
+#include <thread>
+
#include "constants.h"
#include "image.h"
-class ICamera
-{
-public:
- virtual bool setExposureTimeMs(int value) = 0;
- virtual bool setGain(int value) = 0;
-};
+#include "icamera.h"
class InnoMakerOV9281 : public ICamera
{
+ constexpr static char videoDevice[] = "/dev/video0";
+
public:
using buffer_t = std::array<uint8_t, img_size>;
@@ -22,13 +21,22 @@ public:
~InnoMakerOV9281();
public:
+ static std::vector<std::shared_ptr<ICamera>> search();
+
+public:
+ bool startStream();
+
bool init();
- bool setExposureTimeMs(int value) override;
- bool setGain(int value) override;
+ bool setExposureTimeMs(int value);
+ bool setGain(int value);
bool getImage(Image &image);
+public:
+ libcamera::Signal<std::shared_ptr<Pixels>> newPixels;
+ libcamera::Signal<std::shared_ptr<Image>> newImage;
+
private:
bool setCamParam(unsigned int v4l2controlId, int value);
bool openCam();
@@ -40,4 +48,5 @@ private:
static constexpr uint8_t BUFFER_COUNT{3};
uint8_t *video_buffer_ptr[BUFFER_COUNT];
// buffer_t m_buf;
+ std::jthread m_streamThread;
};