1

我一直在尝试使用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)

我也没有在代码的其他任何地方引用压缩变量。

感谢所有帮助。

4

1 回答 1

0

我想到了!我变了

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)
于 2020-10-13T01:19:23.143 回答