VideoToolbox (iOS 8+) 提供硬件加速的 H.264/H.265 編解碼接口,底層調用 GPU/專用編碼器。
VTCompressionSession - 硬編碼VTDecompressionSession - 硬解碼CVPixelBuffer - 圖像數據容器(零拷貝傳遞給 Metal/OpenGL 渲染)采集(CMSampleBuffer) → 硬編碼(VTCompressionSession) → 網絡傳輸(RTP)
網絡接收 → 硬解碼(VTDecompressionSession) → 渲染(CVPixelBuffer → Metal)
實時通訊需設置 kVTCompressionPropertyKey_RealTime = kCFBooleanTrue,控制關鍵幀間隔、碼率模式(CBR/VBR)。