一、简介

VideoCaptureImpl::SetApplyRotation/VideoCaptureImpl::SetCaptureRotation可以动态配置采集到的视频数据旋转角度。然后通过RTP扩展头的kRtpExtensionVideoRotation字段发送给接受端。让接收端做自适应调整。

二、发送端实现

1、get camera data调用栈

videocapturemodule::CaptureInputPin::Receive()
->videocapturemodule::CaptureSinkFilter::ProcessCapturedFrame()
->videocapturemodule::VideoCaptureImpl::IncomingFrame()     
->videocapturemodule::VideoCaptureImpl::DeliverCapturedFrame()     
->WebRtcVideoCapturer::OnFrame()    

 VideoCaptureImpl::IncomingFrame根据配置的旋转角度,预处理视频数据

 

2、发送VideoRotation的RTP扩展头

采集的视频数据随着VideoFrame帧信息rotation_,封装到RTP报文的kRtpExtensionVideoRotation扩展头里面。处理函数AddRtpHeaderExtensions。

 

3、接收端视频渲染模块实时调整

VideoRenderer::OnFrame

 

更多推荐