WebRTC音频接收处理全过程(一)

目录

  1.1 接收音频数据包

  1.2 插入音频数据包到待解码数据包队列

  1.3 解码音频数据包

1.1 接收音频数据包

cricket::BaseChannel::OnPacketReceived(bool rtcp, const rtc::CopyOnWriteBuffer & packet, __int64 packet_time_us) 行506

cricket::BaseChannel::OnRtpPacket(const webrtc::RtpPacketReceived & parsed_packet) 行472

webrtc::RtpDemuxer::OnRtpPacket(const webrtc::RtpPacketReceived & packet) 行158

webrtc::RtpTransport::DemuxPacket(rtc::CopyOnWriteBuffer * packet, __int64 packet_time_us) 行202

webrtc::SrtpTransport::OnRtpPacketReceived(rtc::CopyOnWriteBuffer * packet, __int64 packet_time_us) 行225

webrtc::RtpTransport::OnReadPacket(rtc::PacketTransportInternal * transport, const char * data, unsigned int len, const __int64 & packet_time_us, int flags) 行279

cricket::DtlsTransport::OnReadPacket(rtc::PacketTransportInternal * transport, const char * data, unsigned int size, const __int64 & packet_time_us, int flags) 行596

cricket::P2PTransportChannel::OnReadPacket(cricket::Connection * connection, const char * data, unsigned int len, __int64 packet_time_us) 行2379

cricket::Connection::OnReadPacket(const char * data, unsigned int size, __int64 packet_time_us) 行1257

cricket::UDPPort::OnReadPacket(rtc::AsyncPacketSocket * socket, const char * data, unsigned int size, const rtc::SocketAddress & remote_addr, const __int64 & packet_time_us) 行383

cricket::UDPPort::HandleIncomingPacket(rtc::AsyncPacketSocket * socket, const char * data, unsigned int size, const rtc::SocketAddress & remote_addr, __int64 packet_time_us) 行325

cricket::AllocationSequence::OnReadPacket(rtc::AsyncPacketSocket * socket, const char * data, unsigned int size, const rtc::SocketAddress & remote_addr, const __int64 & packet_time_us) 行1610

rtc::AsyncUDPSocket::OnReadEvent(rtc::AsyncSocket * socket) 行125    采用socket实现

rtc::SocketDispatcher::OnEvent(unsigned int ff, int err) 行753

rtc::PhysicalSocketServer::Wait(int cmsWait, bool process_io) 行1845

rtc::MessageQueue::Get(rtc::Message * pmsg, int cmsWait, bool process_io) 行330

rtc::Thread::ProcessMessages(int cmsLoop) 行535

rtc::Thread::Run() 行362

1.2 插入音频数据包到待解码数据包队列

webrtc::PacketBuffer::InsertPacketList(std::list > * packet_list, const webrtc::DecoderDatabase & decoder_database, absl::optional * current_rtp_payload_type, absl::optional * current_cng_rtp_payload_type, webrtc::StatisticsCalculator * stats) 行139

webrtc::NetEqImpl::InsertPacketInternal(const webrtc::RTPHeader & rtp_header, rtc::ArrayView payload, unsigned int receive_timestamp) 行712 将数据加到packet_buffer_数据包队列中,待解码

webrtc::NetEqImpl::InsertPacket(const webrtc::RTPHeader & rtp_header, rtc::ArrayView payload, unsigned int receive_timestamp) 行148

webrtc::acm2::AcmReceiver::InsertPacket(const webrtc::WebRtcRTPHeader & rtp_header, rtc::ArrayView incoming_payload) 行110

webrtc::`anonymous namespace'::AudioCodingModuleImpl::IncomingPacket(const unsigned char * incoming_payload, const unsigned int payload_length, const webrtc::WebRtcRTPHeader & rtp_header) 行811

webrtc::voe::`anonymous namespace'::ChannelReceive::OnReceivedPayloadData(const unsigned char * payloadData, unsigned int payloadSize, const webrtc::WebRtcRTPHeader * rtpHeader) 行289

webrtc::voe::`anonymous namespace'::ChannelReceive::ReceivePacket(const unsigned char * packet, unsigned int packet_length, const webrtc::RTPHeader & header) 行675

webrtc::voe::`anonymous namespace'::ChannelReceive::OnRtpPacket(const webrtc::RtpPacketReceived & packet) 行624

webrtc::RtpDemuxer::OnRtpPacket(const webrtc::RtpPacketReceived & packet) 行158

webrtc::RtpStreamReceiverController::OnRtpPacket(const webrtc::RtpPacketReceived & packet) 行54

webrtc::internal::Call::DeliverRtp(webrtc::MediaType media_type, rtc::CopyOnWriteBuffer packet, __int64 packet_time_us) 行1318

webrtc::internal::Call::DeliverPacket(webrtc::MediaType media_type, rtc::CopyOnWriteBuffer packet, __int64 packet_time_us) 行1356

cricket::WebRtcVoiceMediaChannel::OnPacketReceived(rtc::CopyOnWriteBuffer * packet, __int64 packet_time_us) 行2057

cricket::BaseChannel::ProcessPacket(bool rtcp, const rtc::CopyOnWriteBuffer & packet, __int64 packet_time_us) 行547

rtc::FireAndForgetAsyncClosure >::Execute() 行53

rtc::MessageQueue::Dispatch(rtc::Message * pmsg) 行515

rtc::Thread::ProcessMessages(int cmsLoop) 行539

rtc::Thread::Run() 行362

 1.3 解码音频数据包

opus_decode(OpusDecoder * st, const unsigned char * data, int len, short * pcm, int frame_size, int decode_fec) 行766

DecodeNative(WebRtcOpusDecInst * inst, const unsigned char * encoded, unsigned int encoded_bytes, int frame_size, short * decoded, short * audio_type, int decode_fec) 行341

WebRtcOpus_Decode(WebRtcOpusDecInst * inst, const unsigned char * encoded, unsigned int encoded_bytes, short * decoded, short * audio_type) 行361

webrtc::AudioDecoderOpusImpl::DecodeInternal(const unsigned char * encoded, unsigned int encoded_len, int sample_rate_hz, short * decoded, webrtc::AudioDecoder::SpeechType * speech_type) 行126

webrtc::AudioDecoder::Decode(const unsigned char * encoded, unsigned int encoded_len, int sample_rate_hz, unsigned int max_decoded_bytes, short * decoded, webrtc::AudioDecoder::SpeechType * speech_type) 行98

webrtc::`anonymous namespace'::OpusFrame::Decode(rtc::ArrayView decoded) 行54

webrtc::NetEqImpl::DecodeLoop(std::list > * packet_list, const webrtc::Operations & operation, webrtc::AudioDecoder * decoder, int * decoded_length, webrtc::AudioDecoder::SpeechType * speech_type) 行1445

webrtc::NetEqImpl::Decode(std::list > * packet_list, webrtc::Operations * operation, int * decoded_length, webrtc::AudioDecoder::SpeechType * speech_type) 行1356

webrtc::NetEqImpl::GetAudioInternal(webrtc::AudioFrame * audio_frame, bool * muted, absl::optional action_override) 行846从GetDecision拿到数据包进行解码

webrtc::NetEqImpl::GetAudio(webrtc::AudioFrame * audio_frame, bool * muted, absl::optional action_override) 行211

webrtc::acm2::AcmReceiver::GetAudio(int desired_freq_hz, webrtc::AudioFrame * audio_frame, bool * muted) 行127

webrtc::`anonymous namespace'::AudioCodingModuleImpl::PlayoutData10Ms(int desired_freq_hz, webrtc::AudioFrame * audio_frame, bool * muted) 行840

webrtc::voe::`anonymous namespace'::ChannelReceive::GetAudioFrameWithInfo(int sample_rate_hz, webrtc::AudioFrame * audio_frame) 行341

webrtc::AudioMixerImpl::GetAudioFromSources() 行190

webrtc::AudioMixerImpl::Mix(unsigned int number_of_channels, webrtc::AudioFrame * audio_frame_for_mixing) 行129

webrtc::AudioTransportImpl::NeedMorePlayData(const unsigned int nSamples, const unsigned int nBytesPerSample, const unsigned int nChannels, const unsigned int samplesPerSec, void * audioSamples, unsigned int & nSamplesOut, __int64 * elapsed_time_ms, __int64 * ntp_time_ms) 行214

webrtc::AudioDeviceBuffer::RequestPlayoutData(unsigned int samples_per_channel) 行304

webrtc::AudioDeviceWindowsCore::DoRenderThread() 行2976

webrtc::AudioDeviceWindowsCore::WSAPIRenderThread(void * context) 行2778 渲染音频数据线程,取音频数据包进行解码播放

你可能感兴趣的:(WebRTC音频接收处理全过程(一))