[libcamera-devel,v2,14/20] libcamera: ipu3: Remove streams from IPU3CameraConfiguration

Message ID 20200709084128.5316-15-jacopo@jmondi.org
State Accepted
Headers show
Series
  • libcamera: ipu3: Rework configuration
Related show

Commit Message

Jacopo Mondi July 9, 2020, 8:41 a.m. UTC
The IPU3CameraConfiguration::streams_ field was used to keep an
association between the StreamConfiguration and the assigned streams
before CameraConfiguration::setStream() was called at configure() time.

The stream assignment was based on the order in which elements were
inserted in the vector, implementing a fragile association between
streams and their intended configurations.

As it is now possible to assign streams at validation time, there is no
need to keep that association in place, and the streams_ vector is now
unused.

Remove it and the associated accessor method from the
IPU3CameraConfiguration class.

Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
---
 src/libcamera/pipeline/ipu3/ipu3.cpp | 2 --
 1 file changed, 2 deletions(-)

Comments

Laurent Pinchart July 10, 2020, 12:11 p.m. UTC | #1
Hi Jacopo,

Thank you for the patch.

On Thu, Jul 09, 2020 at 10:41:22AM +0200, Jacopo Mondi wrote:
> The IPU3CameraConfiguration::streams_ field was used to keep an
> association between the StreamConfiguration and the assigned streams
> before CameraConfiguration::setStream() was called at configure() time.
> 
> The stream assignment was based on the order in which elements were
> inserted in the vector, implementing a fragile association between
> streams and their intended configurations.
> 
> As it is now possible to assign streams at validation time, there is no
> need to keep that association in place, and the streams_ vector is now
> unused.
> 
> Remove it and the associated accessor method from the
> IPU3CameraConfiguration class.
> 
> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  src/libcamera/pipeline/ipu3/ipu3.cpp | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp
> index 9fed6c1e5aa7..1c6627e561c4 100644
> --- a/src/libcamera/pipeline/ipu3/ipu3.cpp
> +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp
> @@ -66,7 +66,6 @@ public:
>  	Status validate() override;
>  
>  	const StreamConfiguration &cio2Format() const { return cio2Configuration_; };
> -	const std::vector<const Stream *> &streams() { return streams_; }
>  
>  private:
>  	/*
> @@ -78,7 +77,6 @@ private:
>  	IPU3CameraData *data_;
>  
>  	StreamConfiguration cio2Configuration_;
> -	std::vector<const Stream *> streams_;
>  };
>  
>  class PipelineHandlerIPU3 : public PipelineHandler

Patch

diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp
index 9fed6c1e5aa7..1c6627e561c4 100644
--- a/src/libcamera/pipeline/ipu3/ipu3.cpp
+++ b/src/libcamera/pipeline/ipu3/ipu3.cpp
@@ -66,7 +66,6 @@  public:
 	Status validate() override;
 
 	const StreamConfiguration &cio2Format() const { return cio2Configuration_; };
-	const std::vector<const Stream *> &streams() { return streams_; }
 
 private:
 	/*
@@ -78,7 +77,6 @@  private:
 	IPU3CameraData *data_;
 
 	StreamConfiguration cio2Configuration_;
-	std::vector<const Stream *> streams_;
 };
 
 class PipelineHandlerIPU3 : public PipelineHandler