使用 VTCompressionSessionEncodeFrame 时如何修复 'OSStatus' 在没有更多上下文的情况下不明确
How to fix 'OSStatus' is ambiguous without more context when using VTCompressionSessionEncodeFrame
我一直在尝试使用 VTCompressionSessionEncodeFrame
对一些 CMSampleBuffers 进行编码,但是当我尝试使用它时,我总是得到这个错误:Expression type 'OSStatus' (aka 'Int32') is ambiguous without more context
我试图找出它是什么但没有成功,这是我正在使用的代码:
var compressed = VTCompressionSessionEncodeFrame(session: vtCompressionSession, imageBuffer: imageBuff!, presentationTimeStamp: nil, duration: CMTime.invalid, frameProperties: nil, infoFlagsOut: infoFlags)
我也没有在代码的其他任何地方引用压缩变量。
感谢所有帮助。
我想通了!我变了
var compressed = VTCompressionSessionEncodeFrame(session: vtCompressionSession, imageBuffer: imageBuff!, presentationTimeStamp: nil, duration: CMTime.invalid, frameProperties: nil, infoFlagsOut: infoFlags)
至
var output: VRCompressionOutputHandler? = nil
VTCompressionSessionEncodeFrame(session: vtCompressionSession, imageBuffer: imageBuff!, presentationTimeStamp: nil, duration: CMTime.invalid, frameProperties: nil, infoFlagsOut: infoFlags, outputHandler: output)
我一直在尝试使用 VTCompressionSessionEncodeFrame
对一些 CMSampleBuffers 进行编码,但是当我尝试使用它时,我总是得到这个错误:Expression type 'OSStatus' (aka 'Int32') is ambiguous without more context
我试图找出它是什么但没有成功,这是我正在使用的代码:
var compressed = VTCompressionSessionEncodeFrame(session: vtCompressionSession, imageBuffer: imageBuff!, presentationTimeStamp: nil, duration: CMTime.invalid, frameProperties: nil, infoFlagsOut: infoFlags)
我也没有在代码的其他任何地方引用压缩变量。
感谢所有帮助。
我想通了!我变了
var compressed = VTCompressionSessionEncodeFrame(session: vtCompressionSession, imageBuffer: imageBuff!, presentationTimeStamp: nil, duration: CMTime.invalid, frameProperties: nil, infoFlagsOut: infoFlags)
至
var output: VRCompressionOutputHandler? = nil
VTCompressionSessionEncodeFrame(session: vtCompressionSession, imageBuffer: imageBuff!, presentationTimeStamp: nil, duration: CMTime.invalid, frameProperties: nil, infoFlagsOut: infoFlags, outputHandler: output)