WebRTC_2016_12_类关系
2020-10-20 16:04:08 0 举报
webrtc流程梳理
作者其他创作
大纲/内容
VideoCaptureModule
+ GetEncodeInterface()+ CaptureStarted()+ StartCapture()+ RegisterCaptureDataCallback()
webrtc::VideoReceiveStream
+ Start()+ Stop()+ RenderFrame()+ DeliverRtcp()+ DeliverRtp()+ SignalNetworkState()
VCMEncodedFrameCallback
EncodedImageCallback* const post_encode_callback_;
WebRtcVideoReceiveStream
+ SetRenderer()+ SetRecvCodecs()+ RenderFrame()+ Start()
webrtc::VideoReceiveStream* stream_;VideoRenderer* renderer_;
rtc::VideoSinkInterface
WebRtcVideoSendStream
webrtc::VideoSendStream* stream_;rtc::VideoSinkInterface* encoder_sink_
EncoderSink
+ OnEncoderConfigurationChanged()
VCMGenericEncoder
+ InitEncode()
+ VideoEncoder* const encoder_; //VP8/H264...VCMEncodedFrameCallback* const vcm_encoded_frame_callback_;
VideoBroadcaster
+ OnFrame() //sink_pair.sink-OnFrame(frame)
rtc::CriticalSection sinks_and_wants_lock_;
internal::VideoSendStream
vcm::VideoSender
+ RegisterSendCodec()+ RegisterExternalEncoder()+ SetChannelParameters()+ AddVideoFrame() //_encoder-Encode()+ TimeUntilNextProcess()+ Process()
VCMGenericEncoder* _encoder;VCMEncodedFrameCallback _encodedFrameCallback;EncodedImageCallback* const post_encode_callback_;
EncodedImageCallback
// Callback function which is called when an image has been encoded.+ virtual OnEncodedImage()+ OnDroppedFrame()
VideoCaptureDataCallback
+ OnIncomingCapturedFrame()
+ Start()+ Stop()+SetSource(rtc::VideoSourceInterface* source
rtc::ThreadChecker thread_checker_;rtc::TaskQueue* const worker_queue_;rtc::Event thread_sync_event_;std::unique_ptr send_stream_;std::unique_ptr vie_encoder_;
WebRtcVideoEngine2
+ CreateChannel()
WebRtcVideoChannel2
+ AddSendStream()+ AddRecvStream()+ SetCapturer()+ SetRenderer()+ SetSendRtpHeaderExtensions()+ SetRecvRtpHeaderExtensions()
WebRtcCallFactory
+ CreateCall()
WebRtc::Call
+ CreateVideoSendStream()+ CreateAudioSendStream()+ CreateVideoReceiveStream()+ Receiver()+ SignalNetworkState()
PayloadRouter
// 发送RTP数据+ OnEncodedImage() //rtp_modules_[stream_index]-SendOutgoingData
const std::vector rtp_modules_;
VideoCapturer
+ StartCapturing()+ Start()+ OnFrame() //broadcaster_.OnFrame(frame);
rtc::VideoBroadcaster broadcaster_;
//Implements rtc::VideoSourceInterface+ AddOrUpdateSink(); //encoder_sink_ = sink;+ OnFrame() override; //encoder_sink_-OnFrame(video_frame);+ SetVideoFormat()+ Start()
webrtc::Call* const call_;WebRtcVideoEncoderFactory* const external_encoder_factory_;webrtc::VideoSendStream* stream_;rtc::VideoSourceInterface* source_rtc::VideoSinkInterface* encoder_sink_;
SinkPair
VideoSinkInterface* sink;
WebRtcVideoCapturer
+ Start(); //module_-RegisterCaptureDataCallback(*this);+ OnIncomingCapturedFrame() //OnFrame()
std::unique_ptr factory_; rtc::scoped_refptr module_; int captured_frames_; std::vector capture_buffer_;
VideoSendStreamImpl
ViEEncoder* const vie_encoder_;rtc::WeakPtr weak_ptr_;PacketRouter* const packet_router_;PayloadRouter payload_router_;ProcessThread* module_process_thread_;
VideoSinkInterface
1:n
1:n
PacketReceiver
webrtc::VideoSendStream
+ Start()+ Stop()+ Input()+ DeliverRtcp()+ DeliverRtp()+ SignalNetworkState()
VideoCaptureImpl(平台封装)
VideoCaptureDataCallback* _dataCallBack;VideoCaptureFeedBack* _captureCallBack;
VideoEncoder
+ GetDefaultVp8Settings()+ GetDefaultH264Settings()+ InitEncode()+ RegisterEncodeCompleteCallback() //encoder_-RegisterEncodeCompleteCallback (vcm_encoded_frame_callback_);+ Encode() //encoder_-Encode
VideoEncoder* const encoder_; //VP8/H264...VCMEncodedFrameCallback* const vcm_encoded_frame_callback_;
Module
ViEEncoder
rtc::VideoSinkInterface* const pre_encode_callback_;ProcessThread* module_process_thread_;uint32_t encoder_start_bitrate_bps_rtc::TaskQueue encoder_queue_;vcm::VideoSender video_sender_;EncoderSink* sink_;
internal::Call
+ DeliverPacket() //send RTP/RTCP
VideoSourceBase
std::vector sinks_
internal::VideoReceiveStream
template class VideoSourceInterface
0 条评论
下一页