Merge "Camera: Fix processCaptureRequestBurstISO" into main am: 419aa1a845 am: c8c2e7d008
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/3005172
Change-Id: I29b80b6eaa137e7dfa76cbab954016e72276acf8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/camera/provider/aidl/vts/VtsAidlHalCameraProvider_TargetTest.cpp b/camera/provider/aidl/vts/VtsAidlHalCameraProvider_TargetTest.cpp
index 31e8014..ae56aee 100644
--- a/camera/provider/aidl/vts/VtsAidlHalCameraProvider_TargetTest.cpp
+++ b/camera/provider/aidl/vts/VtsAidlHalCameraProvider_TargetTest.cpp
@@ -32,6 +32,7 @@
#include <torch_provider_cb.h>
#include <com_android_internal_camera_flags.h>
#include <list>
+#include <nativebase/nativebase.h>
using ::aidl::android::hardware::camera::common::CameraDeviceStatus;
using ::aidl::android::hardware::camera::common::CameraResourceCost;
@@ -1675,9 +1676,9 @@
BufferStatus::OK, NativeHandle(), NativeHandle()};
} else {
allocateGraphicBuffer(previewStream.width, previewStream.height,
- android_convertGralloc1To0Usage(
+ ANDROID_NATIVE_UNSIGNED_CAST(android_convertGralloc1To0Usage(
static_cast<uint64_t>(halStream.producerUsage),
- static_cast<uint64_t>(halStream.consumerUsage)),
+ static_cast<uint64_t>(halStream.consumerUsage))),
halStream.overrideFormat, &buffer_handle);
graphicBuffers.push_back(buffer_handle);
outputBuffers[k] = {
@@ -1896,9 +1897,9 @@
NativeHandle(), NativeHandle()};
} else {
allocateGraphicBuffer(previewStream.width, previewStream.height,
- android_convertGralloc1To0Usage(
+ ANDROID_NATIVE_UNSIGNED_CAST(android_convertGralloc1To0Usage(
static_cast<uint64_t>(halStream.producerUsage),
- static_cast<uint64_t>(halStream.consumerUsage)),
+ static_cast<uint64_t>(halStream.consumerUsage))),
halStream.overrideFormat, &buffer_handle);
graphicBuffers.push_back(buffer_handle);
outputBuffers[k] = {
@@ -2064,9 +2065,9 @@
NativeHandle(), BufferStatus::OK,
NativeHandle(), NativeHandle()};
} else {
- auto usage = android_convertGralloc1To0Usage(
+ auto usage = ANDROID_NATIVE_UNSIGNED_CAST(android_convertGralloc1To0Usage(
static_cast<uint64_t>(halStream.producerUsage),
- static_cast<uint64_t>(halStream.consumerUsage));
+ static_cast<uint64_t>(halStream.consumerUsage)));
allocateGraphicBuffer(previewStream.width, previewStream.height, usage,
halStream.overrideFormat, &buffer_handle);
@@ -2285,9 +2286,9 @@
NativeHandle(), NativeHandle()};
} else {
allocateGraphicBuffer(previewStream.width, previewStream.height,
- android_convertGralloc1To0Usage(
+ ANDROID_NATIVE_UNSIGNED_CAST(android_convertGralloc1To0Usage(
static_cast<uint64_t>(halStreams[0].producerUsage),
- static_cast<uint64_t>(halStreams[0].consumerUsage)),
+ static_cast<uint64_t>(halStreams[0].consumerUsage))),
halStreams[0].overrideFormat, &buffers[i]);
outputBuffer = {halStreams[0].id, bufferId + i, ::android::makeToAidl(buffers[i]),
BufferStatus::OK, NativeHandle(), NativeHandle()};
@@ -2385,9 +2386,9 @@
bufferId = 0;
} else {
allocateGraphicBuffer(previewStream.width, previewStream.height,
- android_convertGralloc1To0Usage(
+ ANDROID_NATIVE_UNSIGNED_CAST(android_convertGralloc1To0Usage(
static_cast<uint64_t>(halStreams[0].producerUsage),
- static_cast<uint64_t>(halStreams[0].consumerUsage)),
+ static_cast<uint64_t>(halStreams[0].consumerUsage))),
halStreams[0].overrideFormat, &buffer_handle);
}
@@ -2508,9 +2509,9 @@
} else {
// jpeg buffer (w,h) = (blobLen, 1)
allocateGraphicBuffer(jpegBufferSize, /*height*/ 1,
- android_convertGralloc1To0Usage(
+ ANDROID_NATIVE_UNSIGNED_CAST(android_convertGralloc1To0Usage(
static_cast<uint64_t>(halStream.producerUsage),
- static_cast<uint64_t>(halStream.consumerUsage)),
+ static_cast<uint64_t>(halStream.consumerUsage))),
halStream.overrideFormat, &buffers[i]);
outputBuffer = {halStream.id, bufferId + i, ::android::makeToAidl(buffers[i]),
BufferStatus::OK, NativeHandle(), NativeHandle()};
@@ -2734,9 +2735,9 @@
BufferStatus::OK, NativeHandle(), NativeHandle()};
} else {
allocateGraphicBuffer(previewStream.width, previewStream.height,
- android_convertGralloc1To0Usage(
+ ANDROID_NATIVE_UNSIGNED_CAST(android_convertGralloc1To0Usage(
static_cast<uint64_t>(halStreams[0].producerUsage),
- static_cast<uint64_t>(halStreams[0].consumerUsage)),
+ static_cast<uint64_t>(halStreams[0].consumerUsage))),
halStreams[0].overrideFormat, &buffer_handle);
outputBuffer = {halStreams[0].id, bufferId, ::android::makeToAidl(buffer_handle),
BufferStatus::OK, NativeHandle(), NativeHandle()};
diff --git a/camera/provider/aidl/vts/camera_aidl_test.cpp b/camera/provider/aidl/vts/camera_aidl_test.cpp
index a01fb04..1ad5af9 100644
--- a/camera/provider/aidl/vts/camera_aidl_test.cpp
+++ b/camera/provider/aidl/vts/camera_aidl_test.cpp
@@ -41,6 +41,7 @@
#include <regex>
#include <typeinfo>
#include "utils/Errors.h"
+#include <nativebase/nativebase.h>
using ::aidl::android::hardware::camera::common::CameraDeviceStatus;
using ::aidl::android::hardware::camera::common::TorchModeStatus;
@@ -2340,8 +2341,8 @@
/* We don't look at halStreamConfig.streams[0].consumerUsage
* since that is 0 for output streams
*/
- android_convertGralloc1To0Usage(
- static_cast<uint64_t>(halStreams[0].producerUsage), bufferUsage),
+ ANDROID_NATIVE_UNSIGNED_CAST(android_convertGralloc1To0Usage(
+ static_cast<uint64_t>(halStreams[0].producerUsage), bufferUsage)),
halStreams[0].overrideFormat, &handle);
outputBuffer = {halStreams[0].id, bufferId, ::android::makeToAidl(handle),
@@ -2868,9 +2869,9 @@
/* We don't look at halStreamConfig.streams[0].consumerUsage
* since that is 0 for output streams
*/
- android_convertGralloc1To0Usage(
+ ANDROID_NATIVE_UNSIGNED_CAST(android_convertGralloc1To0Usage(
static_cast<uint64_t>(halStreams[0].producerUsage),
- GRALLOC1_CONSUMER_USAGE_HWCOMPOSER),
+ GRALLOC1_CONSUMER_USAGE_HWCOMPOSER)),
halStreams[0].overrideFormat, &buffer_handle);
outputBuffer = {halStreams[0].id, bufferId, ::android::makeToAidl(buffer_handle),
BufferStatus::OK, NativeHandle(), NativeHandle()};
@@ -3851,9 +3852,9 @@
NativeHandle(), BufferStatus::OK,
NativeHandle(), NativeHandle()};
} else {
- auto usage = android_convertGralloc1To0Usage(
+ auto usage = ANDROID_NATIVE_UNSIGNED_CAST(android_convertGralloc1To0Usage(
static_cast<uint64_t>(halStream.producerUsage),
- static_cast<uint64_t>(halStream.consumerUsage));
+ static_cast<uint64_t>(halStream.consumerUsage)));
allocateGraphicBuffer(previewStream.width, previewStream.height, usage,
halStream.overrideFormat, &buffer_handle);
@@ -4009,9 +4010,9 @@
NativeHandle(), NativeHandle()};
} else {
allocateGraphicBuffer(previewStream.width, previewStream.height,
- android_convertGralloc1To0Usage(
+ ANDROID_NATIVE_UNSIGNED_CAST(android_convertGralloc1To0Usage(
static_cast<uint64_t>(halStreams[0].producerUsage),
- static_cast<uint64_t>(halStreams[0].consumerUsage)),
+ static_cast<uint64_t>(halStreams[0].consumerUsage))),
halStreams[0].overrideFormat, &buffers[i]);
outputBuffer = {halStreams[0].id, bufferId + i, ::android::makeToAidl(buffers[i]),
BufferStatus::OK, NativeHandle(), NativeHandle()};
diff --git a/camera/provider/aidl/vts/device_cb.cpp b/camera/provider/aidl/vts/device_cb.cpp
index 2c11d3f..8a8b925 100644
--- a/camera/provider/aidl/vts/device_cb.cpp
+++ b/camera/provider/aidl/vts/device_cb.cpp
@@ -20,6 +20,7 @@
#include <aidlcommonsupport/NativeHandle.h>
#include <grallocusage/GrallocUsageConversion.h>
#include <cinttypes>
+#include <nativebase/nativebase.h>
using ::aidl::android::hardware::camera::device::BufferStatus;
using ::aidl::android::hardware::camera::device::ErrorMsg;
@@ -143,8 +144,8 @@
CameraAidlTest::allocateGraphicBuffer(
w, h,
- android_convertGralloc1To0Usage(static_cast<uint64_t>(halStream.producerUsage),
- static_cast<uint64_t>(halStream.consumerUsage)),
+ ANDROID_NATIVE_UNSIGNED_CAST(android_convertGralloc1To0Usage(static_cast<uint64_t>(halStream.producerUsage),
+ static_cast<uint64_t>(halStream.consumerUsage))),
halStream.overrideFormat, &handle);
StreamBuffer streamBuffer = StreamBuffer();