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

Message ID 20211123104042.3100902-7-paul.elder@ideasonboard.com
State Superseded
Delegated to: Paul Elder
Headers show
Series
  • android: Miscellaneous fixes
Related show

Commit Message

Paul Elder Nov. 23, 2021, 10:40 a.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>
---
 src/android/camera_device.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Kieran Bingham Nov. 25, 2021, 11:10 a.m. UTC | #1
Quoting Paul Elder (2021-11-23 10:40:41)
> 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>
> ---
>  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 f2e0bdbd..3b588bdb 100644
> --- a/src/android/camera_device.cpp
> +++ b/src/android/camera_device.cpp
> @@ -1296,7 +1296,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);

Is this the current values suggested by the resize?

Or just a straightforwards doubling.?

Either way, It helps efficiency. And can still be fine tuned later.


Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

>         if (!resultMetadata->isValid()) {
>                 LOG(HAL, Error) << "Failed to allocate result metadata";
>                 return nullptr;
> -- 
> 2.27.0
>
Paul Elder Dec. 20, 2021, 11:10 p.m. UTC | #2
Hi Kieran,

On Thu, Nov 25, 2021 at 11:10:45AM +0000, Kieran Bingham wrote:
> Quoting Paul Elder (2021-11-23 10:40:41)
> > 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>
> > ---
> >  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 f2e0bdbd..3b588bdb 100644
> > --- a/src/android/camera_device.cpp
> > +++ b/src/android/camera_device.cpp
> > @@ -1296,7 +1296,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);
> 
> Is this the current values suggested by the resize?
> 
> Or just a straightforwards doubling.?

It was arbitrary :p

I was getting a message about the number of entries being increased
every time. The size wasn't, so I left that the same.

> 
> Either way, It helps efficiency. And can still be fine tuned later.
> 
> 
> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>


Thanks,

Paul

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

Patch
diff mbox series

diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp
index f2e0bdbd..3b588bdb 100644
--- a/src/android/camera_device.cpp
+++ b/src/android/camera_device.cpp
@@ -1296,7 +1296,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;