[libcamera-devel,2/7] cam: Add option to capture StillCaptureRaw stream

Message ID 20200324155145.3896183-3-niklas.soderlund@ragnatech.se
State Superseded
Headers show
Series
  • libcamera: Add support for a RAW still capture
Related show

Commit Message

Niklas Söderlund March 24, 2020, 3:51 p.m. UTC
Add a role name 'stillraw' to request a StillCaptureRaw stream.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 src/cam/main.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Laurent Pinchart March 24, 2020, 4:35 p.m. UTC | #1
Hi Niklas,

On Tue, Mar 24, 2020 at 04:51:40PM +0100, Niklas Söderlund wrote:
> Add a role name 'stillraw' to request a StillCaptureRaw stream.
> 
> Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
>  src/cam/main.cpp | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/src/cam/main.cpp b/src/cam/main.cpp
> index 7cdd215ba5398aec..4ef9cce2c97caddd 100644
> --- a/src/cam/main.cpp
> +++ b/src/cam/main.cpp
> @@ -155,7 +155,7 @@ int CamApp::parseOptions(int argc, char *argv[])
>  {
>  	KeyValueParser streamKeyValue;
>  	streamKeyValue.addOption("role", OptionString,
> -				 "Role for the stream (viewfinder, video, still)",
> +				 "Role for the stream (viewfinder, video, still, stillraw)",
>  				 ArgumentRequired);
>  	streamKeyValue.addOption("width", OptionInteger, "Width in pixels",
>  				 ArgumentRequired);
> @@ -219,6 +219,8 @@ int CamApp::prepareConfig()
>  				roles.push_back(StreamRole::VideoRecording);
>  			} else if (role == "still") {
>  				roles.push_back(StreamRole::StillCapture);
> +			} else if (opt["role"].toString() == "stillraw") {

			} else if (role == "stillraw") {

Sorry for making master move too fast :-)

> +				roles.push_back(StreamRole::StillCaptureRaw);
>  			} else {
>  				std::cerr << "Unknown stream role "
>  					  << role << std::endl;

Patch

diff --git a/src/cam/main.cpp b/src/cam/main.cpp
index 7cdd215ba5398aec..4ef9cce2c97caddd 100644
--- a/src/cam/main.cpp
+++ b/src/cam/main.cpp
@@ -155,7 +155,7 @@  int CamApp::parseOptions(int argc, char *argv[])
 {
 	KeyValueParser streamKeyValue;
 	streamKeyValue.addOption("role", OptionString,
-				 "Role for the stream (viewfinder, video, still)",
+				 "Role for the stream (viewfinder, video, still, stillraw)",
 				 ArgumentRequired);
 	streamKeyValue.addOption("width", OptionInteger, "Width in pixels",
 				 ArgumentRequired);
@@ -219,6 +219,8 @@  int CamApp::prepareConfig()
 				roles.push_back(StreamRole::VideoRecording);
 			} else if (role == "still") {
 				roles.push_back(StreamRole::StillCapture);
+			} else if (opt["role"].toString() == "stillraw") {
+				roles.push_back(StreamRole::StillCaptureRaw);
 			} else {
 				std::cerr << "Unknown stream role "
 					  << role << std::endl;