mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
documented fluttertexture.h (flutter/engine#16950)
This commit is contained in:
parent
8ce4320b06
commit
991d11ca02
@ -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
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user