Camera: Cache and defer Surface binder IPC calls
Try to cache and defer Surface related IPC configuration
calls. Specifically:
1) Avoid retrieving the consumer name until dump
2) Cache and re-use the surface consumer usage value
3) Configure the producer max undequeued buffer count
instead of the total buffer count
Additionally, raise the stream configuration thread
prioirty during the binder IPC intensive stream/surface
setup.
Bug: 323292530
Test: Manual using camera application,
adb shell dumpsys media.camera
Change-Id: Ibf4149a2b1fb8e5a5e357fa6e2360c70a743413d
diff --git a/services/camera/libcameraservice/device3/Camera3InputStream.cpp b/services/camera/libcameraservice/device3/Camera3InputStream.cpp
index 54ffbd7..283322e 100644
--- a/services/camera/libcameraservice/device3/Camera3InputStream.cpp
+++ b/services/camera/libcameraservice/device3/Camera3InputStream.cpp
@@ -216,7 +216,7 @@
return OK;
}
-void Camera3InputStream::dump(int fd, [[maybe_unused]] const Vector<String16> &args) const {
+void Camera3InputStream::dump(int fd, [[maybe_unused]] const Vector<String16> &args) {
std::string lines;
lines += fmt::sprintf(" Stream[%d]: Input\n", mId);
write(fd, lines.c_str(), lines.size());
@@ -297,7 +297,7 @@
return OK;
}
-status_t Camera3InputStream::getEndpointUsage(uint64_t *usage) const {
+status_t Camera3InputStream::getEndpointUsage(uint64_t *usage) {
// Per HAL3 spec, input streams have 0 for their initial usage field.
*usage = 0;
return OK;