diff options
author | Jacopo Mondi <jacopo@jmondi.org> | 2020-05-26 15:41:41 +0200 |
---|---|---|
committer | Jacopo Mondi <jacopo@jmondi.org> | 2020-06-04 09:50:52 +0200 |
commit | a7b9277e45a9c16f7f108c69fb7156b639fecd5a (patch) | |
tree | 9ec3a58954d330e27ee21dc1ddc25ca6e39e3be2 /src/android | |
parent | 5f2f9406cebc668f0d69007d1ea59ef3c56ef28c (diff) |
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>
Diffstat (limited to 'src/android')
-rw-r--r-- | src/android/camera_device.cpp | 5 | ||||
-rw-r--r-- | src/android/camera_device.h | 6 |
2 files changed, 10 insertions, 1 deletions
diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp index 4ec429fc..ad277cb0 100644 --- a/src/android/camera_device.cpp +++ b/src/android/camera_device.cpp @@ -863,6 +863,11 @@ void CameraDevice::requestComplete(Request *request) delete buffer; } +std::string CameraDevice::logPrefix() const +{ + return "'" + camera_->name() + "'"; +} + void CameraDevice::notifyShutter(uint32_t frameNumber, uint64_t timestamp) { camera3_notify_msg_t notify = {}; diff --git a/src/android/camera_device.h b/src/android/camera_device.h index bce1cfbc..9d5c6952 100644 --- a/src/android/camera_device.h +++ b/src/android/camera_device.h @@ -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, |