WebRTC Series - Video VideoBroadcaster and Video Streaming


In the video acquisition process of the previous article, after the video data acquisition is completed and before the encoder, if two channels of video are required for rendering processing, WebRTC implements a video distributor VideoBroadcaster; it is used to distribute the acquired video frames; this
article The article mainly uses iOS as an example to introduce the process of VideoBroadcaster distributing video streams. What needs to be emphasized is that the local rendering of iOS does not use VideoBroadcaster, but is directly displayed through the preview class provided by the system; the realization of Android and PC is displayed after transferring VideoBroadcaster data ;

1. Add sink to VideoBroadcaster

At the break point VideoBroadcasterof the class AddOrUpdateSinkmethod, when the peerconnection adds the video track, the call stack of the first break point is as follows:
insert image description here
Here, the analysis starts from the top layer of the stack. In VideoRtpSenderthe class SetSend()method, it is mainly to find the source and then switch to the work thread. The main The code is as follows ÿ

Guess you like

Origin blog.csdn.net/lym594887256/article/details/128477344