libcamera: v4l2_device: Inherit from Loggable to print device node name

Automate printing of device node name in log messages by inheriting from
the Loggable class.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
This commit is contained in:
Laurent Pinchart
2019-02-08 16:42:40 +02:00
parent 8a401ed411
commit 04d5be7f76
2 changed files with 15 additions and 8 deletions

View File

@@ -15,6 +15,8 @@
#include <libcamera/signal.h>
#include "log.h"
namespace libcamera {
class Buffer;
@@ -76,7 +78,7 @@ public:
unsigned int planesCount;
};
class V4L2Device
class V4L2Device : protected Loggable
{
public:
explicit V4L2Device(const std::string &deviceNode);
@@ -106,6 +108,9 @@ public:
int streamOn();
int streamOff();
protected:
std::string logPrefix() const;
private:
int getFormatSingleplane(V4L2DeviceFormat *format);
int setFormatSingleplane(V4L2DeviceFormat *format);