From 843e4466cd78b3369b1e77af0bf3b33cbd09129d Mon Sep 17 00:00:00 2001 From: Kieran Bingham Date: Thu, 20 Jun 2019 17:11:33 +0100 Subject: qcam: Update window title with FPS Provide an average FPS in the QCam title bar to show the current rate of frame processing. The QCam compilation is updated to process the Qt MoC headers to support signals and slots accordingly. Reviewed-by: Laurent Pinchart Signed-off-by: Kieran Bingham --- src/qcam/main_window.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/qcam/main_window.h') diff --git a/src/qcam/main_window.h b/src/qcam/main_window.h index 46a494a9..f58cb6a6 100644 --- a/src/qcam/main_window.h +++ b/src/qcam/main_window.h @@ -10,7 +10,10 @@ #include #include +#include #include +#include +#include #include #include @@ -28,10 +31,15 @@ enum { class MainWindow : public QMainWindow { + Q_OBJECT + public: MainWindow(const OptionsParser::Options &options); ~MainWindow(); +private Q_SLOTS: + void updateTitle(); + private: int openCamera(); @@ -43,6 +51,8 @@ private: int display(Buffer *buffer); QString title_; + QTimer titleTimer_; + const OptionsParser::Options &options_; std::shared_ptr camera_; @@ -51,6 +61,10 @@ private: uint64_t lastBufferTime_; + QElapsedTimer frameRateInterval_; + uint32_t previousFrames_; + uint32_t framesCaptured_; + ViewFinder *viewfinder_; }; -- cgit v1.2.1