[libcamera-devel,RFC,5/8] android: camera_device: Report an error in notifyError()

Message ID 20200720224232.153717-6-kieran.bingham@ideasonboard.com
State RFC
Headers show
Series
  • RFC MappedBuffers
Related show

Commit Message

Kieran Bingham July 20, 2020, 10:42 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>

---

A little unrelated from the RFC series, but in the tree and at v2, so
posted anyway.... This helps ;-)

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

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

Comments

Laurent Pinchart July 24, 2020, 5:03 p.m. UTC | #1
Hi Kieran,

Thank you for the patch.

On Mon, Jul 20, 2020 at 11:42:29PM +0100, Kieran Bingham wrote:
> 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>
> 
> ---
> 
> A little unrelated from the RFC series, but in the tree and at v2, so
> posted anyway.... This helps ;-)
> 
> v2:
>  - Add todo to note possible debug info expansion
>  - Fix typo
>  - Print .toString() formatted pixel format
> 
>  src/android/camera_device.cpp | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp
> index 48f8090a93db..e5c50084e590 100644
> --- a/src/android/camera_device.cpp
> +++ b/src/android/camera_device.cpp
> @@ -1209,6 +1209,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

s/todo:/todo/

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> +	 * 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;

Patch

diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp
index 48f8090a93db..e5c50084e590 100644
--- a/src/android/camera_device.cpp
+++ b/src/android/camera_device.cpp
@@ -1209,6 +1209,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;