Article directory
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 VideoBroadcaster
of the class AddOrUpdateSink
method, when the peerconnection adds the video track, the call stack of the first break point is as follows:
Here, the analysis starts from the top layer of the stack. In VideoRtpSender
the class SetSend()
method, it is mainly to find the source and then switch to the work thread. The main The code is as follows ÿ