WebRTCDemo.apk代码走读(一):初始化

  1. MediaEngine.java:MediaEngine初始化

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

new VoiceEngine/VoiceEngine_create
    new VoiceEngineData
        webrtc::VoiceEngine::Create
            GetVoiceEngine
                new VoiceEngineImpl
                    初始化SharedData
                        ProcessThread::CreateProcessThread
                        OutputMixer::Create
                            new OutputMixer
                                AudioConferenceMixer::Create
                                    new AudioConferenceMixerImpl
                                    AudioConferenceMixerImpl::Init
                        TransmitMixer::Create
                            new TransmitMixer
                    初始化VoEAudioProcessingImpl
                    初始化VoECodecImpl
                    初始化VoEDtmfImpl
                    初始化VoENetEqStatsImpl
                    初始化VoENetworkImpl
                    初始化VoERTP_RTCPImpl
                    初始化VoEVideoSyncImpl
                    初始化VoEVolumeControlImpl
                    初始化VoEBaseImpl
VoiceEngine_init
    VoEBaseImpl::Init
        WebRtcSpl_Init
        ProcessThreadImpl::Start
        AudioDeviceModuleImpl::Create
            AudioDeviceModuleImpl::CreatePlatformSpecificObjects
                new AudioDeviceTemplate
                new AudioDeviceUtilityAndroid
        SharedData::set_audio_device
        ProcessThreadImpl::RegisterModule(AudioDeviceModuleImpl)
        AudioDeviceModuleImpl::RegisterEventObserver
        AudioDeviceModuleImpl::RegisterAudioCallback
        AudioDeviceModuleImpl::init
        AudioDeviceModuleImpl::SetPlayoutDevice
        AudioDeviceModuleImpl::InitSpeaker
        AudioDeviceModuleImpl::SetRecordingDevice
        AudioDeviceModuleImpl::InitMicrophone
        AudioDeviceModuleImpl::StereoPlayoutIsAvailable
        AudioDeviceModuleImpl::SetStereoPlayout
        AudioDeviceModuleImpl::SetStereoRecording
        AudioProcessing::Create
            new AudioProcessingImpl
                new audioproc::Event
                new EchoCancellationImpl
                new EchoControlMobileImpl
                new GainControlImpl
                new HighPassFilterImpl
                new LevelEstimatorImpl
                new NoiseSuppressionImpl
                new VoiceDetectionImpl
                new GainControlForNewAgc
VoiceEngine_createChannel
    VoEBaseImpl::CreateChannel
        ChannelManager::CreateChannel
             ChannelManager::CreateChannelInternal
                Channel::CreateChannel
                    new Channel
        VoEBaseImpl::InitializeChannel
            Channel::SetEngineInformation
new VideoEngine
    video_engine_jni.cc:VideoEngine_create
        new VideoEngineData
            vie(vie_imple.cc:webrtc::VideoEngine::Create())
                new VideoEngineImpl
                    初始化ViEBaseImpl
                        new ViESharedData
                            初始化number_cores_(CpuInfo::DetectNumberOfCores()
                            channel_manager_(new ViEChannelManager(0, number_cores_, config)),
                                input_manager_(new ViEInputManager(0, config)),
                                render_manager_(new ViERenderManager(0)),
                                module_process_thread_(ProcessThread::CreateProcessThread()),
                                    new ProcessThreadImpl
                                channel_manager_/input_manager_使用module_process_thread_
                                module_process_thread_启动
VideoEngine_init
    ViEBaseImpl::Init
VideoEngine_setVoiceEngine
    ViEBaseImpl::SetVoiceEngine
        ViEChannelManager::SetVoiceEngine
            ViEChannel::SetVoiceChannel
                ViESyncModule::ConfigureSync
                    new StreamSynchronization
                        new ViESyncDelay
VideoEngine_createChannel
    VideoEngineData::CreateChannel
        ViEBaseImpl::CreateChannel
            ViEChannelManager::CreateChannel
                new ChannelGroup
                    new VieRemb
                    BitrateController::CreateBitrateController
                        BitrateControllerImpl::BitrateControllerImpl
                    new CallStats
                    new EncoderStateFeedback
                    new WrappingBitrateEstimator
                    将主要Module注册到ProcessThread
                new ViEEncoder
                    vcm_(*webrtc::VideoCodingModule::Create())
                        new VideoCodingModuleImpl
                            sender_(new vcm::VideoSender(clock, &post_encode_callback_)),
                                new DebugRecorder(媒体写文件)
                            receiver_(new vcm::VideoReceiver(clock, event_factory))
                    vpm_(*webrtc::VideoProcessingModule::Create(channel_id))),
                        new VideoProcessingModuleImpl
                    RtpRtcp::CreateRtpRtcp
                        new ModuleRtpRtcpImpl
                            RTPSender初始化
                                new RTPSenderVideo
                            RTCPSender初始化
                            RTCPReceiver初始化
                            RTCPReceiver::RegisterRtcpObservers
                    new ViEBitrateObserver
                    new ViEPacedSenderCallback
                BitrateControllerImpl::CreateRtcpBandwidthObserver
                ViEEncoder::Init
                    VideoCodingModuleImpl::InitializeSender
                        VideoSender::InitializeSender
                            VCMCodecDataBase::ResetSender
                    VideoProcessingModuleImpl::EnableTemporalDecimation
                        VPMFramePreprocessor::EnableTemporalDecimation
                            VPMVideoDecimator::EnableTemporalDecimation
                    VideoProcessingModuleImpl::EnableContentAnalysis
                        VPMFramePreprocessor::EnableContentAnalysis
                    new QMVideoSettingsCallback
                    VideoCodingModule::Codec
                        VCMCodecDataBase::Codec
                    VideoCodingModuleImpl::RegisterSendCodec
                        VideoSender::RegisterSendCodec
                            VCMCodecDataBase::SetSendCodec
                                CreateEncoder
                                    VP8Encoder::Create
                                        new VP8EncoderImpl
                                    new VCMGenericEncoder
                                VCMGenericEncoder::InitEncode
                                    VP8EncoderImpl::InitEncode
                                VCMGenericEncoder::RegisterEncodeCallback
                                    VP8EncoderImpl::RegisterEncodeCompleteCallback
                                VCMGenericEncoder::SetPeriodicKeyFrames
                ViEChannelManager::CreateChannelObject
                    new ViEChannel
                    ViEChannel::Init
VideoEngine_connectAudioChannel
    ViEBaseImpl::ConnectAudioChannel
        ViEChannelManager::ConnectVoiceChannel
            ViEChannel::SetVoiceChannel
                ProcessThreadImpl::RegisterModule(VoEVideoSync)
                ViESyncModule::ConfigureSync
                    new StreamSynchronization

时间: 2024-11-07 21:46:31

WebRTCDemo.apk代码走读(一):初始化的相关文章

WebRTCDemo.apk代码走读(三):音频接收流程

收到音频包 UdpSocketManagerPosixImpl::Run UdpSocketManagerPosixImpl::Process UdpSocketPosix::HasIncoming(recvfrom) UdpTransportImpl::IncomingRTPCallback UdpTransportImpl::IncomingRTPFunction VoiceChannelTransport::IncomingRTPPacket VoENetworkImpl::Receive

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

转载注明出处http://blog.csdn.net/wanghorse VoiceEngine_startListen VoEBaseImpl::StartReceive channelPtr->StartReceiving设置channel的receiving的状态 VoiceEngine_startPlayout VoEBaseImpl::StartPlayout VoEBaseImpl::StartPlayout--没有channelId,涉及到硬件,所以是唯一全局的 AudioDevi

WebRTCDemo.apk代码走读(八):代码目录结构

转载注明出处http://blog.csdn.net/wanghorse ├── ./base //基础平台库,包括线程.锁.socket等 ├── ./build //编译脚本,gyp ├── ./common_audio //基础公共的音频处理 │ ├── ./common_audio/include //就一个类型转换头文件 │ ├── ./common_audio/resampler //音频重采样代码 │ ├── ./common_audio/signal_processing //音

WebRTCDemo.apk代码走读(九):VoiceEngine和VideoEngine主要的控制类说明

转载注明出处http://blog.csdn.net/wanghorse 1. VideoEngineImpl VideoEngine对外提供的集成接口实现类, 其继承了VideoEngine对外提供的所有接口实现类,包括 ViEBaseImpl/ViECaptureImpl/ViEFileImpl/ViEImageProcessImpl/ViENetworkImpl/ViERTP_RTCPImpl/ViEExternalCodecImpl/VideoEngine 2. ViEBaseImpl

WebRTCDemo.apk代码走读(六):视频发送流程

转载注明出处http://blog.csdn.net/wanghorse JNI调用 ProvideCameraFrame VideoCaptureAndroid::OnIncomingFrame VideoCaptureImpl::IncomingFrame 申请内存,转换层I420 VideoCaptureImpl::DeliverCapturedFrame 计算时间戳 ViECapturer::OnIncomingCapturedFrame OveruseFrameDetector::Fr

WebRTCDemo.apk代码走读(四):音频发送流程

转载注明出处http://blog.csdn.net/wanghorse 发送音频 OpenSlesInput::RecorderSimpleBufferQueueCallback OpenSlesInput::RecorderSimpleBufferQueueCallbackHandler,保存数据 OpenSlesInput::CbThreadImpl AudioDeviceBuffer::SetRecordedBuffer, 复制数据 AudioDeviceBuffer::SetVQEDa

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

转载注明出处http://blog.csdn.net/wanghorse 收到视频包 UdpSocketManagerPosixImpl::Run UdpSocketManagerPosixImpl::Process UdpSocketPosix::HasIncoming(recvfrom) UdpTransportImpl::IncomingRTPCallback UdpTransportImpl::IncomingRTPFunction VideoChannelTransport::Inco

WebRTCDemo.apk代码走读(七):线程关系

转载注明出处http://blog.csdn.net/wanghorse webrtc实际的ProcessThreadImpl线程主要有: 1. VoiceChannelTransport下的CreateThread(UdpSocketManagerPosixImpl::Run), 用于收发网络包 2. AudioTrackJni::PlayThreadProcess,用于播放 3. OpenSlesInput下的SLAndroidSimpleBufferQueueItf的内部线程,主要是抓取音

Java面向对象--代码块(初始化块)和内部类

本篇博客介绍Java学习过程中类的成员之代码块(初始化块)和内部类的具体使用. 目录: ? 代码块(初始化块) ? 内部类(Inner class) ? 代码块(初始化块) 代码块的概述 ? 代码块(或初始化块)的作用:对Java类或对象进行初始化操作 ? 代码块(或初始化块)的分类:一个类中代码块只能被static修饰符修饰,若由static修饰称为静态代码块(static block),没有使用static修饰的,为非静态代码块 ? static 代码块化 通常用于初始化static cla