[libcamera-devel,RFC,1/3] Added statusbar to show the camera stream configuration

Message ID 20200320085029.17875-2-show.liu@linaro.org
State Superseded
Headers show
Series
  • Add an option to enable rendering YUV frame by OpenGL shader
Related show

Commit Message

Show Liu March 20, 2020, 8:50 a.m. UTC
qcam: Added statusbar to show the camera stream information

Signed-off-by: Show Liu <show.liu@linaro.org>
---
 src/qcam/main_window.cpp | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Niklas Söderlund March 20, 2020, 1:59 p.m. UTC | #1
Hi Show,

Thanks for your work.

On 2020-03-20 16:50:27 +0800, Show Liu wrote:
> qcam: Added statusbar to show the camera stream information
> 
> Signed-off-by: Show Liu <show.liu@linaro.org>

Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>

> ---
>  src/qcam/main_window.cpp | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/src/qcam/main_window.cpp b/src/qcam/main_window.cpp
> index ae1760d..98e55ba 100644
> --- a/src/qcam/main_window.cpp
> +++ b/src/qcam/main_window.cpp
> @@ -21,6 +21,7 @@
>  #include <QTimer>
>  #include <QToolBar>
>  #include <QToolButton>
> +#include <QStatusBar>
>  
>  #include <libcamera/camera_manager.h>
>  #include <libcamera/version.h>
> @@ -238,6 +239,8 @@ int MainWindow::startCapture()
>  		return ret;
>  	}
>  
> +	statusBar()->showMessage(QString(cfg.toString().c_str()));
> +
>  	adjustSize();
>  
>  	allocator_ = FrameBufferAllocator::create(camera_);
> @@ -342,6 +345,8 @@ void MainWindow::stopCapture()
>  
>  	config_.reset();
>  
> +	statusBar()->clearMessage();
> +
>  	titleTimer_.stop();
>  	setWindowTitle(title_);
>  }
> -- 
> 2.20.1
> 
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel@lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel
Laurent Pinchart March 20, 2020, 2:41 p.m. UTC | #2
Hi Show,

Thank you for the patch.

On Fri, Mar 20, 2020 at 04:50:27PM +0800, Show Liu wrote:
> qcam: Added statusbar to show the camera stream information

This should be the subject line :-)

s/statusbar/status bar/

> Signed-off-by: Show Liu <show.liu@linaro.org>
> ---
>  src/qcam/main_window.cpp | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/src/qcam/main_window.cpp b/src/qcam/main_window.cpp
> index ae1760d..98e55ba 100644
> --- a/src/qcam/main_window.cpp
> +++ b/src/qcam/main_window.cpp
> @@ -21,6 +21,7 @@
>  #include <QTimer>
>  #include <QToolBar>
>  #include <QToolButton>
> +#include <QStatusBar>

Please keep headers sorted alphabetically.

>  
>  #include <libcamera/camera_manager.h>
>  #include <libcamera/version.h>
> @@ -238,6 +239,8 @@ int MainWindow::startCapture()
>  		return ret;
>  	}
>  
> +	statusBar()->showMessage(QString(cfg.toString().c_str()));
> +

Shouldn't we create the status bar when creating the main window, to
avoid its magical apparition when starting the stream ? I would then
store it in the MainWindow class to avoid retrieving it from Qt every
time.

>  	adjustSize();
>  
>  	allocator_ = FrameBufferAllocator::create(camera_);
> @@ -342,6 +345,8 @@ void MainWindow::stopCapture()
>  
>  	config_.reset();
>  
> +	statusBar()->clearMessage();
> +
>  	titleTimer_.stop();
>  	setWindowTitle(title_);
>  }

Patch

diff --git a/src/qcam/main_window.cpp b/src/qcam/main_window.cpp
index ae1760d..98e55ba 100644
--- a/src/qcam/main_window.cpp
+++ b/src/qcam/main_window.cpp
@@ -21,6 +21,7 @@ 
 #include <QTimer>
 #include <QToolBar>
 #include <QToolButton>
+#include <QStatusBar>
 
 #include <libcamera/camera_manager.h>
 #include <libcamera/version.h>
@@ -238,6 +239,8 @@  int MainWindow::startCapture()
 		return ret;
 	}
 
+	statusBar()->showMessage(QString(cfg.toString().c_str()));
+
 	adjustSize();
 
 	allocator_ = FrameBufferAllocator::create(camera_);
@@ -342,6 +345,8 @@  void MainWindow::stopCapture()
 
 	config_.reset();
 
+	statusBar()->clearMessage();
+
 	titleTimer_.stop();
 	setWindowTitle(title_);
 }