- MediaEngine.java:MediaEngine initialization
Reprint Annotated Source Http://blog.csdn.net/wanghorse
NewVoiceengine/voiceengine_createNewVoiceenginedata WEBRTC:: Voiceengine:: CreateGetvoiceengineNewVoiceengineimpl Initializing Shareddata ProcessThread:: CreateprocessthreadOutputmixer:: Create NewOutputmixer Audioconferencemixer:: Create NewAudioconferencemixerimpl Audioconferencemixerimpl:: InitTransmitmixer:: Create NewTransmitmixer initialization of Voeaudioprocessingimpl initialization Voecodecimpl Voedtm Fimpl initialization of Voeneteqstatsimpl initialization Voenetworkimpl Voertp_rtcpimpl Initialize Voevideosyncimpl initialize Voevolumecontrolimpl initialization Voebaseimplvoiceeng Ine_init Voebaseimpl:: InitWebrtcspl_init Processthreadimpl:: StartAudiodevicemoduleimpl:: CreateAudiodevicemoduleimpl:: Createplatformspecificobjects NewAudiodevicetemplateNewAudiodeviceutilityandroid Shareddata:: Set_audio_deviceProcessthreadimpl:: Registermodule(Audiodevicemoduleimpl) Audiodevicemoduleimpl:: RegistereventobserverAudiodevicemoduleimpl:: RegisteraudiocallbackAudiodevicemoduleimpl:: InitAudiodevicemoduleimpl:: SetplayoutdeviceAudiodevicemoduleimpl:: InitspeakerAudiodevicemoduleimpl:: SetrecordingdeviceAudiodevicemoduleimpl:: InitmicrophoneAudiodevicemoduleimpl:: StereoplayoutisavailableAudiodevicemoduleimpl:: SetstereoplayoutAudiodevicemoduleimpl:: setstereorecordingAudioprocessing:: Create NewAudioprocessingimplNewAudioproc:: Event NewEchocancellationimplNewEchocontrolmobileimplNewGaincontrolimplNewHighpassfilterimplNewLevelestimatorimplNewNoisesuppressionimplNewVoicedetectionimplNewGaincontrolfornewagcvoiceengine_createchannel Voebaseimpl:: CreateChannelChannelManager:: CreateChannelChannelManager:: CreatechannelinternalChannel:: CreateChannel NewChannel Voebaseimpl:: InitializechannelChannel:: Setengineinformation NewVideoengine Video_engine_jni.Cc:videoengine_createNewVideoenginedata Vie (vie_imple.Cc:webrtc:: Videoengine:: Create())NewVideoengineimpl Initialize ViebaseimplNewVieshareddata Initialize Number_cores_ (CpuInfo::D etectnumberofcores() Channel_manager_ (NewViechannelmanager (0, Number_cores_, config)), Input_manager_ (NewVieinputmanager (0, config)), Render_manager_ (NewVierendermanager (0)), Module_process_thread_ (ProcessThread:: Createprocessthread()),NewProcessthreadimpl Channel_manager_/input_manager_ using Module_process_thread_ Module_process_thread_ Start Videoengine_init Viebaseimpl:: InitVideoengine_setvoiceengine Viebaseimpl:: SetvoiceengineViechannelmanager:: SetvoiceengineViechannel:: SetvoicechannelViesyncmodule:: Configuresync NewStreamsynchronizationNewViesyncdelayvideoengine_createchannel Videoenginedata:: CreateChannelViebaseimpl:: CreateChannelViechannelmanager:: CreateChannel NewChannelgroupNewVieremb Bitratecontroller:: CreatebitratecontrollerBitratecontrollerimpl:: Bitratecontrollerimpl NewCallstatsNewEncoderstatefeedbackNewWrappingbitrateestimator registering the primary module with the ProcessThreadNewVieencoder Vcm_ (*WebRTC:: Videocodingmodule:: Create())NewVideocodingmoduleimpl Sender_ (NewVcm:: Videosender(Clock,&Post_encode_callback_)),NewDebugrecorder (Media Write file) Receiver_ (NewVcm:: Videoreceiver(clock, event_factory)) Vpm_ (*WebRTC:: Videoprocessingmodule:: Create(channel_id))),NewVideoprocessingmoduleimpl rtprtcp:: Creatertprtcp NewModulertprtcpimpl Rtpsender InitializationNewRtpsendervideo Rtcpsender Initialization Rtcpreceiver Initialization Rtcpreceiver:: Registerrtcpobservers NewViebitrateobserverNewViepacedsendercallback Bitratecontrollerimpl:: CreatertcpbandwidthobserverVieencoder:: InitVideocodingmoduleimpl:: InitializesenderVideosender:: InitializesenderVcmcodecdatabase:: ResetsenderVideoprocessingmoduleimpl:: EnabletemporaldecimationVpmframepreprocessor:: EnabletemporaldecimationVpmvideodecimator:: EnabletemporaldecimationVideoprocessingmoduleimpl:: EnablecontentanalysisVpmframepreprocessor:: Enablecontentanalysis NewQmvideosettingscallback Videocodingmodule:: CodecVcmcodecdatabase:: CodecVideocodingmoduleimpl:: RegistersendcodecVideosender:: RegistersendcodecVcmcodecdatabase:: SetsendcodecCreateencoder Vp8encoder:: Create NewVp8encoderimplNewVcmgenericencoder Vcmgenericencoder:: InitencodeVp8encoderimpl:: InitencodeVcmgenericencoder:: RegisterencodecallbackVp8encoderimpl:: RegisterencodecompletecallbackVcmgenericencoder:: SetperiodickeyframesViechannelmanager:: Createchannelobject NewViechannel Viechannel:: InitVideoengine_connectaudiochannel Viebaseimpl:: ConnectaudiochannelViechannelmanager:: ConnectvoicechannelViechannel:: SetvoicechannelProcessthreadimpl:: Registermodule(Voevideosync) Viesyncmodule:: Configuresync NewStreamsynchronization
WEBRTCDEMO.APK Code Day (i): initialization