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

Commit 9dc2eef1 authored by Carlos Martinez Romero's avatar Carlos Martinez Romero Committed by Android (Google) Code Review
Browse files

Merge "Add support flag tools for media migration." into main

parents 8fff562e 44ee2a26
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