WebRTCDemo.apk代码走读(五):视频接受流程

转载注明出处http://blog.csdn.net/wanghorse

收到视频包
UdpSocketManagerPosixImpl::Run
    UdpSocketManagerPosixImpl::Process
        UdpSocketPosix::HasIncoming(recvfrom)
            UdpTransportImpl::IncomingRTPCallback
                UdpTransportImpl::IncomingRTPFunction       
                    VideoChannelTransport::IncomingRTPPacket
                        ViENetworkImpl::ReceivedRTPPacket
                            ViEChannel::ReceivedRTPPacket
                                ViEReceiver::ReceivedRTPPacket
                                    ViEReceiver::InsertRTPPacket
                                        如果配置了抓包, 可以RtpDumpImpl::DumpPacket
                                        RtpHeaderParserImpl::Parse
                                            RtpHeaderParser::Parse
                                        ViEReceiver::ReceivePacket
                                            RtpReceiverImpl::IncomingRtpPacket
                                                ssrc、payroad等检查
                                                RTPReceiverVideo::ParseRtpPacket
                                                    ViEReceiver::OnReceivedPayloadData
                                                        VideoCodingModuleImpl::IncomingPacket
                                                            VideoReceiver::IncomingPacket
                                                                VCMReceiver::InsertPacket
                                                                    VCMJitterBuffer::InsertPacket
                                                                        VCMJitterBuffer::GetFrame, 完整frame/未完整frame/空frame
                                                                    VCMFrameBuffer::InsertPacket, 组桢
                                                                    如果完成, 插入可解码桢队列(decodable_frames_)
ViEChannel::ChannelDecodeProcess
    VideoCodingModuleImpl::Decode                               
        VideoReceiver::Decode
            VCMReceiver::FrameForDecoding
                VCMJitterBuffer::NextCompleteTimestamp,还未到render时间, 则等待
                VCMJitterBuffer::ExtractAndSetDecode, 取frame
            如果需要,抓图片?()
            VideoReceiver::Decode
                VCMGenericDecoder::Decode
                    VP8DecoderImpl::Decode
decode完成(VP8是同步的, 直接在Decode中调用)
    VCMDecodedFrameCallback::Decoded            
        ViEChannel::FrameToRender
            图片预处理
            ViEFrameProviderBase::DeliverFrame
                ViERenderer::DeliverFrame
                    IncomingVideoStream::RenderFrame, 复制frame,放入队列
IncomingVideoStream::IncomingVideoStreamThreadFun
    IncomingVideoStream::IncomingVideoStreamProcess                 
        AndroidNativeOpenGl2Channel::RenderFrame, 复制frame
VideoRenderAndroid::JavaRenderThreadProcess     
    AndroidNativeOpenGl2Channel::DeliverFrame       
        调用JAVA层函数
            AndroidNativeOpenGl2Channel::DrawNativeStatic
                VideoRenderOpenGles20::Render



郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。