[libcamera-devel,v2,5/7] test: Replace explicit DRM FourCCs with libcamera formats

Message ID 20200609232323.29628-6-laurent.pinchart@ideasonboard.com
State Accepted
Headers show
Series
  • Introduce formats:: namespace for libcamera pixel formats
Related show

Commit Message

Laurent Pinchart June 9, 2020, 11:23 p.m. UTC
Use the new pixel format constants to replace usage of macros from
drm_fourcc.h.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
---
 test/v4l2_videodevice/buffer_cache.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Niklas Söderlund June 10, 2020, 2:40 p.m. UTC | #1
Hi Laurent,

Thanks for your work.

On 2020-06-10 02:23:21 +0300, Laurent Pinchart wrote:
> Use the new pixel format constants to replace usage of macros from
> drm_fourcc.h.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

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

> ---
>  test/v4l2_videodevice/buffer_cache.cpp | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/test/v4l2_videodevice/buffer_cache.cpp b/test/v4l2_videodevice/buffer_cache.cpp
> index d730e7550377..b22de88e214c 100644
> --- a/test/v4l2_videodevice/buffer_cache.cpp
> +++ b/test/v4l2_videodevice/buffer_cache.cpp
> @@ -9,6 +9,7 @@
>  #include <random>
>  #include <vector>
>  
> +#include <libcamera/formats.h>
>  #include <libcamera/stream.h>
>  
>  #include "buffer_source.h"
> @@ -142,7 +143,7 @@ public:
>  		const unsigned int numBuffers = 8;
>  
>  		StreamConfiguration cfg;
> -		cfg.pixelFormat = PixelFormat(DRM_FORMAT_YUYV);
> +		cfg.pixelFormat = formats::YUYV;
>  		cfg.size = Size(600, 800);
>  		cfg.bufferCount = numBuffers;
>  
> -- 
> Regards,
> 
> Laurent Pinchart
> 
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel@lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel

Patch

diff --git a/test/v4l2_videodevice/buffer_cache.cpp b/test/v4l2_videodevice/buffer_cache.cpp
index d730e7550377..b22de88e214c 100644
--- a/test/v4l2_videodevice/buffer_cache.cpp
+++ b/test/v4l2_videodevice/buffer_cache.cpp
@@ -9,6 +9,7 @@ 
 #include <random>
 #include <vector>
 
+#include <libcamera/formats.h>
 #include <libcamera/stream.h>
 
 #include "buffer_source.h"
@@ -142,7 +143,7 @@  public:
 		const unsigned int numBuffers = 8;
 
 		StreamConfiguration cfg;
-		cfg.pixelFormat = PixelFormat(DRM_FORMAT_YUYV);
+		cfg.pixelFormat = formats::YUYV;
 		cfg.size = Size(600, 800);
 		cfg.bufferCount = numBuffers;