android: camera_device: Provide log prefix

Make the CameraDevice a Loggable subclass and provide a logPrefix()
method to identify which camera the log output refers to.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
This commit is contained in:
Jacopo Mondi 2020-05-26 15:41:41 +02:00
parent 5f2f9406ce
commit a7b9277e45
2 changed files with 10 additions and 1 deletions

View file

@ -16,11 +16,12 @@
#include <libcamera/request.h>
#include <libcamera/stream.h>
#include "libcamera/internal/log.h"
#include "libcamera/internal/message.h"
class CameraMetadata;
class CameraDevice
class CameraDevice : protected libcamera::Loggable
{
public:
CameraDevice(unsigned int id, const std::shared_ptr<libcamera::Camera> &camera);
@ -39,6 +40,9 @@ public:
int processCaptureRequest(camera3_capture_request_t *request);
void requestComplete(libcamera::Request *request);
protected:
std::string logPrefix() const override;
private:
struct Camera3RequestDescriptor {
Camera3RequestDescriptor(unsigned int frameNumber,