[libcamera-devel,v2,3/3] android: camera_stream: Add documentation
diff mbox series

Message ID 20201010095830.134084-4-jacopo@jmondi.org
State Accepted
Headers show
Series
  • android: Introduce CameraWorker
Related show

Commit Message

Jacopo Mondi Oct. 10, 2020, 9:58 a.m. UTC
Add a brief documentation block to the CameraStream class.

Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
---
 src/android/camera_stream.cpp | 21 +++++++++++++++++++++
 src/android/camera_stream.h   |  5 -----
 2 files changed, 21 insertions(+), 5 deletions(-)

Comments

Laurent Pinchart Oct. 11, 2020, 11:33 p.m. UTC | #1
Hi Jacopo,

Thank you for the patch.

On Sat, Oct 10, 2020 at 11:58:30AM +0200, Jacopo Mondi wrote:
> Add a brief documentation block to the CameraStream class.
> 
> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
> ---
>  src/android/camera_stream.cpp | 21 +++++++++++++++++++++
>  src/android/camera_stream.h   |  5 -----
>  2 files changed, 21 insertions(+), 5 deletions(-)
> 
> diff --git a/src/android/camera_stream.cpp b/src/android/camera_stream.cpp
> index eac1480530f8..d8e45c2a274d 100644
> --- a/src/android/camera_stream.cpp
> +++ b/src/android/camera_stream.cpp
> @@ -17,6 +17,27 @@ using namespace libcamera;
>  
>  LOG_DECLARE_CATEGORY(HAL);
>  
> +/*

/* or /** ? It doesn't matter much in practice as src/android/ is not
parsed by doxygen.

> + * \class CameraStream
> + * \brief Map a camera3_stream_t to a StreamConfiguration
> + *
> + * The CameraStream class maps a camera3_stream_t provided by Android
> + * camera framework to a libcamera::StreamConfiguration.
> + *
> + * The StreamConfiguration is represented by its index as recorded in the
> + * CameraConfiguration and not by pointer as StreamConfiguration is subject to
> + * relocation.
> + *
> + * A single StreamConfiguration may be used to deliver one or more streams to
> + * the Android framework. The mapping type between a camera3 stream to a
> + * StreamConfiguration is described by the CameraStream::Type.
> + *
> + * CameraStream handles all the aspects of producing a stream with the size
> + * and format requested by the camera3 stream from the data produced by
> + * the associated libcamera::Stream, including the creation of the encoder
> + * and buffer allocation.
> + */
> +

A useful addition for readers who are not familiar with the code.

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

>  CameraStream::CameraStream(CameraDevice *cameraDevice, Type type,
>  			   camera3_stream_t *camera3Stream, unsigned int index)
>  	: cameraDevice_(cameraDevice), type_(type),
> diff --git a/src/android/camera_stream.h b/src/android/camera_stream.h
> index 8df0101c403c..47f3fc61ac2c 100644
> --- a/src/android/camera_stream.h
> +++ b/src/android/camera_stream.h
> @@ -128,11 +128,6 @@ private:
>  	libcamera::CameraConfiguration *config_;
>  	Type type_;
>  	camera3_stream_t *camera3Stream_;
> -	/*
> -	 * The index of the libcamera StreamConfiguration as added during
> -	 * configureStreams(). A single libcamera Stream may be used to deliver
> -	 * one or more streams to the Android framework.
> -	 */
>  	unsigned int index_;
>  
>  	std::unique_ptr<Encoder> encoder_;
Niklas Söderlund Oct. 14, 2020, 12:07 p.m. UTC | #2
Hi Jacopo,

Thanks for your work.

On 2020-10-10 11:58:30 +0200, Jacopo Mondi wrote:
> Add a brief documentation block to the CameraStream class.
> 
> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>

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

> ---
>  src/android/camera_stream.cpp | 21 +++++++++++++++++++++
>  src/android/camera_stream.h   |  5 -----
>  2 files changed, 21 insertions(+), 5 deletions(-)
> 
> diff --git a/src/android/camera_stream.cpp b/src/android/camera_stream.cpp
> index eac1480530f8..d8e45c2a274d 100644
> --- a/src/android/camera_stream.cpp
> +++ b/src/android/camera_stream.cpp
> @@ -17,6 +17,27 @@ using namespace libcamera;
>  
>  LOG_DECLARE_CATEGORY(HAL);
>  
> +/*
> + * \class CameraStream
> + * \brief Map a camera3_stream_t to a StreamConfiguration
> + *
> + * The CameraStream class maps a camera3_stream_t provided by Android
> + * camera framework to a libcamera::StreamConfiguration.
> + *
> + * The StreamConfiguration is represented by its index as recorded in the
> + * CameraConfiguration and not by pointer as StreamConfiguration is subject to
> + * relocation.
> + *
> + * A single StreamConfiguration may be used to deliver one or more streams to
> + * the Android framework. The mapping type between a camera3 stream to a
> + * StreamConfiguration is described by the CameraStream::Type.
> + *
> + * CameraStream handles all the aspects of producing a stream with the size
> + * and format requested by the camera3 stream from the data produced by
> + * the associated libcamera::Stream, including the creation of the encoder
> + * and buffer allocation.
> + */
> +
>  CameraStream::CameraStream(CameraDevice *cameraDevice, Type type,
>  			   camera3_stream_t *camera3Stream, unsigned int index)
>  	: cameraDevice_(cameraDevice), type_(type),
> diff --git a/src/android/camera_stream.h b/src/android/camera_stream.h
> index 8df0101c403c..47f3fc61ac2c 100644
> --- a/src/android/camera_stream.h
> +++ b/src/android/camera_stream.h
> @@ -128,11 +128,6 @@ private:
>  	libcamera::CameraConfiguration *config_;
>  	Type type_;
>  	camera3_stream_t *camera3Stream_;
> -	/*
> -	 * The index of the libcamera StreamConfiguration as added during
> -	 * configureStreams(). A single libcamera Stream may be used to deliver
> -	 * one or more streams to the Android framework.
> -	 */
>  	unsigned int index_;
>  
>  	std::unique_ptr<Encoder> encoder_;
> -- 
> 2.28.0
> 
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel@lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel
Jacopo Mondi Oct. 14, 2020, 6:12 p.m. UTC | #3
Hi Laurent,

On Mon, Oct 12, 2020 at 02:33:08AM +0300, Laurent Pinchart wrote:
> Hi Jacopo,
>
> Thank you for the patch.
>
> On Sat, Oct 10, 2020 at 11:58:30AM +0200, Jacopo Mondi wrote:
> > Add a brief documentation block to the CameraStream class.
> >
> > Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
> > ---
> >  src/android/camera_stream.cpp | 21 +++++++++++++++++++++
> >  src/android/camera_stream.h   |  5 -----
> >  2 files changed, 21 insertions(+), 5 deletions(-)
> >
> > diff --git a/src/android/camera_stream.cpp b/src/android/camera_stream.cpp
> > index eac1480530f8..d8e45c2a274d 100644
> > --- a/src/android/camera_stream.cpp
> > +++ b/src/android/camera_stream.cpp
> > @@ -17,6 +17,27 @@ using namespace libcamera;
> >
> >  LOG_DECLARE_CATEGORY(HAL);
> >
> > +/*
>
> /* or /** ? It doesn't matter much in practice as src/android/ is not
> parsed by doxygen.
>

If I'm not mistaken we use /* in the HAL as, even if we retain the
doxygen syntax, it is not actually parsed by it.

> > + * \class CameraStream
> > + * \brief Map a camera3_stream_t to a StreamConfiguration
> > + *
> > + * The CameraStream class maps a camera3_stream_t provided by Android
> > + * camera framework to a libcamera::StreamConfiguration.
> > + *
> > + * The StreamConfiguration is represented by its index as recorded in the
> > + * CameraConfiguration and not by pointer as StreamConfiguration is subject to
> > + * relocation.
> > + *
> > + * A single StreamConfiguration may be used to deliver one or more streams to
> > + * the Android framework. The mapping type between a camera3 stream to a
> > + * StreamConfiguration is described by the CameraStream::Type.
> > + *
> > + * CameraStream handles all the aspects of producing a stream with the size
> > + * and format requested by the camera3 stream from the data produced by
> > + * the associated libcamera::Stream, including the creation of the encoder
> > + * and buffer allocation.
> > + */
> > +
>
> A useful addition for readers who are not familiar with the code.
>
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
>
> >  CameraStream::CameraStream(CameraDevice *cameraDevice, Type type,
> >  			   camera3_stream_t *camera3Stream, unsigned int index)
> >  	: cameraDevice_(cameraDevice), type_(type),
> > diff --git a/src/android/camera_stream.h b/src/android/camera_stream.h
> > index 8df0101c403c..47f3fc61ac2c 100644
> > --- a/src/android/camera_stream.h
> > +++ b/src/android/camera_stream.h
> > @@ -128,11 +128,6 @@ private:
> >  	libcamera::CameraConfiguration *config_;
> >  	Type type_;
> >  	camera3_stream_t *camera3Stream_;
> > -	/*
> > -	 * The index of the libcamera StreamConfiguration as added during
> > -	 * configureStreams(). A single libcamera Stream may be used to deliver
> > -	 * one or more streams to the Android framework.
> > -	 */
> >  	unsigned int index_;
> >
> >  	std::unique_ptr<Encoder> encoder_;
>
> --
> Regards,
>
> Laurent Pinchart

Patch
diff mbox series

diff --git a/src/android/camera_stream.cpp b/src/android/camera_stream.cpp
index eac1480530f8..d8e45c2a274d 100644
--- a/src/android/camera_stream.cpp
+++ b/src/android/camera_stream.cpp
@@ -17,6 +17,27 @@  using namespace libcamera;
 
 LOG_DECLARE_CATEGORY(HAL);
 
+/*
+ * \class CameraStream
+ * \brief Map a camera3_stream_t to a StreamConfiguration
+ *
+ * The CameraStream class maps a camera3_stream_t provided by Android
+ * camera framework to a libcamera::StreamConfiguration.
+ *
+ * The StreamConfiguration is represented by its index as recorded in the
+ * CameraConfiguration and not by pointer as StreamConfiguration is subject to
+ * relocation.
+ *
+ * A single StreamConfiguration may be used to deliver one or more streams to
+ * the Android framework. The mapping type between a camera3 stream to a
+ * StreamConfiguration is described by the CameraStream::Type.
+ *
+ * CameraStream handles all the aspects of producing a stream with the size
+ * and format requested by the camera3 stream from the data produced by
+ * the associated libcamera::Stream, including the creation of the encoder
+ * and buffer allocation.
+ */
+
 CameraStream::CameraStream(CameraDevice *cameraDevice, Type type,
 			   camera3_stream_t *camera3Stream, unsigned int index)
 	: cameraDevice_(cameraDevice), type_(type),
diff --git a/src/android/camera_stream.h b/src/android/camera_stream.h
index 8df0101c403c..47f3fc61ac2c 100644
--- a/src/android/camera_stream.h
+++ b/src/android/camera_stream.h
@@ -128,11 +128,6 @@  private:
 	libcamera::CameraConfiguration *config_;
 	Type type_;
 	camera3_stream_t *camera3Stream_;
-	/*
-	 * The index of the libcamera StreamConfiguration as added during
-	 * configureStreams(). A single libcamera Stream may be used to deliver
-	 * one or more streams to the Android framework.
-	 */
 	unsigned int index_;
 
 	std::unique_ptr<Encoder> encoder_;