Skip to content

Commit 44ee2a2

Browse files
author
Carlos Martinez Romero
committed
Add support flag tools for media migration.
Bug: 393639172 Flag: com.android.graphics.libgui.flags.wb_media_migration Test: builds, presubmit Change-Id: Idbcaf2d4529ebd1010ad47fe5ac6316e85461123
1 parent 631b370 commit 44ee2a2

2 files changed

Lines changed: 22 additions & 1 deletion

File tree

libs/gui/Flags.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,14 @@ sp<SurfaceType> convertParcelableSurfaceTypeToSurface(const ParcelableSurfaceTyp
7676
return surface;
7777
#endif
7878
}
79-
8079
} // namespace flagtools
80+
namespace mediaflagtools {
81+
sp<MediaSurfaceType> igbpToSurfaceType(const sp<IGraphicBufferProducer>& igbp) {
82+
#if COM_ANDROID_GRAPHICS_LIBGUI_FLAGS(WB_MEDIA_MIGRATION)
83+
return new Surface(igbp);
84+
#else
85+
return igbp;
86+
#endif
87+
}
88+
} // namespace mediaflagtools
8189
} // namespace android

libs/gui/include/gui/Flags.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ class Surface;
3636
(WB_CAMERA3_AND_PROCESSORS_WITH_DEPENDENCIES && \
3737
COM_ANDROID_GRAPHICS_LIBGUI_FLAGS(WB_LIBCAMERASERVICE))
3838

39+
// Camera
3940
#if WB_LIBCAMERASERVICE_WITH_DEPENDENCIES
4041
typedef android::Surface SurfaceType;
4142
typedef android::view::Surface ParcelableSurfaceType;
@@ -54,4 +55,16 @@ ParcelableSurfaceType convertSurfaceTypeToParcelable(sp<SurfaceType> surface);
5455
sp<SurfaceType> convertParcelableSurfaceTypeToSurface(const ParcelableSurfaceType& surface);
5556
} // namespace flagtools
5657

58+
// Media
59+
#if COM_ANDROID_GRAPHICS_LIBGUI_FLAGS(WB_MEDIA_MIGRATION)
60+
typedef android::Surface MediaSurfaceType;
61+
typedef android::view::Surface MediaParcelableSurfaceType;
62+
#else
63+
typedef android::IGraphicBufferProducer MediaSurfaceType;
64+
typedef android::sp<android::IGraphicBufferProducer> MediaParcelableSurfaceType;
65+
#endif
66+
67+
namespace mediaflagtools {
68+
sp<MediaSurfaceType> igbpToSurfaceType(const sp<IGraphicBufferProducer>& igbp);
69+
} // namespace mediaflagtools
5770
} // namespace android

0 commit comments

Comments
 (0)