Merge "Camera: Update documentation for rolling shutter skew" into rvc-dev am: 6d9c200198 am: 4f03969e11
Change-Id: I62a7cf00835bba2cefa475fb1a620839086d1702
diff --git a/audio/common/all-versions/default/service/android.hardware.audio.service.rc b/audio/common/all-versions/default/service/android.hardware.audio.service.rc
index f7e1e24..45fef9a 100644
--- a/audio/common/all-versions/default/service/android.hardware.audio.service.rc
+++ b/audio/common/all-versions/default/service/android.hardware.audio.service.rc
@@ -2,7 +2,7 @@
class hal
user audioserver
# media gid needed for /dev/fm (radio) and for /data/misc/media (tee)
- group audio camera drmrpc inet media mediadrm net_bt net_bt_admin net_bw_acct wakelock
+ group audio camera drmrpc inet media mediadrm net_bt net_bt_admin net_bw_acct wakelock context_hub
capabilities BLOCK_SUSPEND
ioprio rt 4
task_profiles ProcessCapacityHigh HighPerformance
diff --git a/camera/common/1.0/default/Android.bp b/camera/common/1.0/default/Android.bp
index f4390b2..3b8b239 100644
--- a/camera/common/1.0/default/Android.bp
+++ b/camera/common/1.0/default/Android.bp
@@ -8,7 +8,7 @@
"CameraParameters.cpp",
"VendorTagDescriptor.cpp",
"HandleImporter.cpp",
- "Exif.cpp"
+ "Exif.cpp",
],
cflags: [
"-Werror",
@@ -17,6 +17,7 @@
],
shared_libs: [
"liblog",
+ "libgralloctypes",
"libhardware",
"libcamera_metadata",
"android.hardware.graphics.mapper@2.0",
@@ -25,6 +26,5 @@
"libexif",
],
include_dirs: ["system/media/private/camera/include"],
- export_include_dirs : ["include"]
+ export_include_dirs: ["include"],
}
-
diff --git a/camera/common/1.0/default/HandleImporter.cpp b/camera/common/1.0/default/HandleImporter.cpp
index 40cb4e0..05a552c 100644
--- a/camera/common/1.0/default/HandleImporter.cpp
+++ b/camera/common/1.0/default/HandleImporter.cpp
@@ -16,6 +16,8 @@
#define LOG_TAG "HandleImporter"
#include "HandleImporter.h"
+
+#include <gralloctypes/Gralloc4.h>
#include <log/log.h>
namespace android {
@@ -25,6 +27,9 @@
namespace V1_0 {
namespace helper {
+using aidl::android::hardware::graphics::common::PlaneLayout;
+using aidl::android::hardware::graphics::common::PlaneLayoutComponent;
+using aidl::android::hardware::graphics::common::PlaneLayoutComponentType;
using MapperErrorV2 = android::hardware::graphics::mapper::V2_0::Error;
using MapperErrorV3 = android::hardware::graphics::mapper::V3_0::Error;
using MapperErrorV4 = android::hardware::graphics::mapper::V4_0::Error;
@@ -118,6 +123,79 @@
return layout;
}
+template <>
+YCbCrLayout HandleImporter::lockYCbCrInternal<IMapperV4, MapperErrorV4>(
+ const sp<IMapperV4> mapper, buffer_handle_t& buf, uint64_t cpuUsage,
+ const IMapper::Rect& accessRegion) {
+ hidl_handle acquireFenceHandle;
+ auto buffer = const_cast<native_handle_t*>(buf);
+ YCbCrLayout layout = {};
+ void* mapped = nullptr;
+
+ typename IMapperV4::Rect accessRegionV4 = {accessRegion.left, accessRegion.top,
+ accessRegion.width, accessRegion.height};
+ mapper->lock(buffer, cpuUsage, accessRegionV4, acquireFenceHandle,
+ [&](const auto& tmpError, const auto& tmpPtr) {
+ if (tmpError == MapperErrorV4::NONE) {
+ mapped = tmpPtr;
+ } else {
+ ALOGE("%s: failed to lock error %d!", __FUNCTION__, tmpError);
+ }
+ });
+
+ if (mapped == nullptr) {
+ return layout;
+ }
+
+ hidl_vec<uint8_t> encodedPlaneLayouts;
+ mapper->get(buffer, gralloc4::MetadataType_PlaneLayouts,
+ [&](const auto& tmpError, const auto& tmpEncodedPlaneLayouts) {
+ if (tmpError == MapperErrorV4::NONE) {
+ encodedPlaneLayouts = tmpEncodedPlaneLayouts;
+ } else {
+ ALOGE("%s: failed to get plane layouts %d!", __FUNCTION__, tmpError);
+ }
+ });
+
+ std::vector<PlaneLayout> planeLayouts;
+ gralloc4::decodePlaneLayouts(encodedPlaneLayouts, &planeLayouts);
+
+ for (const auto& planeLayout : planeLayouts) {
+ for (const auto& planeLayoutComponent : planeLayout.components) {
+ const auto& type = planeLayoutComponent.type;
+
+ if (!gralloc4::isStandardPlaneLayoutComponentType(type)) {
+ continue;
+ }
+
+ uint8_t* data = reinterpret_cast<uint8_t*>(mapped);
+ data += planeLayout.offsetInBytes;
+ data += planeLayoutComponent.offsetInBits / 8;
+
+ switch (static_cast<PlaneLayoutComponentType>(type.value)) {
+ case PlaneLayoutComponentType::Y:
+ layout.y = data;
+ layout.yStride = planeLayout.strideInBytes;
+ break;
+ case PlaneLayoutComponentType::CB:
+ layout.cb = data;
+ layout.cStride = planeLayout.strideInBytes;
+ layout.chromaStep = planeLayout.sampleIncrementInBits / 8;
+ break;
+ case PlaneLayoutComponentType::CR:
+ layout.cr = data;
+ layout.cStride = planeLayout.strideInBytes;
+ layout.chromaStep = planeLayout.sampleIncrementInBits / 8;
+ break;
+ default:
+ break;
+ }
+ }
+ }
+
+ return layout;
+}
+
template<class M, class E>
int HandleImporter::unlockInternal(const sp<M> mapper, buffer_handle_t& buf) {
int releaseFence = -1;
@@ -306,13 +384,7 @@
}
if (mMapperV4 != nullptr) {
- // No device currently supports IMapper 4.0 so it is safe to just return an error code here.
- //
- // This will be supported by a combination of lock and BufferMetadata getters. We are going
- // to refactor all the IAllocator/IMapper versioning code into a shared library. We will
- // then add the IMapper 4.0 lockYCbCr support then.
- ALOGE("%s: MapperV4 doesn't support lockYCbCr directly!", __FUNCTION__);
- return {};
+ return lockYCbCrInternal<IMapperV4, MapperErrorV4>(mMapperV4, buf, cpuUsage, accessRegion);
}
if (mMapperV3 != nullptr) {
diff --git a/camera/device/1.0/default/Android.bp b/camera/device/1.0/default/Android.bp
index e6e6485..da70577 100644
--- a/camera/device/1.0/default/Android.bp
+++ b/camera/device/1.0/default/Android.bp
@@ -20,15 +20,15 @@
"android.hidl.memory@1.0",
"libcutils",
"liblog",
+ "libgralloctypes",
"libhardware",
"libcamera_metadata",
],
static_libs: [
- "android.hardware.camera.common@1.0-helper"
+ "android.hardware.camera.common@1.0-helper",
],
header_libs: [
"media_plugin_headers",
],
- export_include_dirs: ["."]
+ export_include_dirs: ["."],
}
-
diff --git a/camera/device/3.2/default/Android.bp b/camera/device/3.2/default/Android.bp
index 878878d..be2de07 100644
--- a/camera/device/3.2/default/Android.bp
+++ b/camera/device/3.2/default/Android.bp
@@ -2,9 +2,11 @@
name: "camera.device@3.2-impl",
defaults: ["hidl_defaults"],
proprietary: true,
- srcs: ["CameraDevice.cpp",
- "CameraDeviceSession.cpp",
- "convert.cpp"],
+ srcs: [
+ "CameraDevice.cpp",
+ "CameraDeviceSession.cpp",
+ "convert.cpp",
+ ],
shared_libs: [
"libhidlbase",
"libutils",
@@ -15,15 +17,16 @@
"android.hardware.graphics.mapper@3.0",
"android.hardware.graphics.mapper@4.0",
"liblog",
+ "libgralloctypes",
"libhardware",
"libcamera_metadata",
- "libfmq"
+ "libfmq",
],
static_libs: [
- "android.hardware.camera.common@1.0-helper"
+ "android.hardware.camera.common@1.0-helper",
],
export_include_dirs: ["."],
export_shared_lib_headers: [
"libfmq",
- ]
+ ],
}
diff --git a/camera/device/3.3/default/Android.bp b/camera/device/3.3/default/Android.bp
index 7d51434..0aa0dd7 100644
--- a/camera/device/3.3/default/Android.bp
+++ b/camera/device/3.3/default/Android.bp
@@ -2,9 +2,11 @@
name: "camera.device@3.3-impl",
defaults: ["hidl_defaults"],
proprietary: true,
- srcs: ["CameraDevice.cpp",
- "CameraDeviceSession.cpp",
- "convert.cpp"],
+ srcs: [
+ "CameraDevice.cpp",
+ "CameraDeviceSession.cpp",
+ "convert.cpp",
+ ],
shared_libs: [
"libhidlbase",
"libutils",
@@ -17,15 +19,16 @@
"android.hardware.graphics.mapper@3.0",
"android.hardware.graphics.mapper@4.0",
"liblog",
+ "libgralloctypes",
"libhardware",
"libcamera_metadata",
- "libfmq"
+ "libfmq",
],
static_libs: [
- "android.hardware.camera.common@1.0-helper"
+ "android.hardware.camera.common@1.0-helper",
],
export_include_dirs: ["."],
export_shared_lib_headers: [
"libfmq",
- ]
+ ],
}
diff --git a/camera/device/3.4/default/Android.bp b/camera/device/3.4/default/Android.bp
index 59e8329..982dce1 100644
--- a/camera/device/3.4/default/Android.bp
+++ b/camera/device/3.4/default/Android.bp
@@ -17,13 +17,13 @@
cc_library_headers {
name: "camera.device@3.4-impl_headers",
vendor: true,
- export_include_dirs: ["include/device_v3_4_impl"]
+ export_include_dirs: ["include/device_v3_4_impl"],
}
cc_library_headers {
name: "camera.device@3.4-external-impl_headers",
vendor: true,
- export_include_dirs: ["include/ext_device_v3_4_impl"]
+ export_include_dirs: ["include/ext_device_v3_4_impl"],
}
cc_library_shared {
@@ -34,7 +34,7 @@
srcs: [
"CameraDevice.cpp",
"CameraDeviceSession.cpp",
- "convert.cpp"
+ "convert.cpp",
],
shared_libs: [
"libhidlbase",
@@ -50,6 +50,7 @@
"android.hardware.graphics.mapper@3.0",
"android.hardware.graphics.mapper@4.0",
"liblog",
+ "libgralloctypes",
"libhardware",
"libcamera_metadata",
"libfmq",
@@ -87,6 +88,7 @@
"android.hardware.graphics.mapper@3.0",
"android.hardware.graphics.mapper@4.0",
"liblog",
+ "libgralloctypes",
"libhardware",
"libcamera_metadata",
"libfmq",
@@ -94,7 +96,7 @@
"libyuv",
"libjpeg",
"libexif",
- "libtinyxml2"
+ "libtinyxml2",
],
static_libs: [
"android.hardware.camera.common@1.0-helper",
diff --git a/camera/device/3.5/default/Android.bp b/camera/device/3.5/default/Android.bp
index 1c307ee..d106b4b 100644
--- a/camera/device/3.5/default/Android.bp
+++ b/camera/device/3.5/default/Android.bp
@@ -17,13 +17,13 @@
cc_library_headers {
name: "camera.device@3.5-impl_headers",
vendor: true,
- export_include_dirs: ["include/device_v3_5_impl"]
+ export_include_dirs: ["include/device_v3_5_impl"],
}
cc_library_headers {
name: "camera.device@3.5-external-impl_headers",
vendor: true,
- export_include_dirs: ["include/ext_device_v3_5_impl"]
+ export_include_dirs: ["include/ext_device_v3_5_impl"],
}
cc_library_shared {
@@ -51,6 +51,7 @@
"android.hardware.graphics.mapper@3.0",
"android.hardware.graphics.mapper@4.0",
"liblog",
+ "libgralloctypes",
"libhardware",
"libcamera_metadata",
],
@@ -85,6 +86,7 @@
"android.hardware.graphics.mapper@3.0",
"android.hardware.graphics.mapper@4.0",
"liblog",
+ "libgralloctypes",
"libhardware",
"libcamera_metadata",
"libfmq",
@@ -92,7 +94,7 @@
"libyuv",
"libjpeg",
"libexif",
- "libtinyxml2"
+ "libtinyxml2",
],
static_libs: [
"android.hardware.camera.common@1.0-helper",
diff --git a/camera/device/3.6/default/Android.bp b/camera/device/3.6/default/Android.bp
index a2ddebd..2871e2a 100644
--- a/camera/device/3.6/default/Android.bp
+++ b/camera/device/3.6/default/Android.bp
@@ -17,7 +17,7 @@
cc_library_headers {
name: "camera.device@3.6-external-impl_headers",
vendor: true,
- export_include_dirs: ["include/ext_device_v3_6_impl"]
+ export_include_dirs: ["include/ext_device_v3_6_impl"],
}
cc_library_shared {
@@ -48,6 +48,7 @@
"android.hardware.graphics.mapper@3.0",
"android.hardware.graphics.mapper@4.0",
"liblog",
+ "libgralloctypes",
"libhardware",
"libcamera_metadata",
"libfmq",
@@ -55,7 +56,7 @@
"libyuv",
"libjpeg",
"libexif",
- "libtinyxml2"
+ "libtinyxml2",
],
static_libs: [
"android.hardware.camera.common@1.0-helper",
diff --git a/current.txt b/current.txt
index e29370d..4b5f168 100644
--- a/current.txt
+++ b/current.txt
@@ -605,6 +605,7 @@
fb382e986c10b8fbb797a8546e8f9ea6d1107bfe6f3fb7e57f6bbbf1f807a906 android.hardware.neuralnetworks@1.2::IDevice
40e71cd693de5b832325c5d8f081f2ff20a7ba2b89d401cee5b4b3eb0e241681 android.hardware.neuralnetworks@1.2::IPreparedModel
ee1a0dee5be00a6fe2d4d3270068c78016dcb194d768fe07ed894ea20904037f android.hardware.neuralnetworks@1.2::types
+882b1c042ff842d7c52a794fab60bf6c599ef6b100ce99fa1772615096811d05 android.hardware.neuralnetworks@1.2::types # b/155508675
a785a57447a81e9c130eef6904c3a5c256076c6a04588c40620ebd6fa2660d77 android.hardware.radio@1.2::types
1a6e2bd289f22931c526b21916910f1d4c436b7acb9556e4243de4ce8e6cc2e4 android.hardware.soundtrigger@2.0::ISoundTriggerHwCallback
fd65298e1e09e0e3c781ab18305920d757dbe55a3b459ce17814ec5cf6dfee99 android.hardware.wifi@1.0::IWifiP2pIface
@@ -718,6 +719,7 @@
ee9dc34b9925b8367b1111c72bd6d9d375432735e451572ca5a665d8516a7744 android.hardware.neuralnetworks@1.3::IPreparedModel
eee3430cc86c97c7b407495863d8fb61da6f1a64b7721e77b9b4909b11b174e9 android.hardware.neuralnetworks@1.3::IPreparedModelCallback
acf84925f8ee0a651f2ec547ac334034de266479b93af5434f6c1f25e66aba96 android.hardware.neuralnetworks@1.3::types
+07801d19ca8a4f20543dae6b4d0c4d8b87e5161d3c431e973a1839cb7915a666 android.hardware.neuralnetworks@1.3::types # b/155508675
b454df853441c12f6e425e8a60dd29fda20f5e6e39b93d1103e4b37495db38aa android.hardware.radio@1.5::IRadio
fcbb0742a88215ee7a6d7ce0825d253eb2b50391fc6c8c48667f9fd7f6d4549e android.hardware.radio@1.5::IRadioIndication
b809193970a91ca637a4b0184767315601d32e3ef3d5992ffbc7a8d14a14f015 android.hardware.radio@1.5::IRadioResponse
diff --git a/neuralnetworks/1.2/types.hal b/neuralnetworks/1.2/types.hal
index 2c3c599..9eff7ff 100644
--- a/neuralnetworks/1.2/types.hal
+++ b/neuralnetworks/1.2/types.hal
@@ -3872,6 +3872,8 @@
*
* Outputs:
* * 0: A tensor of the same {@link OperandType} as input0.
+ * If all dimensions are reduced and keep_dims is false, the output
+ * shape is [1].
*/
REDUCE_ALL = 75,
@@ -3897,6 +3899,8 @@
*
* Outputs:
* * 0: A tensor of the same {@link OperandType} as input0.
+ * If all dimensions are reduced and keep_dims is false, the output
+ * shape is [1].
*/
REDUCE_ANY = 76,
@@ -3924,6 +3928,8 @@
*
* Outputs:
* * 0: A tensor of the same {@link OperandType} as input0.
+ * If all dimensions are reduced and keep_dims is false, the output
+ * shape is [1].
* For a {@link OperandType::TENSOR_QUANT8_ASYMM} tensor,
* the scale and zeroPoint must be the same as input0.
*/
@@ -3953,6 +3959,8 @@
*
* Outputs:
* * 0: A tensor of the same {@link OperandType} as input0.
+ * If all dimensions are reduced and keep_dims is false, the output
+ * shape is [1].
* For a {@link OperandType::TENSOR_QUANT8_ASYMM} tensor,
* the scale and zeroPoint must be the same as input0.
*/
@@ -3980,6 +3988,8 @@
*
* Outputs:
* * 0: A tensor of the same {@link OperandType} as input0.
+ * If all dimensions are reduced and keep_dims is false, the output
+ * shape is [1].
*/
REDUCE_PROD = 79,
@@ -4005,6 +4015,8 @@
*
* Outputs:
* * 0: A tensor of the same {@link OperandType} as input0.
+ * If all dimensions are reduced and keep_dims is false, the output
+ * shape is [1].
*/
REDUCE_SUM = 80,
diff --git a/neuralnetworks/1.3/types.hal b/neuralnetworks/1.3/types.hal
index 56930c2..83cf442 100644
--- a/neuralnetworks/1.3/types.hal
+++ b/neuralnetworks/1.3/types.hal
@@ -4096,6 +4096,8 @@
*
* Outputs:
* * 0: A tensor of the same {@link OperandType} as input0.
+ * If all dimensions are reduced and keep_dims is false, the output
+ * shape is [1].
*/
REDUCE_ALL = @1.2::OperationType:REDUCE_ALL,
@@ -4121,6 +4123,8 @@
*
* Outputs:
* * 0: A tensor of the same {@link OperandType} as input0.
+ * If all dimensions are reduced and keep_dims is false, the output
+ * shape is [1].
*/
REDUCE_ANY = @1.2::OperationType:REDUCE_ANY,
@@ -4149,6 +4153,8 @@
*
* Outputs:
* * 0: A tensor of the same {@link OperandType} as input0.
+ * If all dimensions are reduced and keep_dims is false, the output
+ * shape is [1].
* For a {@link OperandType::TENSOR_QUANT8_ASYMM} and
* {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} tensor,
* the scale and zeroPoint must be the same as input0.
@@ -4180,6 +4186,8 @@
*
* Outputs:
* * 0: A tensor of the same {@link OperandType} as input0.
+ * If all dimensions are reduced and keep_dims is false, the output
+ * shape is [1].
* For a {@link OperandType::TENSOR_QUANT8_ASYMM} and
* {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} tensor,
* the scale and zeroPoint must be the same as input0.
@@ -4208,6 +4216,8 @@
*
* Outputs:
* * 0: A tensor of the same {@link OperandType} as input0.
+ * If all dimensions are reduced and keep_dims is false, the output
+ * shape is [1].
*/
REDUCE_PROD = @1.2::OperationType:REDUCE_PROD,
@@ -4233,6 +4243,8 @@
*
* Outputs:
* * 0: A tensor of the same {@link OperandType} as input0.
+ * If all dimensions are reduced and keep_dims is false, the output
+ * shape is [1].
*/
REDUCE_SUM = @1.2::OperationType:REDUCE_SUM,