[libcamera-devel,09/15] libcamera: ipu3: Remove streams from IPU3CameraConfiguration

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

Commit Message

Jacopo Mondi July 1, 2020, 12:30 p.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 stream assignment now happens at configure() 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.

Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
---
 src/libcamera/pipeline/ipu3/ipu3.cpp | 2 --
 1 file changed, 2 deletions(-)

Comments

Niklas Söderlund July 1, 2020, 4:49 p.m. UTC | #1
Hi Jacopo,

Thanks for your work.

On 2020-07-01 14:30:30 +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 stream assignment now happens at configure() 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.
> 
> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>

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

> ---
>  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 8f75c5186b13..4d70f9e3a30c 100644
> --- a/src/libcamera/pipeline/ipu3/ipu3.cpp
> +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp
> @@ -64,7 +64,6 @@ public:
>  	Status validate() override;
>  
>  	const StreamConfiguration &cio2Format() const { return cio2Configuration_; };
> -	const std::vector<const Stream *> &streams() { return streams_; }
>  
>  private:
>  	/*
> @@ -76,7 +75,6 @@ private:
>  	const IPU3CameraData *data_;
>  
>  	StreamConfiguration cio2Configuration_;
> -	std::vector<const Stream *> streams_;
>  };
>  
>  class PipelineHandlerIPU3 : public PipelineHandler
> -- 
> 2.27.0
> 
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel@lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel

Patch

diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp
index 8f75c5186b13..4d70f9e3a30c 100644
--- a/src/libcamera/pipeline/ipu3/ipu3.cpp
+++ b/src/libcamera/pipeline/ipu3/ipu3.cpp
@@ -64,7 +64,6 @@  public:
 	Status validate() override;
 
 	const StreamConfiguration &cio2Format() const { return cio2Configuration_; };
-	const std::vector<const Stream *> &streams() { return streams_; }
 
 private:
 	/*
@@ -76,7 +75,6 @@  private:
 	const IPU3CameraData *data_;
 
 	StreamConfiguration cio2Configuration_;
-	std::vector<const Stream *> streams_;
 };
 
 class PipelineHandlerIPU3 : public PipelineHandler