clean up macos warnings

This commit is contained in:
Nick Fisher
2023-11-20 23:00:46 +08:00
parent 0474e0305e
commit 8fb7b9aa16

View File

@@ -14,7 +14,7 @@ public class SwiftFlutterFilamentPlugin: NSObject, FlutterPlugin, FlutterTexture
var pixelBufferAttrs = [ var pixelBufferAttrs = [
kCVPixelBufferPixelFormatTypeKey: NSNumber(value: kCVPixelFormatType_32ABGR ), kCVPixelBufferPixelFormatTypeKey: NSNumber(value: kCVPixelFormatType_32ABGR ),
kCVPixelBufferOpenGLCompatibilityKey: kCFBooleanTrue!, kCVPixelBufferOpenGLCompatibilityKey: kCFBooleanTrue!,
kCVPixelBufferIOSurfacePropertiesKey: [:] kCVPixelBufferIOSurfacePropertiesKey: [:] as CFDictionary
] as CFDictionary ] as CFDictionary
var resources:[UInt32:NSData] = [:] var resources:[UInt32:NSData] = [:]
@@ -116,8 +116,9 @@ public class SwiftFlutterFilamentPlugin: NSObject, FlutterPlugin, FlutterTexture
result(unsafeBitCast(resourceLoaderWrapper, to:Int64.self)) result(unsafeBitCast(resourceLoaderWrapper, to:Int64.self))
case "getRenderCallback": case "getRenderCallback":
let renderCallback = markTextureFrameAvailable let renderCallback = markTextureFrameAvailable
result([ let resultArray:[Any] = [
unsafeBitCast(renderCallback, to:Int64.self), unsafeBitCast(Unmanaged.passUnretained(self), to:UInt64.self)]) unsafeBitCast(renderCallback, to:Int64.self), unsafeBitCast(Unmanaged.passUnretained(self), to:UInt64.self)]
result(resultArray)
case "createTexture": case "createTexture":
let args = call.arguments as! [Any] let args = call.arguments as! [Any]
let width = UInt32(args[0] as! Int64) let width = UInt32(args[0] as! Int64)
@@ -147,8 +148,7 @@ public class SwiftFlutterFilamentPlugin: NSObject, FlutterPlugin, FlutterTexture
return return
} }
metalTexture = CVMetalTextureGetTexture(cvMetalTexture!); metalTexture = CVMetalTextureGetTexture(cvMetalTexture!);
let pixelBufferPtr = CVPixelBufferGetBaseAddress(pixelBuffer!);
let pixelBufferAddress = Int(bitPattern:pixelBufferPtr);
let metalTexturePtr = Unmanaged.passUnretained(metalTexture!).toOpaque() let metalTexturePtr = Unmanaged.passUnretained(metalTexture!).toOpaque()
let metalTextureAddress = Int(bitPattern:metalTexturePtr) let metalTextureAddress = Int(bitPattern:metalTexturePtr)