diff --git a/shell/platform/darwin/common/framework/Headers/FlutterTexture.h b/shell/platform/darwin/common/framework/Headers/FlutterTexture.h index bfb66b092a684..cfda1e2df83d7 100644 --- a/shell/platform/darwin/common/framework/Headers/FlutterTexture.h +++ b/shell/platform/darwin/common/framework/Headers/FlutterTexture.h @@ -13,7 +13,13 @@ NS_ASSUME_NONNULL_BEGIN FLUTTER_EXPORT +/** + * Represents a texture that can be shared with Flutter. + * + * See also: https://github.com/flutter/plugins/tree/master/packages/camera + */ @protocol FlutterTexture +/** Copy the contents of the texture into a `CVPixelBuffer`. */ - (CVPixelBufferRef _Nullable)copyPixelBuffer; /** @@ -26,9 +32,26 @@ FLUTTER_EXPORT @end FLUTTER_EXPORT +/** + * A collection of registered `FlutterTexture`'s. + */ @protocol FlutterTextureRegistry +/** + * Registers a `FlutterTexture` for usage in Flutter and returns an id that can be used to reference + * that texture when calling into Flutter with channels. + */ - (int64_t)registerTexture:(NSObject*)texture; +/** + * Notifies Flutter that the content of the previously registered texture has been updated. + * + * This will trigger a call to `-[FlutterTexture copyPixelBuffer]` on the GPU thread. + */ - (void)textureFrameAvailable:(int64_t)textureId; +/** + * Unregisters a `FlutterTexture` that has previously regeistered with `registerTexture:`. + * + * @param textureId The result that was previously returned from `registerTexture:`. + */ - (void)unregisterTexture:(int64_t)textureId; @end