Handle ANDROID_JPEG_MAX_SIZE for ultra high res sensors.

DepthCompositeStream conservatively allocates buffers in
processInputFrame() looking at ANDROID_JPEG_MAX_SIZE. For ultra high
resolution sensors ANDROID_JPEG_MAX_SIZE was set to the maximum buffer
size for max res mode JPEG captures.

This could lead to even default size input frames getting ultra max resolution size
buffers, which is wasteful.

Here we go back to the original definition of ANDROID_JPEG_MAX_SIZE :
maximum jpeg buffer size for default mode captures. We estimate the
maximum jpeg buffer size for max res mode captures instead.

Bug: 193346383

Test: Camera CTS

Change-Id: I4decf1430d38219c666ea11dfe109587f7fff1ba
Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>
diff --git a/services/camera/libcameraservice/utils/SessionConfigurationUtils.h b/services/camera/libcameraservice/utils/SessionConfigurationUtils.h
index b4814b6..1fbaa69 100644
--- a/services/camera/libcameraservice/utils/SessionConfigurationUtils.h
+++ b/services/camera/libcameraservice/utils/SessionConfigurationUtils.h
@@ -71,6 +71,12 @@
 
 class SessionConfigurationUtils {
 public:
+    static camera3::Size getMaxJpegResolution(const CameraMetadata &metadata,
+            bool ultraHighResolution);
+
+    static size_t getUHRMaxJpegBufferSize(camera3::Size uhrMaxJpegSize,
+            camera3::Size defaultMaxJpegSize, size_t defaultMaxJpegBufferSize);
+
     static int64_t euclidDistSquare(int32_t x0, int32_t y0, int32_t x1, int32_t y1);
 
     // Find the closest dimensions for a given format in available stream configurations with