opt: add doc for macOS
This commit is contained in:
parent
4221adb1cb
commit
0e16af448c
2 changed files with 3 additions and 1 deletions
|
|
@ -1,3 +1,4 @@
|
|||
import 'dart:io';
|
||||
import 'dart:math';
|
||||
import 'dart:typed_data';
|
||||
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@ public final class TextRgba: NSObject, FlutterTexture {
|
|||
public func markFrameAvaliable(data: Data, width: Int, height: Int) -> Bool {
|
||||
self.data = data.withUnsafeBytes { buffer in
|
||||
var pixelBufferCopy: CVPixelBuffer!
|
||||
// macOS only support 32BGRA currently.
|
||||
let result = CVPixelBufferCreate(kCFAllocatorDefault, width, height, kCVPixelFormatType_32BGRA, nil, &pixelBufferCopy)
|
||||
guard result == kCVReturnSuccess else {
|
||||
return nil
|
||||
|
|
@ -53,7 +54,7 @@ public final class TextRgba: NSObject, FlutterTexture {
|
|||
}
|
||||
self.width = width
|
||||
self.height = height
|
||||
if (textureId != -1) {
|
||||
if (textureId != -1 && self.data != nil) {
|
||||
registry?.textureFrameAvailable(textureId)
|
||||
return true
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue