[libcamera-devel,1/7] libcamera: v4l2_device: Rename format() method to getFormat()

Message ID 20190201154248.15006-2-jacopo@jmondi.org
State Accepted
Headers show
Series
  • libcamera: v4l2_device: Address comments for s/g_fmt
Related show

Commit Message

Jacopo Mondi Feb. 1, 2019, 3:42 p.m. UTC
Rename format() to getFormat() to reflect the v4l2 API names more
closely.

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

Comments

Kieran Bingham Feb. 1, 2019, 9:17 p.m. UTC | #1
Hi Jacopo,

On 01/02/2019 16:42, Jacopo Mondi wrote:
> Rename format() to getFormat() to reflect the v4l2 API names more
> closely.
> 

Thanks - I think this will make it easier to comprehend.


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

> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
> ---
>  src/libcamera/include/v4l2_device.h | 2 +-
>  src/libcamera/v4l2_device.cpp       | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/libcamera/include/v4l2_device.h b/src/libcamera/include/v4l2_device.h
> index f68b2b1..70e3c00 100644
> --- a/src/libcamera/include/v4l2_device.h
> +++ b/src/libcamera/include/v4l2_device.h
> @@ -86,7 +86,7 @@ public:
>  	const char *deviceName() const { return caps_.card(); }
>  	const char *busName() const { return caps_.bus_info(); }
>  
> -	int format(V4L2DeviceFormat *fmt);
> +	int getFormat(V4L2DeviceFormat *fmt);
>  	int setFormat(V4L2DeviceFormat *fmt);
>  
>  private:
> diff --git a/src/libcamera/v4l2_device.cpp b/src/libcamera/v4l2_device.cpp
> index 5c415d0..26b6ff3 100644
> --- a/src/libcamera/v4l2_device.cpp
> +++ b/src/libcamera/v4l2_device.cpp
> @@ -282,7 +282,7 @@ void V4L2Device::close()
>   * \brief Retrieve the image format set on the V4L2 device
>   * \return 0 for success, a negative error code otherwise
>   */
> -int V4L2Device::format(V4L2DeviceFormat *fmt)
> +int V4L2Device::getFormat(V4L2DeviceFormat *fmt)
>  {
>  	return caps_.isMultiplanar() ? getFormatMultiplane(fmt) :
>  				       getFormatSingleplane(fmt);
>
Laurent Pinchart Feb. 1, 2019, 10:04 p.m. UTC | #2
On Fri, Feb 01, 2019 at 10:17:34PM +0100, Kieran Bingham wrote:
> On 01/02/2019 16:42, Jacopo Mondi wrote:
> > Rename format() to getFormat() to reflect the v4l2 API names more
> > closely.
> 
> Thanks - I think this will make it easier to comprehend.

I agree, thank you Jacopo.

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

> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
> 
> > Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
> > ---
> >  src/libcamera/include/v4l2_device.h | 2 +-
> >  src/libcamera/v4l2_device.cpp       | 2 +-
> >  2 files changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/src/libcamera/include/v4l2_device.h b/src/libcamera/include/v4l2_device.h
> > index f68b2b1..70e3c00 100644
> > --- a/src/libcamera/include/v4l2_device.h
> > +++ b/src/libcamera/include/v4l2_device.h
> > @@ -86,7 +86,7 @@ public:
> >  	const char *deviceName() const { return caps_.card(); }
> >  	const char *busName() const { return caps_.bus_info(); }
> >  
> > -	int format(V4L2DeviceFormat *fmt);
> > +	int getFormat(V4L2DeviceFormat *fmt);
> >  	int setFormat(V4L2DeviceFormat *fmt);
> >  
> >  private:
> > diff --git a/src/libcamera/v4l2_device.cpp b/src/libcamera/v4l2_device.cpp
> > index 5c415d0..26b6ff3 100644
> > --- a/src/libcamera/v4l2_device.cpp
> > +++ b/src/libcamera/v4l2_device.cpp
> > @@ -282,7 +282,7 @@ void V4L2Device::close()
> >   * \brief Retrieve the image format set on the V4L2 device
> >   * \return 0 for success, a negative error code otherwise
> >   */
> > -int V4L2Device::format(V4L2DeviceFormat *fmt)
> > +int V4L2Device::getFormat(V4L2DeviceFormat *fmt)
> >  {
> >  	return caps_.isMultiplanar() ? getFormatMultiplane(fmt) :
> >  				       getFormatSingleplane(fmt);

Patch

diff --git a/src/libcamera/include/v4l2_device.h b/src/libcamera/include/v4l2_device.h
index f68b2b1..70e3c00 100644
--- a/src/libcamera/include/v4l2_device.h
+++ b/src/libcamera/include/v4l2_device.h
@@ -86,7 +86,7 @@  public:
 	const char *deviceName() const { return caps_.card(); }
 	const char *busName() const { return caps_.bus_info(); }
 
-	int format(V4L2DeviceFormat *fmt);
+	int getFormat(V4L2DeviceFormat *fmt);
 	int setFormat(V4L2DeviceFormat *fmt);
 
 private:
diff --git a/src/libcamera/v4l2_device.cpp b/src/libcamera/v4l2_device.cpp
index 5c415d0..26b6ff3 100644
--- a/src/libcamera/v4l2_device.cpp
+++ b/src/libcamera/v4l2_device.cpp
@@ -282,7 +282,7 @@  void V4L2Device::close()
  * \brief Retrieve the image format set on the V4L2 device
  * \return 0 for success, a negative error code otherwise
  */
-int V4L2Device::format(V4L2DeviceFormat *fmt)
+int V4L2Device::getFormat(V4L2DeviceFormat *fmt)
 {
 	return caps_.isMultiplanar() ? getFormatMultiplane(fmt) :
 				       getFormatSingleplane(fmt);