[libcamera-devel,v5,1/7] libcamera: stream: Make Stream inheritable

Message ID 20190415231859.9747-2-jacopo@jmondi.org
State Superseded
Headers show
Series
  • libcamera: Framework changes to prepare for multiple streams support
Related show

Commit Message

Jacopo Mondi April 15, 2019, 11:18 p.m. UTC
In preparation for multiple streams support prepare to allow sub-classing
the Stream class by removing the 'final' specifier from the class
definition and make its private members protected.

Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
---
 include/libcamera/stream.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Niklas Söderlund April 15, 2019, 11:36 p.m. UTC | #1
Hi Jacopo,

Thanks for your work.

On 2019-04-16 01:18:53 +0200, Jacopo Mondi wrote:
> In preparation for multiple streams support prepare to allow sub-classing
> the Stream class by removing the 'final' specifier from the class
> definition and make its private members protected.
> 
> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>

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

> ---
>  include/libcamera/stream.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/include/libcamera/stream.h b/include/libcamera/stream.h
> index d0f7b0e12485..8a47930f8614 100644
> --- a/include/libcamera/stream.h
> +++ b/include/libcamera/stream.h
> @@ -43,7 +43,7 @@ private:
>  	Size size_;
>  };
>  
> -class Stream final
> +class Stream
>  {
>  public:
>  	class StillCapture : public StreamUsage
> @@ -68,7 +68,7 @@ public:
>  	BufferPool &bufferPool() { return bufferPool_; }
>  	const StreamConfiguration &configuration() const { return configuration_; }
>  
> -private:
> +protected:
>  	friend class Camera;
>  
>  	BufferPool bufferPool_;
> -- 
> 2.21.0
> 
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel@lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel
Laurent Pinchart April 16, 2019, 10:53 a.m. UTC | #2
Hi Jacopo,

Thank you for the patch.

On Tue, Apr 16, 2019 at 01:18:53AM +0200, Jacopo Mondi wrote:
> In preparation for multiple streams support prepare to allow sub-classing
> the Stream class by removing the 'final' specifier from the class
> definition and make its private members protected.
> 
> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>

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

> ---
>  include/libcamera/stream.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/include/libcamera/stream.h b/include/libcamera/stream.h
> index d0f7b0e12485..8a47930f8614 100644
> --- a/include/libcamera/stream.h
> +++ b/include/libcamera/stream.h
> @@ -43,7 +43,7 @@ private:
>  	Size size_;
>  };
>  
> -class Stream final
> +class Stream
>  {
>  public:
>  	class StillCapture : public StreamUsage
> @@ -68,7 +68,7 @@ public:
>  	BufferPool &bufferPool() { return bufferPool_; }
>  	const StreamConfiguration &configuration() const { return configuration_; }
>  
> -private:
> +protected:
>  	friend class Camera;
>  
>  	BufferPool bufferPool_;

Patch

diff --git a/include/libcamera/stream.h b/include/libcamera/stream.h
index d0f7b0e12485..8a47930f8614 100644
--- a/include/libcamera/stream.h
+++ b/include/libcamera/stream.h
@@ -43,7 +43,7 @@  private:
 	Size size_;
 };
 
-class Stream final
+class Stream
 {
 public:
 	class StillCapture : public StreamUsage
@@ -68,7 +68,7 @@  public:
 	BufferPool &bufferPool() { return bufferPool_; }
 	const StreamConfiguration &configuration() const { return configuration_; }
 
-private:
+protected:
 	friend class Camera;
 
 	BufferPool bufferPool_;