From 921b118472da6c9d4f4d1b76549b4c3672926925 Mon Sep 17 00:00:00 2001 From: Nikita Kostovsky Date: Fri, 14 Nov 2025 11:16:23 +0100 Subject: cleanup, add comments --- src/camera/veyeimx287m.h | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) (limited to 'src/camera/veyeimx287m.h') diff --git a/src/camera/veyeimx287m.h b/src/camera/veyeimx287m.h index 5afc84b..7d7e2c6 100644 --- a/src/camera/veyeimx287m.h +++ b/src/camera/veyeimx287m.h @@ -31,6 +31,7 @@ public: bool init(); + bool setExposureTime(const std::chrono::microseconds us); bool setExposureTimeUs(int value) override; bool setGain(int value) override; @@ -38,14 +39,14 @@ public: bool setSomething(int value) override; - // bool dequeueImageBuffer(Image &image); bool dequeueImageBuffer(size_t &image); bool getImage(Image &image); - // Image &getImage(); public: - // libcamera::Signal> newPixels; - // libcamera::Signal> newImage; + /*! + * \brief processedCounter - count of images processed in current second. + * Used for performance measurement and bottlenecks analysing + */ uint32_t processedCounter{0}; private: @@ -55,18 +56,26 @@ private: bool initCam(); bool initHttpServer(); - void dequeueFrameLoop(std::stop_token stopToken); void calcFrameLoop(std::stop_token stopToken); private: + /*! + * \brief m_cam_fd - camera file descriptor + */ int m_cam_fd{-1}; static constexpr uint8_t BUFFER_COUNT{16}; - struct v4l2_plane planes[VIDEO_MAX_PLANES]; - std::array m_imageMutexes; std::array m_images; - std::array m_bufferMutexes; + /*! + * \brief m_imageMutexes - lock while processing image from m_images + */ + std::array m_imageMutexes; + /*! + * \todo copy image right after dequeue to avoid situation with ioctl writing + * to m_videoBuffers[i] which is being copied to m_images[i]. In theory, it + * should not overlap if BUFFER_COUNT > theads count + */ std::array m_videoBuffers; struct buffer -- cgit v1.2.3-70-g09d2