Convert the pose buffer into a more generic named buffer
* It's likely that we'll have more than one pose buffer
* It's cleaner to separate the vsync info into a separate buffer
Bug: 37001881
Bug: 37240552
Test: Added and manually ran TestNamedBuffersSetup
Change-Id: I76621d3cfa8c21c9d5d1e6e648854067673be9ab
diff --git a/libs/vr/libdisplay/display_client.cpp b/libs/vr/libdisplay/display_client.cpp
index 6d39cdb..ef50a0f 100644
--- a/libs/vr/libdisplay/display_client.cpp
+++ b/libs/vr/libdisplay/display_client.cpp
@@ -216,7 +216,8 @@
return 0;
}
-pdx::Status<void> DisplayClient::SetViewerParams(const ViewerParams& viewer_params) {
+pdx::Status<void> DisplayClient::SetViewerParams(
+ const ViewerParams& viewer_params) {
auto status = InvokeRemoteMethod<DisplayRPC::SetViewerParams>(viewer_params);
if (!status) {
ALOGE("DisplayClient::SetViewerParams: Failed to set viewer params: %s",
@@ -252,16 +253,20 @@
return DisplaySurfaceClient::Create(width, height, format, usage, flags);
}
-std::unique_ptr<BufferConsumer> DisplayClient::GetPoseBuffer() {
- auto status = InvokeRemoteMethod<DisplayRPC::GetPoseBuffer>();
+std::unique_ptr<IonBuffer> DisplayClient::GetNamedBuffer(
+ const std::string& name) {
+ auto status = InvokeRemoteMethod<DisplayRPC::GetNamedBuffer>(name);
if (!status) {
ALOGE(
- "DisplayClient::GetPoseBuffer: Failed to get pose buffer %s",
- status.GetErrorMessage().c_str());
+ "DisplayClient::GetNamedBuffer: Failed to get pose buffer. name=%s, "
+ "error=%s",
+ name.c_str(), status.GetErrorMessage().c_str());
return nullptr;
}
- return BufferConsumer::Import(std::move(status));
+ auto ion_buffer = std::make_unique<IonBuffer>();
+ status.take().Import(ion_buffer.get());
+ return ion_buffer;
}
bool DisplayClient::IsVrAppRunning() {