[libcamera-devel,v2,06/12] android: camera_device: Report an error in notifyError()

Message ID 20200803161816.107113-7-kieran.bingham@ideasonboard.com
State Accepted
Headers show
Series
  • android: jpeg
Related show

Commit Message

Kieran Bingham Aug. 3, 2020, 4:18 p.m. UTC
If an error is generated, try to be verbose about it in the libcamera logs.

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

---
v2:
 - Add todo to note possible debug info expansion
 - Fix typo
 - Print .toString() formatted pixel format

v3:
 - Remove colon from todo:


Note that the calling point of this function always gives stream zero
anyway.

 src/android/camera_device.cpp | 7 +++++++
 1 file changed, 7 insertions(+)

Patch

diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp
index cf50821eec71..388945b1075c 100644
--- a/src/android/camera_device.cpp
+++ b/src/android/camera_device.cpp
@@ -1198,6 +1198,13 @@  void CameraDevice::notifyError(uint32_t frameNumber, camera3_stream_t *stream)
 {
 	camera3_notify_msg_t notify = {};
 
+	/*
+	 * \todo Report and identify the stream number or configuration to
+	 * clarify the stream that failed.
+	 */
+	LOG(HAL, Error) << "Error occurred on frame " << frameNumber << " ("
+			<< toPixelFormat(stream->format).toString() << ")";
+
 	notify.type = CAMERA3_MSG_ERROR;
 	notify.message.error.error_stream = stream;
 	notify.message.error.frame_number = frameNumber;