summaryrefslogtreecommitdiff
path: root/src/qcam/main_window.h
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-03-22 21:30:04 +0200
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-03-24 10:33:57 +0200
commit53dd3594d5a87c15d15e57609eb0460c9cf7789a (patch)
tree2e92e1987f66fe6820330cd08b0336e7a045ba7a /src/qcam/main_window.h
parent0420a14d75b56726eaa0d7651cc924b1ba4464c2 (diff)
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 <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'src/qcam/main_window.h')
-rw-r--r--src/qcam/main_window.h24
1 files changed, 14 insertions, 10 deletions
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> camera_;
FrameBufferAllocator *allocator_;
- bool isCapturing_;
std::unique_ptr<CameraConfiguration> config_;
+ std::map<int, std::pair<void *, unsigned int>> mappedBuffers_;
- uint64_t lastBufferTime_;
+ /* Capture state, buffers queue and statistics */
+ bool isCapturing_;
+ QQueue<FrameBuffer *> doneQueue_;
+ QMutex mutex_; /* Protects doneQueue_ */
+ uint64_t lastBufferTime_;
QElapsedTimer frameRateInterval_;
uint32_t previousFrames_;
uint32_t framesCaptured_;
-
- QMutex mutex_;
- QQueue<FrameBuffer *> doneQueue_;
-
- QToolBar *toolbar_;
- QAction *startStopAction_;
- ViewFinder *viewfinder_;
- std::map<int, std::pair<void *, unsigned int>> mappedBuffers_;
};
#endif /* __QCAM_MAIN_WINDOW__ */