VTCompressionSession
管理输入视频数据压缩的会话。
压缩会话支持一系列视频frame的压缩。流程如下:
VTCompressionSessionCreate创建session- 使用
VTSessionSetPropertyVTSessionSetProperties配置sessions属性。 - 使用
VTCompressionSessionEncodeFrame编码视频frames,在VTCompressionOutputCallback里接收压缩的视频frames. VTComressionSessionCompleteFrames表示没有视频数据输入了。VTCompressionSessionInvalidate结束session,释放内存。
创建session
1VTCompressionSessionCreate配置session
|
|
编码frame
1234567891011VTCompressionSessionPrepareToEncodeFrames编码器在开始编码前进行资源分配,可选VTCompressionSessionEncodeFrame给session 提供frameVTCompressionSessionEncodeFrameWithOutputHandler给sesion 提供frame,压缩完成后调用callback。VTCompressionSessionCompleteFrames结束压缩session。检查session
12345VTCompressionSessionGetPixelBufferPool返回一个为压缩session提供理想资源pixel buffer的容器池。VTCompressionSessionGetTypeIDRetrieves the Core Foundation type identifier for the compression session.多通道压缩
12345678VTCompressionSessionBeginPass标记一个压缩通道的开始VTCompressionSessionEndPassMarks the end of a compression pass.VTCompressionSessionGetTimeRangesForNextPass获取下一个通道的时间范围。结束Session
|
|
- 数据类型
|
|
- 枚举1VTCompressionSessionOptionFlags
|
|