[libcamera-devel,v2,5/6] android: Increase result metadata size
diff mbox series

Message ID 20211220232629.1485890-6-paul.elder@ideasonboard.com
State Accepted
Headers show
Series
  • android: Miscellaneous fixes
Related show

Commit Message

Paul Elder Dec. 20, 2021, 11:26 p.m. UTC
Increase the initial size of the result metadata, as we will be adding
more entries in the near future.

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
---
 src/android/camera_device.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jacopo Mondi Dec. 21, 2021, 8:54 a.m. UTC | #1
Hi Paul

On Mon, Dec 20, 2021 at 05:26:28PM -0600, Paul Elder wrote:
> Increase the initial size of the result metadata, as we will be adding
> more entries in the near future.
>
> Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
> ---
>  src/android/camera_device.cpp | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp
> index f28fdd6a..83825736 100644
> --- a/src/android/camera_device.cpp
> +++ b/src/android/camera_device.cpp
> @@ -1313,7 +1313,7 @@ CameraDevice::getResultMetadata(const Camera3RequestDescriptor &descriptor) cons
>  	 * Total bytes for JPEG metadata: 82
>  	 */
>  	std::unique_ptr<CameraMetadata> resultMetadata =
> -		std::make_unique<CameraMetadata>(44, 166);
> +		std::make_unique<CameraMetadata>(88, 166);

I wonder if the size should be bumped too. But it seems you only get
complaints about the number of entries ?

Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>

Thanks
   j

>  	if (!resultMetadata->isValid()) {
>  		LOG(HAL, Error) << "Failed to allocate result metadata";
>  		return nullptr;
> --
> 2.27.0
>
Umang Jain Jan. 4, 2022, 3:25 a.m. UTC | #2
Hi Paul,

On 12/21/21 4:56 AM, Paul Elder wrote:
> Increase the initial size of the result metadata, as we will be adding
> more entries in the near future.
>
> Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
> ---
>   src/android/camera_device.cpp | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp
> index f28fdd6a..83825736 100644
> --- a/src/android/camera_device.cpp
> +++ b/src/android/camera_device.cpp
> @@ -1313,7 +1313,7 @@ CameraDevice::getResultMetadata(const Camera3RequestDescriptor &descriptor) cons
>   	 * Total bytes for JPEG metadata: 82
>   	 */
>   	std::unique_ptr<CameraMetadata> resultMetadata =
> -		std::make_unique<CameraMetadata>(44, 166);
> +		std::make_unique<CameraMetadata>(88, 166);


I know the CameraMetadata only takes a hint of #number of entries and 
#bytes and it can re-allocate on the fly, but bumping up the entries 
without the #bytes (as Jacopo pointed), seems a bit spurious. Would it 
be helpful to recording a specific reason behind this in the commit 
message? I am sure someone looking at the `git log` at this patch in 
future, would get confused and would potentially treat it asĀ  a bug.


>   	if (!resultMetadata->isValid()) {
>   		LOG(HAL, Error) << "Failed to allocate result metadata";
>   		return nullptr;

Patch
diff mbox series

diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp
index f28fdd6a..83825736 100644
--- a/src/android/camera_device.cpp
+++ b/src/android/camera_device.cpp
@@ -1313,7 +1313,7 @@  CameraDevice::getResultMetadata(const Camera3RequestDescriptor &descriptor) cons
 	 * Total bytes for JPEG metadata: 82
 	 */
 	std::unique_ptr<CameraMetadata> resultMetadata =
-		std::make_unique<CameraMetadata>(44, 166);
+		std::make_unique<CameraMetadata>(88, 166);
 	if (!resultMetadata->isValid()) {
 		LOG(HAL, Error) << "Failed to allocate result metadata";
 		return nullptr;