Message ID | 20200714104212.48683-14-jacopo@jmondi.org |
---|---|
State | Superseded, archived |
Delegated to: | Jacopo Mondi |
Headers | show |
Series |
|
Related | show |
Hi Jacopo, Thank you for the patch. On Tue, Jul 14, 2020 at 12:42:05PM +0200, Jacopo Mondi wrote: > Mark the CIO2Device::sensor() method as const, and allow to call it > on const instances of the class. > > Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> > --- > src/libcamera/pipeline/ipu3/cio2.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/src/libcamera/pipeline/ipu3/cio2.h b/src/libcamera/pipeline/ipu3/cio2.h > index f905d97fa79d..0f75b0bc4572 100644 > --- a/src/libcamera/pipeline/ipu3/cio2.h > +++ b/src/libcamera/pipeline/ipu3/cio2.h > @@ -49,7 +49,7 @@ public: > int start(); > int stop(); > > - CameraSensor *sensor() { return sensor_; } > + CameraSensor *sensor() const { return sensor_; } This would calling non-const methods of the CameraSensor class from a caller that only has access to a const CIO2Device. Wouldn't it be better to have two methods, a const and a non-const one ? CameraSensor *sensor() { return sensor_; } const CameraSensor *sensor() const { return sensor_; } Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> > > int queueBuffer(Request *request, FrameBuffer *rawBuffer); > void tryReturnBuffer(FrameBuffer *buffer);
diff --git a/src/libcamera/pipeline/ipu3/cio2.h b/src/libcamera/pipeline/ipu3/cio2.h index f905d97fa79d..0f75b0bc4572 100644 --- a/src/libcamera/pipeline/ipu3/cio2.h +++ b/src/libcamera/pipeline/ipu3/cio2.h @@ -49,7 +49,7 @@ public: int start(); int stop(); - CameraSensor *sensor() { return sensor_; } + CameraSensor *sensor() const { return sensor_; } int queueBuffer(Request *request, FrameBuffer *rawBuffer); void tryReturnBuffer(FrameBuffer *buffer);
Mark the CIO2Device::sensor() method as const, and allow to call it on const instances of the class. Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> --- src/libcamera/pipeline/ipu3/cio2.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)