[libcamera-devel] libcamera: stream: Document stride will be 0 for compressed formats
diff mbox series

Message ID 20230822131934.151781-1-umang.jain@ideasonboard.com
State Accepted
Commit ae9bcb2155957da3b6324676d706a901acb8343f
Headers show
Series
  • [libcamera-devel] libcamera: stream: Document stride will be 0 for compressed formats
Related show

Commit Message

Umang Jain Aug. 22, 2023, 1:19 p.m. UTC
For compressed formats, v4l2_pix_format.bytesperline value will be zero
and is documented similarly in the kernel. Since we set the stride to
v4l2_pix_format.bytesperline, document the case where it is expected
to be zero (i.e. if the format is compressed).

Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
---
 src/libcamera/stream.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Nicolas Dufresne Aug. 22, 2023, 7:19 p.m. UTC | #1
Le mardi 22 août 2023 à 18:49 +0530, Umang Jain via libcamera-devel a écrit :
> For compressed formats, v4l2_pix_format.bytesperline value will be zero
> and is documented similarly in the kernel. Since we set the stride to
> v4l2_pix_format.bytesperline, document the case where it is expected
> to be zero (i.e. if the format is compressed).
> 
> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>

Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>

> ---
>  src/libcamera/stream.cpp | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/src/libcamera/stream.cpp b/src/libcamera/stream.cpp
> index 272222b7..f3e00ead 100644
> --- a/src/libcamera/stream.cpp
> +++ b/src/libcamera/stream.cpp
> @@ -311,7 +311,8 @@ StreamConfiguration::StreamConfiguration(const StreamFormats &formats)
>   * The stride value reports the number of bytes between the beginning of
>   * successive lines in an image buffer for this stream. The value is
>   * valid after successfully validating the configuration with a call to
> - * CameraConfiguration::validate().
> + * CameraConfiguration::validate(). For compressed formats (such as MJPEG),
> + * this value will be zero.
>   */
>  
>  /**
Kieran Bingham Aug. 28, 2023, 3:04 p.m. UTC | #2
Quoting Umang Jain via libcamera-devel (2023-08-22 14:19:34)
> For compressed formats, v4l2_pix_format.bytesperline value will be zero
> and is documented similarly in the kernel. Since we set the stride to
> v4l2_pix_format.bytesperline, document the case where it is expected
> to be zero (i.e. if the format is compressed).

Sounds reasonable to me.


Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

> 
> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
> ---
>  src/libcamera/stream.cpp | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/src/libcamera/stream.cpp b/src/libcamera/stream.cpp
> index 272222b7..f3e00ead 100644
> --- a/src/libcamera/stream.cpp
> +++ b/src/libcamera/stream.cpp
> @@ -311,7 +311,8 @@ StreamConfiguration::StreamConfiguration(const StreamFormats &formats)
>   * The stride value reports the number of bytes between the beginning of
>   * successive lines in an image buffer for this stream. The value is
>   * valid after successfully validating the configuration with a call to
> - * CameraConfiguration::validate().
> + * CameraConfiguration::validate(). For compressed formats (such as MJPEG),
> + * this value will be zero.
>   */
>  
>  /**
> -- 
> 2.40.1
>

Patch
diff mbox series

diff --git a/src/libcamera/stream.cpp b/src/libcamera/stream.cpp
index 272222b7..f3e00ead 100644
--- a/src/libcamera/stream.cpp
+++ b/src/libcamera/stream.cpp
@@ -311,7 +311,8 @@  StreamConfiguration::StreamConfiguration(const StreamFormats &formats)
  * The stride value reports the number of bytes between the beginning of
  * successive lines in an image buffer for this stream. The value is
  * valid after successfully validating the configuration with a call to
- * CameraConfiguration::validate().
+ * CameraConfiguration::validate(). For compressed formats (such as MJPEG),
+ * this value will be zero.
  */
 
 /**