summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Carlos Martinez Romero <carlosmr@google.com> 2024-12-10 18:35:38 -0800
committer Carlos Martinez Romero <carlosmr@google.com> 2024-12-10 18:35:38 -0800
commit8c9f7f57fba6e308e8423d5234550d7fe01b965e (patch)
tree3fa0ecf84ca0244f48e1ee59411c3dc00fed5118
parent125c5f3ab77b7b6071a283ad7a5dce7118a8709b (diff)
Update the fuzzers to use the flag SurfaceTypes
We are currently limitig the use of IGBPs outside of libgui to allow for further development of bufferqueues without external breakages. More information at go/warren-buffers. BYPASS_IGBP_IGBC_API_REASON: this CL is part of the migration. Bug: 342197851 Test: atest camera_client_test Flag: com.android.graphics.libgui.flags.wb_libcameraservice Change-Id: Ic922a8ac5a1cf35b2fbc92f63366da9ccaa84445
-rw-r--r--libs/gui/Flags.cpp8
-rw-r--r--libs/gui/include/gui/Flags.h1
2 files changed, 9 insertions, 0 deletions
diff --git a/libs/gui/Flags.cpp b/libs/gui/Flags.cpp
index 85ee2cddad..ee2802f706 100644
--- a/libs/gui/Flags.cpp
+++ b/libs/gui/Flags.cpp
@@ -29,6 +29,14 @@ sp<SurfaceType> surfaceToSurfaceType(const sp<Surface>& surface) {
#endif
}
+ParcelableSurfaceType surfaceToParcelableSurfaceType(const sp<Surface>& surface) {
+#if WB_LIBCAMERASERVICE_WITH_DEPENDENCIES
+ return view::Surface::fromSurface(surface);
+#else
+ return surface->getIGraphicBufferProducer();
+#endif
+}
+
sp<IGraphicBufferProducer> surfaceTypeToIGBP(const sp<SurfaceType>& surface) {
#if WB_LIBCAMERASERVICE_WITH_DEPENDENCIES
return surface->getIGraphicBufferProducer();
diff --git a/libs/gui/include/gui/Flags.h b/libs/gui/include/gui/Flags.h
index 845bc54c71..446841bcd2 100644
--- a/libs/gui/include/gui/Flags.h
+++ b/libs/gui/include/gui/Flags.h
@@ -46,6 +46,7 @@ typedef android::sp<android::IGraphicBufferProducer> ParcelableSurfaceType;
namespace flagtools {
sp<SurfaceType> surfaceToSurfaceType(const sp<Surface>& surface);
+ParcelableSurfaceType surfaceToParcelableSurfaceType(const sp<Surface>& surface);
ParcelableSurfaceType toParcelableSurfaceType(const view::Surface& surface);
sp<IGraphicBufferProducer> surfaceTypeToIGBP(const sp<SurfaceType>& surface);
bool isSurfaceTypeValid(const sp<SurfaceType>& surface);