[libcamera-devel] [PATCH] libcamera: v4l2_device: Return const std::string

Jacopo Mondi jacopo at jmondi.org
Mon Jan 21 10:20:20 CET 2019


Make getter functions of V4L2Device return std::string as the rest of
the library does.

Signed-off-by: Jacopo Mondi <jacopo at jmondi.org>
---
 src/libcamera/include/v4l2_device.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/libcamera/include/v4l2_device.h b/src/libcamera/include/v4l2_device.h
index 474c05b..5fe3d82 100644
--- a/src/libcamera/include/v4l2_device.h
+++ b/src/libcamera/include/v4l2_device.h
@@ -45,9 +45,9 @@ public:
 	bool isOpen() const;
 	void close();

-	const char *driverName() const { return caps_.driver(); }
-	const char *deviceName() const { return caps_.card(); }
-	const char *busName() const { return caps_.bus_info(); }
+	const std::string driverName() const { return std::string(caps_.driver()); }
+	const std::string deviceName() const { return std::string(caps_.card()); }
+	const std::string busName() const { return std::string(caps_.bus_info()); }

 private:
 	std::string devnode_;
--
2.20.1



More information about the libcamera-devel mailing list