WebRTCDemo.apk代码走读(二):发送Call

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

VoiceEngine_startListen
    VoEBaseImpl::StartReceive
        channelPtr->StartReceiving设置channel的receiving的状态
VoiceEngine_startPlayout
    VoEBaseImpl::StartPlayout
        VoEBaseImpl::StartPlayout--没有channelId,涉及到硬件,所以是唯一全局的
            AudioDeviceModuleImpl::InitPlayout      
                AudioDeviceTemplate::InitPlayout
                    OpenSlesOutput::InitPlayout,设置状态
            AudioDeviceModuleImpl::StartPlayout     
                AudioDeviceTemplate::StartPlayout
                    OpenSlesOutput::StartPlayout,创建硬件资源
        Channel::StartPlayout
            OutputMixer::SetMixabilityStatus                
                AudioConferenceMixerImpl::SetMixabilityStatus
                    AudioConferenceMixerImpl::AddParticipantToList加入到混音器中
VoiceEngine_startSend
    VoEBaseImpl::StartSend                      
        VoEBaseImpl::StartSend() --没有channelId,涉及到硬件,所以是唯一全局的
            AudioDeviceModuleImpl::StartRecording
                AudioDeviceTemplate::StartRecording
                    OpenSlesInput::StartRecording,创建硬件资源
            AudioDeviceModuleImpl::InitRecording
                AudioDeviceTemplate::InitRecording
                    OpenSlesInput::InitRecording,配置状态
        Channel::StartSend,设置状态
VideoEngine_addRenderer
    ViERenderImpl::AddRenderer
        ViERenderManager::AddRenderStream
            VideoRender::CreateVideoRender, VideoRender和上层的window一一对应
                new ModuleVideoRenderImpl       
                    new AndroidNativeOpenGl2Renderer
                    AndroidNativeOpenGl2Renderer::Init,和JNI环境关联起来
            加入到render_list,??可以有多个Render吗?
            ViERenderer::CreateViERenderer
                new ViERenderer
                    new ViEExternalRendererImpl,用于回调
                        new VideoFrame
                ViERenderer::Init       
                    ModuleVideoRenderImpl::AddIncomingRenderStream
                        VideoRenderAndroid::AddIncomingRenderStream
                            AndroidNativeOpenGl2Renderer::CreateAndroidRenderChannel
                                new AndroidNativeOpenGl2Channel
                                AndroidNativeOpenGl2Channel::Init, 
                                    和JINI环境关联起来
                                    注册两个Native函数,AndroidNativeOpenGl2Channel::DrawNativeStatic,AndroidNativeOpenGl2Channel::CreateOpenGLNativeStatic
                        streamId和AndroidStream(AndroidNativeOpenGl2Channel)一一对应,可以保存多个                          
                    new IncomingVideoStream
                        new VideoRenderFrames
                    IncomingVideoStream::SetRenderCallback初始化回调函数(AndroidNativeOpenGl2Channel)
                    IncomingVideoStream加入map中??可以有多个?
VideoEngine_startRender
    ViERenderer::StartRender
        ModuleVideoRenderImpl::StartRender                          
            IncomingVideoStream::Start
                ThreadWrapper::CreateThread,回调是IncomingVideoStream::IncomingVideoStreamProcess
                Thread启动
                EventPosix::StartTimer
            VideoRenderAndroid::StartRender
                ThreadWrapper::CreateThread,回调是VideoRenderAndroid::JavaRenderThreadProcess
                启动线程
VideoEngine_startReceive
    ViEBaseImpl::StartReceive
        ViEChannel::StartReceive
            ViEReceiver::StartReceive,设置状态
VideoEngine_getCaptureDevice
    ViECaptureImpl::GetCaptureDevice
        ViEInputManager::GetDeviceName
            VideoCaptureFactory::CreateDeviceInfo
                new videocapturemodule::DeviceInfoAndroid
                DeviceInfoAndroid::GetDeviceName
VideoEngine_allocateCaptureDevice
    ViECaptureImpl::AllocateCaptureDevice
        ViEInputManager::CreateCaptureDevice
            ViECapturer::CreateViECapture
                new ViECapturer
                    ThreadWrapper::CreateThread,回调函数ViECapturer::ViECaptureProcess
                    new OveruseFrameDetector
                ViECapturer::Init
                    VideoCaptureFactory::Create
                        VideoCaptureImpl::Create
                            new videocapturemodule::VideoCaptureAndroid
                    VideoCaptureAndroid::RegisterCaptureDataCallback注册回调函数ViECapturer
                    在线程中注册Module,videocapturemodule::VideoCaptureAndroid
            保存ID,可以有多个ViECapturer
VideoEngine_connectCaptureDevice
    ViECaptureImpl::ConnectCaptureDevice,链接摄像头和channle
        ViEFrameProviderBase::RegisterFrameCallback,可以有多个callback           
        ViECapturer::FrameCallbackChanged,将ViEEncoder作为回调类放到VieCapturer的回调list中
            VideoCaptureAndroid::CaptureSettings
            VideoCaptureAndroid::StopCapture
            VideoCaptureAndroid::StartCapture,配置JNI环境,获取摄像头参数   
VideoEngine_startCapture
    ViECaptureImpl::StartCapture
        ViECapturer::Start
            ViEFrameProviderBase::GetBestFormat获取最好的尺寸
                ViEEncoder::GetPreferedFrameSettings
            VideoCaptureAndroid::StartCapture,配置JNI环境,获取摄像头参数
VideoEngine_startSend
    ViEBaseImpl::StartSend
        ViEEncoder::Pause,设置状态
        ViEChannel::StartSend
            ModuleRtpRtcpImpl::SetSendingMediaStatus
                RTPSender::SetSendingMediaStatus设置状态为true
            ModuleRtpRtcpImpl::SetSendingStatus
                RTPSender::SetSendingStatus,初始化状态和RTP头
            还能有多个ModuleRtpRtcpImpl???
        ViEEncoder::SendKeyFrame
            VideoCodingModuleImpl::IntraFrameRequest
                VideoSender::IntraFrameRequest
                    VCMGenericEncoder::RequestFrame
                        VP8EncoderImpl::Encode

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