未验证 提交 c15f239c 编写于 作者: G gaaclarke 提交者: GitHub

documented fluttertexture.h (#16950)

上级 eddda803
......@@ -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 <NSObject>
/** 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 <NSObject>
/**
* 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<FlutterTexture>*)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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册