WebRTC⾳频接收处理全过程(⼀)
⽬录
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
1.2 插⼊⾳频数据包到待解码数据包队列
webrtc::PacketBuffer::InsertPacketList(std::list<webrtc::Packet,std::allocator<webrtc::Packet> > * packet_list, const webrtc::DecoderDatabase & decoder_database, absl::optional<unsigned char> * current_rtp_payload_type,
absl::optional<unsigned char> * current_cng_rtp_payload_type, webrtc::StatisticsCalculator * stats) ⾏139
webrtc::NetEqImpl::InsertPacketInternal(const webrtc::RTPHeader & rtp_header, rtc::ArrayView<unsigned char const ,-4711> payload, unsigned int receive_timestamp) ⾏712    将数据加到packet_buffer_数据包队列中,待解码
webrtc::NetEqImpl::InsertPacket(const webrtc::RTPHeader & rtp_header, rtc::ArrayView<unsigned char const ,-4711> payload, unsigned int receive_timestamp) ⾏148
webrtc::acm2::AcmReceiver::InsertPacket(const webrtc::WebRtcRTPHeader & rtp_header, rtc::ArrayView<unsigned char const ,-4711> 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<rtc::MethodFunctor<cricket::BaseChannel,void (__thiscall cricket::BaseChannel::*) (bool,rtc::CopyOnWriteBuffer const &,__int64),void,bool,rtc::CopyOnWriteBuffer const &,__int64> >::Execute() ⾏53
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<short,-4711> decoded) ⾏54webrtc浏览器
webrtc::NetEqImpl::DecodeLoop(std::list<webrtc::Packet,std::allocator<webrtc::Packet> > * packet_list,
const
webrtc::Operations & operation, webrtc::AudioDecoder * decoder, int * decoded_length, webrtc::AudioDecoder::SpeechType * speech_type) ⾏1445
webrtc::NetEqImpl::Decode(std::list<webrtc::Packet,std::allocator<webrtc::Packet> > * 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<enum
webrtc::Operations> action_override) ⾏846    从GetDecision拿到数据包进⾏解码
webrtc::NetEqImpl::GetAudio(webrtc::AudioFrame * audio_frame, bool * muted, absl::optional<enum webrtc::Operations> 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    渲染⾳频数据线程,取⾳频数据包进⾏解码播放

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。