Flutter Engine
The Flutter Engine
Instance Methods | List of all members
TestExternalTexture Class Reference
Inheritance diagram for TestExternalTexture:
<FlutterTexture>

Instance Methods

(nonnull instancetype) - initWidth:height:pixelFormatType:
 
(CVPixelBufferRef) - copyPixelBuffer [implementation]
 
(CVPixelBufferRef) - pixelBuffer [implementation]
 
- Instance Methods inherited from <FlutterTexture>
(CVPixelBufferRef _Nullable) - copyPixelBuffer
 
(void) - onTextureUnregistered:
 

Detailed Description

Definition at line 25 of file FlutterEmbedderExternalTextureTest.mm.

Method Documentation

◆ copyPixelBuffer

- (CVPixelBufferRef) copyPixelBuffer
implementation

Copy the contents of the texture into a CVPixelBuffer.

The type of the pixel buffer is one of the following:

  • kCVPixelFormatType_32BGRA
  • kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange
  • kCVPixelFormatType_420YpCbCr8BiPlanarFullRange

Reimplemented from <FlutterTexture>.

Definition at line 36 of file FlutterEmbedderExternalTextureTest.mm.

50 {
51 return [self pixelBuffer];
52}

◆ initWidth:height:pixelFormatType:

- (nonnull instancetype) initWidth: (size_t)  width
height: (size_t)  height
pixelFormatType: (OSType)  pixelFormatType 

Definition at line 36 of file FlutterEmbedderExternalTextureTest.mm.

39 :(size_t)width
40 height:(size_t)height
41 pixelFormatType:(OSType)pixelFormatType {
42 if (self = [super init]) {
43 _width = width;
45 _pixelFormatType = pixelFormatType;
46 }
47 return self;
48}
static bool init()
int32_t height
int32_t width

◆ pixelBuffer

- (CVPixelBufferRef) pixelBuffer
implementation

Definition at line 36 of file FlutterEmbedderExternalTextureTest.mm.

54 {
55 NSDictionary* options = @{
56 // This key is required to generate SKPicture with CVPixelBufferRef in metal.
57 (NSString*)kCVPixelBufferMetalCompatibilityKey : @YES
58 };
59 CVPixelBufferRef pxbuffer = NULL;
60 CVReturn status = CVPixelBufferCreate(kCFAllocatorDefault, _width, _width, _pixelFormatType,
61 (__bridge CFDictionaryRef)options, &pxbuffer);
62 FML_CHECK(status == kCVReturnSuccess && pxbuffer != nullptr) << "Failed to create pixel buffer";
63 return pxbuffer;
64}
const char * options
#define FML_CHECK(condition)
Definition: logging.h:85

The documentation for this class was generated from the following file: