From 53dd3594d5a87c15d15e57609eb0460c9cf7789a Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Sun, 22 Mar 2020 21:30:04 +0200 Subject: qcam: main_window: Document functions and reorganize member data The qcam application is our reference implementation of a libcamera GUI application. Document the code of the MainWindow class to make it easier to follow, and reorganize the member data in logical groups for clarity. No code change. Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- src/qcam/main_window.h | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'src/qcam/main_window.h') diff --git a/src/qcam/main_window.h b/src/qcam/main_window.h index 34a090cc..c662a2ef 100644 --- a/src/qcam/main_window.h +++ b/src/qcam/main_window.h @@ -57,6 +57,7 @@ private Q_SLOTS: private: int createToolbars(); + std::string chooseCamera(); int openCamera(); @@ -68,34 +69,37 @@ private: int display(FrameBuffer *buffer); void queueRequest(FrameBuffer *buffer); + /* UI elements */ + QToolBar *toolbar_; + QAction *startStopAction_; + ViewFinder *viewfinder_; + QIcon iconPlay_; QIcon iconStop_; QString title_; QTimer titleTimer_; + /* Options */ const OptionsParser::Options &options_; + /* Camera manager, camera, configuration and buffers */ CameraManager *cm_; std::shared_ptr camera_; FrameBufferAllocator *allocator_; - bool isCapturing_; std::unique_ptr config_; + std::map> mappedBuffers_; - uint64_t lastBufferTime_; + /* Capture state, buffers queue and statistics */ + bool isCapturing_; + QQueue doneQueue_; + QMutex mutex_; /* Protects doneQueue_ */ + uint64_t lastBufferTime_; QElapsedTimer frameRateInterval_; uint32_t previousFrames_; uint32_t framesCaptured_; - - QMutex mutex_; - QQueue doneQueue_; - - QToolBar *toolbar_; - QAction *startStopAction_; - ViewFinder *viewfinder_; - std::map> mappedBuffers_; }; #endif /* __QCAM_MAIN_WINDOW__ */ -- cgit v1.2.1