[libcamera-devel] [PATCH/RFC 01/11] libcamera: Rename pixelformats.{cpp, h} to pixel_format.{cpp, h}

Niklas Söderlund niklas.soderlund at ragnatech.se
Fri Jun 5 21:57:34 CEST 2020


Hi Laurent,

Thanks for your patch.

On 2020-05-22 17:54:48 +0300, Laurent Pinchart wrote:
> The libcamera source files are named after class names, using
> snake_case. pixelformats.h and pixelformats.cpp don't comply with that
> rule. Fix them.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>

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

> ---
>  include/libcamera/internal/formats.h                 | 2 +-
>  include/libcamera/internal/v4l2_pixelformat.h        | 2 +-
>  include/libcamera/internal/v4l2_videodevice.h        | 2 +-
>  include/libcamera/meson.build                        | 2 +-
>  include/libcamera/{pixelformats.h => pixel_format.h} | 8 ++++----
>  include/libcamera/stream.h                           | 2 +-
>  src/libcamera/meson.build                            | 2 +-
>  src/libcamera/pipeline/simple/converter.h            | 2 +-
>  src/libcamera/{pixelformats.cpp => pixel_format.cpp} | 8 ++++----
>  src/libcamera/v4l2_pixelformat.cpp                   | 2 +-
>  src/qcam/format_converter.h                          | 2 +-
>  src/qcam/viewfinder.h                                | 2 +-
>  12 files changed, 18 insertions(+), 18 deletions(-)
>  rename include/libcamera/{pixelformats.h => pixel_format.h} (82%)
>  rename src/libcamera/{pixelformats.cpp => pixel_format.cpp} (95%)
> 
> diff --git a/include/libcamera/internal/formats.h b/include/libcamera/internal/formats.h
> index 4092a93ef973..4455b0f9b050 100644
> --- a/include/libcamera/internal/formats.h
> +++ b/include/libcamera/internal/formats.h
> @@ -12,7 +12,7 @@
>  #include <vector>
>  
>  #include <libcamera/geometry.h>
> -#include <libcamera/pixelformats.h>
> +#include <libcamera/pixel_format.h>
>  
>  #include "libcamera/internal/v4l2_pixelformat.h"
>  
> diff --git a/include/libcamera/internal/v4l2_pixelformat.h b/include/libcamera/internal/v4l2_pixelformat.h
> index 0fe8a017de34..4d0e034b8b51 100644
> --- a/include/libcamera/internal/v4l2_pixelformat.h
> +++ b/include/libcamera/internal/v4l2_pixelformat.h
> @@ -13,7 +13,7 @@
>  
>  #include <linux/videodev2.h>
>  
> -#include <libcamera/pixelformats.h>
> +#include <libcamera/pixel_format.h>
>  
>  namespace libcamera {
>  
> diff --git a/include/libcamera/internal/v4l2_videodevice.h b/include/libcamera/internal/v4l2_videodevice.h
> index dc259523599c..c93cf816373b 100644
> --- a/include/libcamera/internal/v4l2_videodevice.h
> +++ b/include/libcamera/internal/v4l2_videodevice.h
> @@ -17,7 +17,7 @@
>  
>  #include <libcamera/buffer.h>
>  #include <libcamera/geometry.h>
> -#include <libcamera/pixelformats.h>
> +#include <libcamera/pixel_format.h>
>  #include <libcamera/signal.h>
>  
>  #include "libcamera/internal/formats.h"
> diff --git a/include/libcamera/meson.build b/include/libcamera/meson.build
> index 27760c19f9b9..73c5b999acf4 100644
> --- a/include/libcamera/meson.build
> +++ b/include/libcamera/meson.build
> @@ -13,7 +13,7 @@ libcamera_public_headers = files([
>      'geometry.h',
>      'logging.h',
>      'object.h',
> -    'pixelformats.h',
> +    'pixel_format.h',
>      'request.h',
>      'signal.h',
>      'span.h',
> diff --git a/include/libcamera/pixelformats.h b/include/libcamera/pixel_format.h
> similarity index 82%
> rename from include/libcamera/pixelformats.h
> rename to include/libcamera/pixel_format.h
> index 89966e5e664c..e3b371ef92bb 100644
> --- a/include/libcamera/pixelformats.h
> +++ b/include/libcamera/pixel_format.h
> @@ -2,10 +2,10 @@
>  /*
>   * Copyright (C) 2019, Google Inc.
>   *
> - * pixelformats.h - libcamera pixel formats
> + * pixel_format.h - libcamera Pixel Format
>   */
> -#ifndef __LIBCAMERA_PIXEL_FORMATS_H__
> -#define __LIBCAMERA_PIXEL_FORMATS_H__
> +#ifndef __LIBCAMERA_PIXEL_FORMAT_H__
> +#define __LIBCAMERA_PIXEL_FORMAT_H__
>  
>  #include <set>
>  #include <stdint.h>
> @@ -40,4 +40,4 @@ private:
>  
>  } /* namespace libcamera */
>  
> -#endif /* __LIBCAMERA_PIXEL_FORMATS_H__ */
> +#endif /* __LIBCAMERA_PIXEL_FORMAT_H__ */
> diff --git a/include/libcamera/stream.h b/include/libcamera/stream.h
> index b3cbea3d5229..1a68bd23a81a 100644
> --- a/include/libcamera/stream.h
> +++ b/include/libcamera/stream.h
> @@ -14,7 +14,7 @@
>  
>  #include <libcamera/buffer.h>
>  #include <libcamera/geometry.h>
> -#include <libcamera/pixelformats.h>
> +#include <libcamera/pixel_format.h>
>  
>  namespace libcamera {
>  
> diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build
> index b88f295d251d..611fc061e1cf 100644
> --- a/src/libcamera/meson.build
> +++ b/src/libcamera/meson.build
> @@ -34,7 +34,7 @@ libcamera_sources = files([
>      'message.cpp',
>      'object.cpp',
>      'pipeline_handler.cpp',
> -    'pixelformats.cpp',
> +    'pixel_format.cpp',
>      'process.cpp',
>      'pub_key.cpp',
>      'request.cpp',
> diff --git a/src/libcamera/pipeline/simple/converter.h b/src/libcamera/pipeline/simple/converter.h
> index 1f770eb844b5..ef18cf73a2ed 100644
> --- a/src/libcamera/pipeline/simple/converter.h
> +++ b/src/libcamera/pipeline/simple/converter.h
> @@ -12,7 +12,7 @@
>  #include <queue>
>  #include <vector>
>  
> -#include <libcamera/pixelformats.h>
> +#include <libcamera/pixel_format.h>
>  #include <libcamera/signal.h>
>  
>  namespace libcamera {
> diff --git a/src/libcamera/pixelformats.cpp b/src/libcamera/pixel_format.cpp
> similarity index 95%
> rename from src/libcamera/pixelformats.cpp
> rename to src/libcamera/pixel_format.cpp
> index 1330dc5ab3d9..d8718739152d 100644
> --- a/src/libcamera/pixelformats.cpp
> +++ b/src/libcamera/pixel_format.cpp
> @@ -2,14 +2,14 @@
>  /*
>   * Copyright (C) 2019, Google Inc.
>   *
> - * pixelformats.cpp - libcamera pixel formats
> + * pixel_format.cpp - libcamera Pixel Format
>   */
>  
> -#include <libcamera/pixelformats.h>
> +#include <libcamera/pixel_format.h>
>  
>  /**
> - * \file pixelformats.h
> - * \brief libcamera pixel formats
> + * \file pixel_format.h
> + * \brief libcamera pixel format
>   */
>  
>  namespace libcamera {
> diff --git a/src/libcamera/v4l2_pixelformat.cpp b/src/libcamera/v4l2_pixelformat.cpp
> index 36776be99e59..94fae470f926 100644
> --- a/src/libcamera/v4l2_pixelformat.cpp
> +++ b/src/libcamera/v4l2_pixelformat.cpp
> @@ -14,7 +14,7 @@
>  
>  #include <linux/drm_fourcc.h>
>  
> -#include <libcamera/pixelformats.h>
> +#include <libcamera/pixel_format.h>
>  
>  #include "libcamera/internal/formats.h"
>  #include "libcamera/internal/log.h"
> diff --git a/src/qcam/format_converter.h b/src/qcam/format_converter.h
> index 5e28adf0ef63..e389b24a69f7 100644
> --- a/src/qcam/format_converter.h
> +++ b/src/qcam/format_converter.h
> @@ -11,7 +11,7 @@
>  
>  #include <QSize>
>  
> -#include <libcamera/pixelformats.h>
> +#include <libcamera/pixel_format.h>
>  
>  class QImage;
>  
> diff --git a/src/qcam/viewfinder.h b/src/qcam/viewfinder.h
> index b3f1d25d9d60..26a1320537d2 100644
> --- a/src/qcam/viewfinder.h
> +++ b/src/qcam/viewfinder.h
> @@ -17,7 +17,7 @@
>  #include <QWidget>
>  
>  #include <libcamera/buffer.h>
> -#include <libcamera/pixelformats.h>
> +#include <libcamera/pixel_format.h>
>  
>  #include "format_converter.h"
>  
> -- 
> Regards,
> 
> Laurent Pinchart
> 
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel at lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel

-- 
Regards,
Niklas Söderlund


More information about the libcamera-devel mailing list