[libcamera-devel] QCam: Swich default stream role to viewfinder.

Message ID 20200131095245.25906-1-naush@raspberrypi.com
State Accepted
Commit 8ce24bebbf177136b1a5640287239644e98c4b52
Headers show
Series
  • [libcamera-devel] QCam: Swich default stream role to viewfinder.
Related show

Commit Message

Naushir Patuck Jan. 31, 2020, 9:52 a.m. UTC
From: Naushir Patuck <naush@raspberrypi.com>

QCam currently only displays a standard viewfinder.  As such set the
StreamRole parameter to Viewfinder so that the pipeline handlers can
setup the appropriate resolutions and formats.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
---
 src/qcam/main_window.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Kieran Bingham Jan. 31, 2020, 10:02 a.m. UTC | #1
Hi Naush,

Thank you for the patch,

On 31/01/2020 09:52, naush@raspberrypi.com wrote:
> From: Naushir Patuck <naush@raspberrypi.com>
> 
> QCam currently only displays a standard viewfinder.  As such set the
> StreamRole parameter to Viewfinder so that the pipeline handlers can
> setup the appropriate resolutions and formats.

I agree, this makes sense as a sane starting condition.

In the future we can add controls and support to QCam for selecting this
mode at application runtime too, but certainly starting the Viewfinder
up as a Viewfinder sounds perfectly reasonable to me.

> Signed-off-by: Naushir Patuck <naush@raspberrypi.com>

Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

> ---
>  src/qcam/main_window.cpp | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/qcam/main_window.cpp b/src/qcam/main_window.cpp
> index df51fa8..70a3e61 100644
> --- a/src/qcam/main_window.cpp
> +++ b/src/qcam/main_window.cpp
> @@ -125,7 +125,7 @@ int MainWindow::startCapture()
>  {
>  	int ret;
>  
> -	config_ = camera_->generateConfiguration({ StreamRole::VideoRecording });
> +	config_ = camera_->generateConfiguration({ StreamRole::Viewfinder });
>  
>  	StreamConfiguration &cfg = config_->at(0);
>  	if (options_.isSet(OptSize)) {
>
Niklas Söderlund Feb. 10, 2020, 9:21 p.m. UTC | #2
Hi Naushir,

Thanks for your patch.

On 2020-01-31 09:52:45 +0000, naush@raspberrypi.com wrote:
> From: Naushir Patuck <naush@raspberrypi.com>
> 
> QCam currently only displays a standard viewfinder.  As such set the
> StreamRole parameter to Viewfinder so that the pipeline handlers can
> setup the appropriate resolutions and formats.
> 
> Signed-off-by: Naushir Patuck <naush@raspberrypi.com>

Small nit for the patch subject,

- Please use qcam: instead of QCam:
- s/Swich/Switch/
- Drop the period (.) at the end of the subject line

With these small things fixed,

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

> ---
>  src/qcam/main_window.cpp | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/qcam/main_window.cpp b/src/qcam/main_window.cpp
> index df51fa8..70a3e61 100644
> --- a/src/qcam/main_window.cpp
> +++ b/src/qcam/main_window.cpp
> @@ -125,7 +125,7 @@ int MainWindow::startCapture()
>  {
>  	int ret;
>  
> -	config_ = camera_->generateConfiguration({ StreamRole::VideoRecording });
> +	config_ = camera_->generateConfiguration({ StreamRole::Viewfinder });
>  
>  	StreamConfiguration &cfg = config_->at(0);
>  	if (options_.isSet(OptSize)) {
> -- 
> 2.17.1
> 
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel@lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel

Patch

diff --git a/src/qcam/main_window.cpp b/src/qcam/main_window.cpp
index df51fa8..70a3e61 100644
--- a/src/qcam/main_window.cpp
+++ b/src/qcam/main_window.cpp
@@ -125,7 +125,7 @@  int MainWindow::startCapture()
 {
 	int ret;
 
-	config_ = camera_->generateConfiguration({ StreamRole::VideoRecording });
+	config_ = camera_->generateConfiguration({ StreamRole::Viewfinder });
 
 	StreamConfiguration &cfg = config_->at(0);
 	if (options_.isSet(OptSize)) {