[v3,01/16] libcamera: lc-compliance: Add controls param to start() function
diff mbox series

Message ID 20240319120517.362082-2-stefan.klug@ideasonboard.com
State New
Headers show
Series
  • Preparation for per-frame-controls and initial tests
Related show

Commit Message

Stefan Klug March 19, 2024, 12:05 p.m. UTC
This is needed for tests that need to pass controls to
Camera::start().

Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>
---
 src/apps/lc-compliance/simple_capture.cpp | 4 ++--
 src/apps/lc-compliance/simple_capture.h   | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

Comments

Jacopo Mondi March 21, 2024, 9:31 a.m. UTC | #1
Hi Stefan,

On Tue, Mar 19, 2024 at 01:05:02PM +0100, Stefan Klug wrote:
> This is needed for tests that need to pass controls to
> Camera::start().
>
> Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>

You forgot to collect tags maybe
Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>

> ---
>  src/apps/lc-compliance/simple_capture.cpp | 4 ++--
>  src/apps/lc-compliance/simple_capture.h   | 2 +-
>  2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/src/apps/lc-compliance/simple_capture.cpp b/src/apps/lc-compliance/simple_capture.cpp
> index cf4d7cf3..56680a83 100644
> --- a/src/apps/lc-compliance/simple_capture.cpp
> +++ b/src/apps/lc-compliance/simple_capture.cpp
> @@ -42,7 +42,7 @@ void SimpleCapture::configure(StreamRole role)
>  	}
>  }
>
> -void SimpleCapture::start()
> +void SimpleCapture::start(const ControlList *controls)
>  {
>  	Stream *stream = config_->at(0).stream();
>  	int count = allocator_->allocate(stream);
> @@ -52,7 +52,7 @@ void SimpleCapture::start()
>
>  	camera_->requestCompleted.connect(this, &SimpleCapture::requestComplete);
>
> -	ASSERT_EQ(camera_->start(), 0) << "Failed to start camera";
> +	ASSERT_EQ(camera_->start(controls), 0) << "Failed to start camera";
>  }
>
>  void SimpleCapture::stop()
> diff --git a/src/apps/lc-compliance/simple_capture.h b/src/apps/lc-compliance/simple_capture.h
> index 2911d601..54b1d54b 100644
> --- a/src/apps/lc-compliance/simple_capture.h
> +++ b/src/apps/lc-compliance/simple_capture.h
> @@ -22,7 +22,7 @@ protected:
>  	SimpleCapture(std::shared_ptr<libcamera::Camera> camera);
>  	virtual ~SimpleCapture();
>
> -	void start();
> +	void start(const libcamera::ControlList *controls = nullptr);
>  	void stop();
>
>  	virtual void requestComplete(libcamera::Request *request) = 0;
> --
> 2.40.1
>
Stefan Klug March 21, 2024, 9:41 a.m. UTC | #2
Hi Jacopo,

On Thu, Mar 21, 2024 at 10:31:56AM +0100, Jacopo Mondi wrote:
> Hi Stefan,
> 
> On Tue, Mar 19, 2024 at 01:05:02PM +0100, Stefan Klug wrote:
> > This is needed for tests that need to pass controls to
> > Camera::start().
> >
> > Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>
> 
> You forgot to collect tags maybe
> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>

Sorry for that. Kieran already noticed. It's fixed in v4

Stefan

> 
> > ---
> >  src/apps/lc-compliance/simple_capture.cpp | 4 ++--
> >  src/apps/lc-compliance/simple_capture.h   | 2 +-
> >  2 files changed, 3 insertions(+), 3 deletions(-)
> >
> > diff --git a/src/apps/lc-compliance/simple_capture.cpp b/src/apps/lc-compliance/simple_capture.cpp
> > index cf4d7cf3..56680a83 100644
> > --- a/src/apps/lc-compliance/simple_capture.cpp
> > +++ b/src/apps/lc-compliance/simple_capture.cpp
> > @@ -42,7 +42,7 @@ void SimpleCapture::configure(StreamRole role)
> >  	}
> >  }
> >
> > -void SimpleCapture::start()
> > +void SimpleCapture::start(const ControlList *controls)
> >  {
> >  	Stream *stream = config_->at(0).stream();
> >  	int count = allocator_->allocate(stream);
> > @@ -52,7 +52,7 @@ void SimpleCapture::start()
> >
> >  	camera_->requestCompleted.connect(this, &SimpleCapture::requestComplete);
> >
> > -	ASSERT_EQ(camera_->start(), 0) << "Failed to start camera";
> > +	ASSERT_EQ(camera_->start(controls), 0) << "Failed to start camera";
> >  }
> >
> >  void SimpleCapture::stop()
> > diff --git a/src/apps/lc-compliance/simple_capture.h b/src/apps/lc-compliance/simple_capture.h
> > index 2911d601..54b1d54b 100644
> > --- a/src/apps/lc-compliance/simple_capture.h
> > +++ b/src/apps/lc-compliance/simple_capture.h
> > @@ -22,7 +22,7 @@ protected:
> >  	SimpleCapture(std::shared_ptr<libcamera::Camera> camera);
> >  	virtual ~SimpleCapture();
> >
> > -	void start();
> > +	void start(const libcamera::ControlList *controls = nullptr);
> >  	void stop();
> >
> >  	virtual void requestComplete(libcamera::Request *request) = 0;
> > --
> > 2.40.1
> >

Patch
diff mbox series

diff --git a/src/apps/lc-compliance/simple_capture.cpp b/src/apps/lc-compliance/simple_capture.cpp
index cf4d7cf3..56680a83 100644
--- a/src/apps/lc-compliance/simple_capture.cpp
+++ b/src/apps/lc-compliance/simple_capture.cpp
@@ -42,7 +42,7 @@  void SimpleCapture::configure(StreamRole role)
 	}
 }
 
-void SimpleCapture::start()
+void SimpleCapture::start(const ControlList *controls)
 {
 	Stream *stream = config_->at(0).stream();
 	int count = allocator_->allocate(stream);
@@ -52,7 +52,7 @@  void SimpleCapture::start()
 
 	camera_->requestCompleted.connect(this, &SimpleCapture::requestComplete);
 
-	ASSERT_EQ(camera_->start(), 0) << "Failed to start camera";
+	ASSERT_EQ(camera_->start(controls), 0) << "Failed to start camera";
 }
 
 void SimpleCapture::stop()
diff --git a/src/apps/lc-compliance/simple_capture.h b/src/apps/lc-compliance/simple_capture.h
index 2911d601..54b1d54b 100644
--- a/src/apps/lc-compliance/simple_capture.h
+++ b/src/apps/lc-compliance/simple_capture.h
@@ -22,7 +22,7 @@  protected:
 	SimpleCapture(std::shared_ptr<libcamera::Camera> camera);
 	virtual ~SimpleCapture();
 
-	void start();
+	void start(const libcamera::ControlList *controls = nullptr);
 	void stop();
 
 	virtual void requestComplete(libcamera::Request *request) = 0;