summaryrefslogtreecommitdiff
path: root/devices
diff options
context:
space:
mode:
authorDaniel Norman <danielnorman@google.com>2022-03-03 22:15:53 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2022-03-03 22:15:53 +0000
commitcec780bbe6145f51525894536c380d3b48716086 (patch)
treec6c579dfbb0a2314a248d06c354816038e024f15 /devices
parente80ab0d83172de3d4cb8b3137fbee337910186bf (diff)
parent3e72bdaa2284686f8cccb7c37201d492662dc291 (diff)
downloadcamera-cec780bbe6145f51525894536c380d3b48716086.tar.gz
Copies the emulated camera HAL APEX for demoing multi-install. am: 3e72bdaa22sam_222710654
Original change: https://android-review.googlesource.com/c/platform/hardware/google/camera/+/2004690 Change-Id: I030060e170f13d42961380d03f3a82c853dbd7ba
Diffstat (limited to 'devices')
-rw-r--r--devices/EmulatedCamera/hwl/Android.bp18
-rw-r--r--devices/EmulatedCamera/hwl/EmulatedScene.cpp5
-rw-r--r--devices/EmulatedCamera/hwl/apex/Android.bp21
3 files changed, 36 insertions, 8 deletions
diff --git a/devices/EmulatedCamera/hwl/Android.bp b/devices/EmulatedCamera/hwl/Android.bp
index be0c8b5..cf276ec 100644
--- a/devices/EmulatedCamera/hwl/Android.bp
+++ b/devices/EmulatedCamera/hwl/Android.bp
@@ -3,8 +3,8 @@ package {
default_applicable_licenses: ["Android-Apache-2.0"],
}
-cc_library_shared {
- name: "libgooglecamerahwl_impl",
+cc_defaults {
+ name: "libgooglecamerahwl_impl_defaults",
owner: "google",
proprietary: true,
srcs: [
@@ -64,3 +64,17 @@ cc_library_shared {
"libgooglecamerahal_headers",
],
}
+
+cc_library_shared {
+ name: "libgooglecamerahwl_impl",
+ defaults: ["libgooglecamerahwl_impl_defaults"],
+}
+
+cc_library_shared {
+ name: "libgooglecamerahwl_impl_fast_scene_cycle",
+ defaults: ["libgooglecamerahwl_impl_defaults"],
+ stem: "libgooglecamerahwl_impl",
+ cflags: ["-DFAST_SCENE_CYCLE"],
+ // Never installed to /vendor, only used inside an APEX.
+ installable: false,
+}
diff --git a/devices/EmulatedCamera/hwl/EmulatedScene.cpp b/devices/EmulatedCamera/hwl/EmulatedScene.cpp
index 0fe5615..965b3b5 100644
--- a/devices/EmulatedCamera/hwl/EmulatedScene.cpp
+++ b/devices/EmulatedCamera/hwl/EmulatedScene.cpp
@@ -211,9 +211,12 @@ void EmulatedScene::SetTestPatternData(uint32_t data[4]) {
void EmulatedScene::CalculateScene(nsecs_t time, int32_t handshake_divider) {
// Calculate time fractions for interpolation
+ const nsecs_t kOneHourInNsec = 1e9 * 60 * 60;
+#ifdef FAST_SCENE_CYCLE
+ hour_ = static_cast<int>(time * 6000 / kOneHourInNsec) % 24;
+#endif
int time_idx = hour_ / kTimeStep;
int next_time_idx = (time_idx + 1) % (24 / kTimeStep);
- const nsecs_t kOneHourInNsec = 1e9 * 60 * 60;
nsecs_t time_since_idx =
(hour_ - time_idx * kTimeStep) * kOneHourInNsec + time;
float time_frac = time_since_idx / (float)(kOneHourInNsec * kTimeStep);
diff --git a/devices/EmulatedCamera/hwl/apex/Android.bp b/devices/EmulatedCamera/hwl/apex/Android.bp
index 8f79f15..30f80e3 100644
--- a/devices/EmulatedCamera/hwl/apex/Android.bp
+++ b/devices/EmulatedCamera/hwl/apex/Android.bp
@@ -33,8 +33,8 @@ prebuilt_etc {
installable: false,
}
-apex {
- name: "com.google.emulated.camera.provider.hal",
+apex_defaults {
+ name: "com.google.emulated.camera.provider.hal.defaults",
manifest: "apex_manifest.json",
key: "com.google.emulated.camera.provider.hal.key",
certificate: ":com.google.emulated.camera.provider.hal.certificate",
@@ -46,13 +46,11 @@ apex {
binaries: [
"android.hardware.camera.provider@2.7-service-google",
],
- native_shared_libs: [
- "libgooglecamerahwl_impl",
- ],
overrides: [
"android.hardware.camera.provider@2.7-impl-google",
"android.hardware.camera.provider@2.7-service-google",
"libgooglecamerahwl_impl",
+ "libgooglecamerahwl_impl_fast_scene_cycle",
],
prebuilts: [
"com.google.emulated.camera.provider.hal.rc",
@@ -67,3 +65,16 @@ apex {
],
vintf_fragments: [":android.hardware.camera.provider@2.7-service-google.xml"],
}
+
+apex {
+ name: "com.google.emulated.camera.provider.hal",
+ defaults: ["com.google.emulated.camera.provider.hal.defaults"],
+ native_shared_libs: ["libgooglecamerahwl_impl"],
+}
+
+apex {
+ name: "com.google.emulated.camera.provider.hal.fastscenecycle",
+ defaults: ["com.google.emulated.camera.provider.hal.defaults"],
+ native_shared_libs: ["libgooglecamerahwl_impl_fast_scene_cycle"],
+ multi_install_skip_symbol_files: true,
+}