diff --git a/SceneKitVideoRecorder.podspec b/SceneKitVideoRecorder.podspec index c622f51..7f110b2 100644 --- a/SceneKitVideoRecorder.podspec +++ b/SceneKitVideoRecorder.podspec @@ -16,7 +16,7 @@ Pod::Spec.new do |s| # s.name = "SceneKitVideoRecorder" - s.version = "1.0.0" + s.version = "1.0.1" s.summary = "Record videos of SceneKit and ARKit" # This description is used to generate tags and improve search results. diff --git a/SceneKitVideoRecorder/Classes/PixelBufferFactory.swift b/SceneKitVideoRecorder/Classes/PixelBufferFactory.swift index 8666636..acc7652 100644 --- a/SceneKitVideoRecorder/Classes/PixelBufferFactory.swift +++ b/SceneKitVideoRecorder/Classes/PixelBufferFactory.swift @@ -12,6 +12,9 @@ import UIKit struct PixelBufferFactory { + + static let context = CIContext(options: nil) + static func make(with metalLayer: CAMetalLayer, usingBuffer pool: CVPixelBufferPool) -> (CVPixelBuffer?, UIImage) { let currentDrawable = metalLayer.nextDrawable() @@ -38,7 +41,6 @@ struct PixelBufferFactory { static func imageFromCVPixelBuffer(buffer: CVPixelBuffer) -> UIImage { let ciimage = CIImage(cvPixelBuffer: buffer) - let context = CIContext(options: nil) let cgimgage = context.createCGImage(ciimage, from: CGRect(x: 0, y: 0, width: CVPixelBufferGetWidth(buffer), height: CVPixelBufferGetHeight(buffer))) let uiimage = UIImage(cgImage: cgimgage!)