summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-01-05 01:38:56 +0200
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-08-25 20:24:21 +0300
commita6c831a996360329bbf8e02a68a76fb556ed844b (patch)
treeb63d5b2105fabdc0b121a949badc24c0f43f37d0
parentda3c15c3de74d7d8e6b26a9725729cc32c1625f6 (diff)
v4l2: camera_proxy: Pass const reference to setFmtFromConfig()
The setFmtFromConfig() method doesn't modify its parameter, make it const. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
-rw-r--r--src/v4l2/v4l2_camera_proxy.cpp4
-rw-r--r--src/v4l2/v4l2_camera_proxy.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/v4l2/v4l2_camera_proxy.cpp b/src/v4l2/v4l2_camera_proxy.cpp
index 63affaee..079257f4 100644
--- a/src/v4l2/v4l2_camera_proxy.cpp
+++ b/src/v4l2/v4l2_camera_proxy.cpp
@@ -162,10 +162,10 @@ bool V4L2CameraProxy::validateMemoryType(uint32_t memory)
return memory == V4L2_MEMORY_MMAP;
}
-void V4L2CameraProxy::setFmtFromConfig(StreamConfiguration &streamConfig)
+void V4L2CameraProxy::setFmtFromConfig(const StreamConfiguration &streamConfig)
{
const PixelFormatInfo &info = PixelFormatInfo::info(streamConfig.pixelFormat);
- Size size = streamConfig.size;
+ const Size &size = streamConfig.size;
curV4L2Format_.fmt.pix.width = size.width;
curV4L2Format_.fmt.pix.height = size.height;
diff --git a/src/v4l2/v4l2_camera_proxy.h b/src/v4l2/v4l2_camera_proxy.h
index f06b5b87..79eb87bc 100644
--- a/src/v4l2/v4l2_camera_proxy.h
+++ b/src/v4l2/v4l2_camera_proxy.h
@@ -39,7 +39,7 @@ public:
private:
bool validateBufferType(uint32_t type);
bool validateMemoryType(uint32_t memory);
- void setFmtFromConfig(StreamConfiguration &streamConfig);
+ void setFmtFromConfig(const StreamConfiguration &streamConfig);
void querycap(std::shared_ptr<Camera> camera);
int tryFormat(struct v4l2_format *arg);
enum v4l2_priority maxPriority();