Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 44ee2a26 authored by Carlos Martinez Romero's avatar Carlos Martinez Romero
Browse files

Add support flag tools for media migration.

Bug: 393639172
Flag: com.android.graphics.libgui.flags.wb_media_migration
Test: builds, presubmit
Change-Id: Idbcaf2d4529ebd1010ad47fe5ac6316e85461123
parent 631b3707
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -76,6 +76,14 @@ sp<SurfaceType> convertParcelableSurfaceTypeToSurface(const ParcelableSurfaceTyp
    return surface;
#endif
}

} // namespace flagtools
namespace mediaflagtools {
sp<MediaSurfaceType> igbpToSurfaceType(const sp<IGraphicBufferProducer>& igbp) {
#if COM_ANDROID_GRAPHICS_LIBGUI_FLAGS(WB_MEDIA_MIGRATION)
    return new Surface(igbp);
#else
    return igbp;
#endif
}
} // namespace mediaflagtools
} // namespace android
 No newline at end of file
+13 −0
Original line number Diff line number Diff line
@@ -36,6 +36,7 @@ class Surface;
    (WB_CAMERA3_AND_PROCESSORS_WITH_DEPENDENCIES && \
     COM_ANDROID_GRAPHICS_LIBGUI_FLAGS(WB_LIBCAMERASERVICE))

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

// Media
#if COM_ANDROID_GRAPHICS_LIBGUI_FLAGS(WB_MEDIA_MIGRATION)
typedef android::Surface MediaSurfaceType;
typedef android::view::Surface MediaParcelableSurfaceType;
#else
typedef android::IGraphicBufferProducer MediaSurfaceType;
typedef android::sp<android::IGraphicBufferProducer> MediaParcelableSurfaceType;
#endif

namespace mediaflagtools {
sp<MediaSurfaceType> igbpToSurfaceType(const sp<IGraphicBufferProducer>& igbp);
} // namespace mediaflagtools
} // namespace android