需要帮助创建 RTCVideoframe
这是 RTCVideoframe 的初始化方法:RTCVideoFrame(buffer: RTCVideoFrameBuffer, rotation: RTCVideoRotation, timeStampNs: Int64)
我能够获得 CVPixelBuffer 作为输入缓冲区
如何将 CVPixelBuffer
转换为 RTCVideoframeBuffer
。
谢谢,任何帮助都非常感激。
需要帮助创建 RTCVideoframe
这是 RTCVideoframe 的初始化方法:RTCVideoFrame(buffer: RTCVideoFrameBuffer, rotation: RTCVideoRotation, timeStampNs: Int64)
我能够获得 CVPixelBuffer 作为输入缓冲区
如何将 CVPixelBuffer
转换为 RTCVideoframeBuffer
。
谢谢,任何帮助都非常感激。
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))
}
} )}
`