在创建 RTCVideoframe 时需要帮助
这是 RTCVideoframe 的 init 方法
RTCVideoFrame(buffer: RTCVideoFrameBuffer, rotation: RTCVideoRotation, timeStampNs: Int64)
我能够将输入缓冲区作为 CVPixelBuffer
我怎样才能转换CVpixelBuffer
为RTCVideoFrameBuffer
.
谢谢,非常感谢任何帮助
使用我们收到的 cmSampleBuffer
`
sharedRecorder.startCapture(handler: { (cmSampleBuffer, rpSampleType, error) in
switch rpSampleType {
case RPSampleBufferType.video:
{
let pixelBuffer = CMSampleBufferGetImageBuffer(cmSampleBuffer)!
let rtcpixelBuffer = RTCCVPixelBuffer(pixelBuffer: pixelBuffer)
videoFrame = RTCVideoFrame(buffer: rtcpixelBuffer, rotation: RTCVideoRotation._0, timeStampNs: Int64(timestamp))
}
} )}
`