我们看下在VideoSendStream构造函数与线程有关的代码:
VideoSendStream::VideoSendStream(ProcessThread* module_process_thread)
:module_process_thread_(module_process_thread),
encoder_thread_(EncoderThreadFunction, this, "EncoderThread")
{
for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) {
module_process_thread_->RegisterModule(rtp_rtcp);
congestion_controller_->packet_router()->AddRtpModule(rtp_rtcp);
}
module_process_thread_->RegisterModule(&overuse_detector_);
encoder_thread_.Start();
}
具体我就不再说了,直接写出各个线程中的函数为:
void VideoSendStream::EncoderProcess();
void ModuleRtpRtcpImpl::Process();
void OveruseFrameDetector::Process();