OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 16 matching lines...) Expand all Loading... |
27 #include "webrtc/base/logging.h" | 27 #include "webrtc/base/logging.h" |
28 #include "webrtc/base/optional.h" | 28 #include "webrtc/base/optional.h" |
29 #include "webrtc/base/ptr_util.h" | 29 #include "webrtc/base/ptr_util.h" |
30 #include "webrtc/base/task_queue.h" | 30 #include "webrtc/base/task_queue.h" |
31 #include "webrtc/base/thread_annotations.h" | 31 #include "webrtc/base/thread_annotations.h" |
32 #include "webrtc/base/thread_checker.h" | 32 #include "webrtc/base/thread_checker.h" |
33 #include "webrtc/base/trace_event.h" | 33 #include "webrtc/base/trace_event.h" |
34 #include "webrtc/call/bitrate_allocator.h" | 34 #include "webrtc/call/bitrate_allocator.h" |
35 #include "webrtc/call/call.h" | 35 #include "webrtc/call/call.h" |
36 #include "webrtc/call/flexfec_receive_stream_impl.h" | 36 #include "webrtc/call/flexfec_receive_stream_impl.h" |
37 #include "webrtc/call/rtp_demuxer.h" | 37 #include "webrtc/call/rtp_transport_controller_receive.h" |
38 #include "webrtc/call/rtp_transport_controller_send.h" | 38 #include "webrtc/call/rtp_transport_controller_send.h" |
39 #include "webrtc/config.h" | 39 #include "webrtc/config.h" |
40 #include "webrtc/logging/rtc_event_log/rtc_event_log.h" | 40 #include "webrtc/logging/rtc_event_log/rtc_event_log.h" |
41 #include "webrtc/modules/bitrate_controller/include/bitrate_controller.h" | 41 #include "webrtc/modules/bitrate_controller/include/bitrate_controller.h" |
42 #include "webrtc/modules/congestion_controller/include/receive_side_congestion_c
ontroller.h" | 42 #include "webrtc/modules/congestion_controller/include/receive_side_congestion_c
ontroller.h" |
43 #include "webrtc/modules/pacing/paced_sender.h" | 43 #include "webrtc/modules/pacing/paced_sender.h" |
44 #include "webrtc/modules/rtp_rtcp/include/flexfec_receiver.h" | 44 #include "webrtc/modules/rtp_rtcp/include/flexfec_receiver.h" |
45 #include "webrtc/modules/rtp_rtcp/include/rtp_header_parser.h" | 45 #include "webrtc/modules/rtp_rtcp/include/rtp_header_parser.h" |
46 #include "webrtc/modules/rtp_rtcp/source/byte_io.h" | 46 #include "webrtc/modules/rtp_rtcp/source/byte_io.h" |
47 #include "webrtc/modules/rtp_rtcp/source/rtp_header_extension.h" | 47 #include "webrtc/modules/rtp_rtcp/source/rtp_header_extension.h" |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 // Audio, Video, and FlexFEC receive streams are owned by the client that | 206 // Audio, Video, and FlexFEC receive streams are owned by the client that |
207 // creates them. | 207 // creates them. |
208 std::set<AudioReceiveStream*> audio_receive_streams_ | 208 std::set<AudioReceiveStream*> audio_receive_streams_ |
209 GUARDED_BY(receive_crit_); | 209 GUARDED_BY(receive_crit_); |
210 std::set<VideoReceiveStream*> video_receive_streams_ | 210 std::set<VideoReceiveStream*> video_receive_streams_ |
211 GUARDED_BY(receive_crit_); | 211 GUARDED_BY(receive_crit_); |
212 | 212 |
213 std::map<std::string, AudioReceiveStream*> sync_stream_mapping_ | 213 std::map<std::string, AudioReceiveStream*> sync_stream_mapping_ |
214 GUARDED_BY(receive_crit_); | 214 GUARDED_BY(receive_crit_); |
215 | 215 |
216 // TODO(nisse): Should eventually be part of injected | 216 // TODO(nisse): Should eventually be injected at creation, |
217 // RtpTransportControllerReceive, with a single demuxer in the bundled case. | 217 // with a single object in the bundled case. |
218 RtpDemuxer audio_rtp_demuxer_ GUARDED_BY(receive_crit_); | 218 RtpTransportControllerReceive audio_transport_receive_; |
219 RtpDemuxer video_rtp_demuxer_ GUARDED_BY(receive_crit_); | 219 RtpTransportControllerReceive video_transport_receive_; |
220 | 220 |
221 // This extra map is used for receive processing which is | 221 // This extra map is used for receive processing which is |
222 // independent of media type. | 222 // independent of media type. |
223 | 223 |
224 // TODO(nisse): In the RTP transport refactoring, we should have a | 224 // TODO(nisse): In the RTP transport refactoring, we should have a |
225 // single mapping from ssrc to a more abstract receive stream, with | 225 // single mapping from ssrc to a more abstract receive stream, with |
226 // accessor methods for all configuration we need at this level. | 226 // accessor methods for all configuration we need at this level. |
227 struct ReceiveRtpConfig { | 227 struct ReceiveRtpConfig { |
228 ReceiveRtpConfig() = default; // Needed by std::map | 228 ReceiveRtpConfig() = default; // Needed by std::map |
229 ReceiveRtpConfig(const std::vector<RtpExtension>& extensions, | 229 ReceiveRtpConfig(const std::vector<RtpExtension>& extensions, |
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
553 UpdateAggregateNetworkState(); | 553 UpdateAggregateNetworkState(); |
554 delete audio_send_stream; | 554 delete audio_send_stream; |
555 } | 555 } |
556 | 556 |
557 webrtc::AudioReceiveStream* Call::CreateAudioReceiveStream( | 557 webrtc::AudioReceiveStream* Call::CreateAudioReceiveStream( |
558 const webrtc::AudioReceiveStream::Config& config) { | 558 const webrtc::AudioReceiveStream::Config& config) { |
559 TRACE_EVENT0("webrtc", "Call::CreateAudioReceiveStream"); | 559 TRACE_EVENT0("webrtc", "Call::CreateAudioReceiveStream"); |
560 RTC_DCHECK(configuration_thread_checker_.CalledOnValidThread()); | 560 RTC_DCHECK(configuration_thread_checker_.CalledOnValidThread()); |
561 event_log_->LogAudioReceiveStreamConfig(config); | 561 event_log_->LogAudioReceiveStreamConfig(config); |
562 AudioReceiveStream* receive_stream = | 562 AudioReceiveStream* receive_stream = |
563 new AudioReceiveStream(transport_send_->packet_router(), config, | 563 new AudioReceiveStream( |
564 config_.audio_state, event_log_); | 564 &audio_transport_receive_, transport_send_->packet_router(), config, |
| 565 config_.audio_state, event_log_); |
565 { | 566 { |
566 WriteLockScoped write_lock(*receive_crit_); | 567 WriteLockScoped write_lock(*receive_crit_); |
567 audio_rtp_demuxer_.AddSink(config.rtp.remote_ssrc, receive_stream); | |
568 receive_rtp_config_[config.rtp.remote_ssrc] = | 568 receive_rtp_config_[config.rtp.remote_ssrc] = |
569 ReceiveRtpConfig(config.rtp.extensions, UseSendSideBwe(config)); | 569 ReceiveRtpConfig(config.rtp.extensions, UseSendSideBwe(config)); |
570 audio_receive_streams_.insert(receive_stream); | 570 audio_receive_streams_.insert(receive_stream); |
571 | 571 |
572 ConfigureSync(config.sync_group); | 572 ConfigureSync(config.sync_group); |
573 } | 573 } |
574 { | 574 { |
575 ReadLockScoped read_lock(*send_crit_); | 575 ReadLockScoped read_lock(*send_crit_); |
576 auto it = audio_send_ssrcs_.find(config.rtp.local_ssrc); | 576 auto it = audio_send_ssrcs_.find(config.rtp.local_ssrc); |
577 if (it != audio_send_ssrcs_.end()) { | 577 if (it != audio_send_ssrcs_.end()) { |
(...skipping 11 matching lines...) Expand all Loading... |
589 RTC_DCHECK(configuration_thread_checker_.CalledOnValidThread()); | 589 RTC_DCHECK(configuration_thread_checker_.CalledOnValidThread()); |
590 RTC_DCHECK(receive_stream != nullptr); | 590 RTC_DCHECK(receive_stream != nullptr); |
591 webrtc::internal::AudioReceiveStream* audio_receive_stream = | 591 webrtc::internal::AudioReceiveStream* audio_receive_stream = |
592 static_cast<webrtc::internal::AudioReceiveStream*>(receive_stream); | 592 static_cast<webrtc::internal::AudioReceiveStream*>(receive_stream); |
593 { | 593 { |
594 WriteLockScoped write_lock(*receive_crit_); | 594 WriteLockScoped write_lock(*receive_crit_); |
595 const AudioReceiveStream::Config& config = audio_receive_stream->config(); | 595 const AudioReceiveStream::Config& config = audio_receive_stream->config(); |
596 uint32_t ssrc = config.rtp.remote_ssrc; | 596 uint32_t ssrc = config.rtp.remote_ssrc; |
597 receive_side_cc_.GetRemoteBitrateEstimator(UseSendSideBwe(config)) | 597 receive_side_cc_.GetRemoteBitrateEstimator(UseSendSideBwe(config)) |
598 ->RemoveStream(ssrc); | 598 ->RemoveStream(ssrc); |
599 size_t num_deleted = audio_rtp_demuxer_.RemoveSink(audio_receive_stream); | |
600 RTC_DCHECK(num_deleted == 1); | |
601 audio_receive_streams_.erase(audio_receive_stream); | 599 audio_receive_streams_.erase(audio_receive_stream); |
602 const std::string& sync_group = audio_receive_stream->config().sync_group; | 600 const std::string& sync_group = audio_receive_stream->config().sync_group; |
603 const auto it = sync_stream_mapping_.find(sync_group); | 601 const auto it = sync_stream_mapping_.find(sync_group); |
604 if (it != sync_stream_mapping_.end() && | 602 if (it != sync_stream_mapping_.end() && |
605 it->second == audio_receive_stream) { | 603 it->second == audio_receive_stream) { |
606 sync_stream_mapping_.erase(it); | 604 sync_stream_mapping_.erase(it); |
607 ConfigureSync(sync_group); | 605 ConfigureSync(sync_group); |
608 } | 606 } |
609 receive_rtp_config_.erase(ssrc); | 607 receive_rtp_config_.erase(ssrc); |
610 } | 608 } |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
679 UpdateAggregateNetworkState(); | 677 UpdateAggregateNetworkState(); |
680 delete send_stream_impl; | 678 delete send_stream_impl; |
681 } | 679 } |
682 | 680 |
683 webrtc::VideoReceiveStream* Call::CreateVideoReceiveStream( | 681 webrtc::VideoReceiveStream* Call::CreateVideoReceiveStream( |
684 webrtc::VideoReceiveStream::Config configuration) { | 682 webrtc::VideoReceiveStream::Config configuration) { |
685 TRACE_EVENT0("webrtc", "Call::CreateVideoReceiveStream"); | 683 TRACE_EVENT0("webrtc", "Call::CreateVideoReceiveStream"); |
686 RTC_DCHECK(configuration_thread_checker_.CalledOnValidThread()); | 684 RTC_DCHECK(configuration_thread_checker_.CalledOnValidThread()); |
687 | 685 |
688 VideoReceiveStream* receive_stream = | 686 VideoReceiveStream* receive_stream = |
689 new VideoReceiveStream(num_cpu_cores_, transport_send_->packet_router(), | 687 new VideoReceiveStream( |
690 std::move(configuration), | 688 &video_transport_receive_, num_cpu_cores_, |
691 module_process_thread_.get(), call_stats_.get()); | 689 transport_send_->packet_router(), std::move(configuration), |
| 690 module_process_thread_.get(), call_stats_.get()); |
692 | 691 |
693 const webrtc::VideoReceiveStream::Config& config = receive_stream->config(); | 692 const webrtc::VideoReceiveStream::Config& config = receive_stream->config(); |
694 ReceiveRtpConfig receive_config(config.rtp.extensions, | 693 ReceiveRtpConfig receive_config(config.rtp.extensions, |
695 UseSendSideBwe(config)); | 694 UseSendSideBwe(config)); |
696 { | 695 { |
697 WriteLockScoped write_lock(*receive_crit_); | 696 WriteLockScoped write_lock(*receive_crit_); |
698 video_rtp_demuxer_.AddSink(config.rtp.remote_ssrc, receive_stream); | |
699 if (config.rtp.rtx_ssrc) { | 697 if (config.rtp.rtx_ssrc) { |
700 video_rtp_demuxer_.AddSink(config.rtp.rtx_ssrc, receive_stream); | |
701 // We record identical config for the rtx stream as for the main | 698 // We record identical config for the rtx stream as for the main |
702 // stream. Since the transport_send_cc negotiation is per payload | 699 // stream. Since the transport_send_cc negotiation is per payload |
703 // type, we may get an incorrect value for the rtx stream, but | 700 // type, we may get an incorrect value for the rtx stream, but |
704 // that is unlikely to matter in practice. | 701 // that is unlikely to matter in practice. |
705 receive_rtp_config_[config.rtp.rtx_ssrc] = receive_config; | 702 receive_rtp_config_[config.rtp.rtx_ssrc] = receive_config; |
706 } | 703 } |
707 receive_rtp_config_[config.rtp.remote_ssrc] = receive_config; | 704 receive_rtp_config_[config.rtp.remote_ssrc] = receive_config; |
708 video_receive_streams_.insert(receive_stream); | 705 video_receive_streams_.insert(receive_stream); |
709 ConfigureSync(config.sync_group); | 706 ConfigureSync(config.sync_group); |
710 } | 707 } |
711 receive_stream->SignalNetworkState(video_network_state_); | 708 receive_stream->SignalNetworkState(video_network_state_); |
712 UpdateAggregateNetworkState(); | 709 UpdateAggregateNetworkState(); |
713 event_log_->LogVideoReceiveStreamConfig(config); | 710 event_log_->LogVideoReceiveStreamConfig(config); |
714 return receive_stream; | 711 return receive_stream; |
715 } | 712 } |
716 | 713 |
717 void Call::DestroyVideoReceiveStream( | 714 void Call::DestroyVideoReceiveStream( |
718 webrtc::VideoReceiveStream* receive_stream) { | 715 webrtc::VideoReceiveStream* receive_stream) { |
719 TRACE_EVENT0("webrtc", "Call::DestroyVideoReceiveStream"); | 716 TRACE_EVENT0("webrtc", "Call::DestroyVideoReceiveStream"); |
720 RTC_DCHECK(configuration_thread_checker_.CalledOnValidThread()); | 717 RTC_DCHECK(configuration_thread_checker_.CalledOnValidThread()); |
721 RTC_DCHECK(receive_stream != nullptr); | 718 RTC_DCHECK(receive_stream != nullptr); |
722 VideoReceiveStream* receive_stream_impl = | 719 VideoReceiveStream* receive_stream_impl = |
723 static_cast<VideoReceiveStream*>(receive_stream); | 720 static_cast<VideoReceiveStream*>(receive_stream); |
724 const VideoReceiveStream::Config& config = receive_stream_impl->config(); | 721 const VideoReceiveStream::Config& config = receive_stream_impl->config(); |
725 { | 722 { |
726 WriteLockScoped write_lock(*receive_crit_); | 723 WriteLockScoped write_lock(*receive_crit_); |
727 // Remove all ssrcs pointing to a receive stream. As RTX retransmits on a | 724 // Remove all ssrcs pointing to a receive stream. As RTX retransmits on a |
728 // separate SSRC there can be either one or two. | 725 // separate SSRC there can be either one or two. |
729 size_t num_deleted = video_rtp_demuxer_.RemoveSink(receive_stream_impl); | |
730 RTC_DCHECK_GE(num_deleted, 1); | |
731 receive_rtp_config_.erase(config.rtp.remote_ssrc); | 726 receive_rtp_config_.erase(config.rtp.remote_ssrc); |
732 if (config.rtp.rtx_ssrc) { | 727 if (config.rtp.rtx_ssrc) { |
733 receive_rtp_config_.erase(config.rtp.rtx_ssrc); | 728 receive_rtp_config_.erase(config.rtp.rtx_ssrc); |
734 } | 729 } |
735 video_receive_streams_.erase(receive_stream_impl); | 730 video_receive_streams_.erase(receive_stream_impl); |
736 ConfigureSync(config.sync_group); | 731 ConfigureSync(config.sync_group); |
737 } | 732 } |
738 | 733 |
739 receive_side_cc_.GetRemoteBitrateEstimator(UseSendSideBwe(config)) | 734 receive_side_cc_.GetRemoteBitrateEstimator(UseSendSideBwe(config)) |
740 ->RemoveStream(config.rtp.remote_ssrc); | 735 ->RemoveStream(config.rtp.remote_ssrc); |
741 | 736 |
742 UpdateAggregateNetworkState(); | 737 UpdateAggregateNetworkState(); |
743 delete receive_stream_impl; | 738 delete receive_stream_impl; |
744 } | 739 } |
745 | 740 |
746 FlexfecReceiveStream* Call::CreateFlexfecReceiveStream( | 741 FlexfecReceiveStream* Call::CreateFlexfecReceiveStream( |
747 const FlexfecReceiveStream::Config& config) { | 742 const FlexfecReceiveStream::Config& config) { |
748 TRACE_EVENT0("webrtc", "Call::CreateFlexfecReceiveStream"); | 743 TRACE_EVENT0("webrtc", "Call::CreateFlexfecReceiveStream"); |
749 RTC_DCHECK(configuration_thread_checker_.CalledOnValidThread()); | 744 RTC_DCHECK(configuration_thread_checker_.CalledOnValidThread()); |
750 | 745 |
751 RecoveredPacketReceiver* recovered_packet_receiver = this; | 746 RecoveredPacketReceiver* recovered_packet_receiver = this; |
| 747 |
752 FlexfecReceiveStreamImpl* receive_stream = new FlexfecReceiveStreamImpl( | 748 FlexfecReceiveStreamImpl* receive_stream = new FlexfecReceiveStreamImpl( |
753 config, recovered_packet_receiver, call_stats_->rtcp_rtt_stats(), | 749 &video_transport_receive_, config, recovered_packet_receiver, |
754 module_process_thread_.get()); | 750 call_stats_->rtcp_rtt_stats(), module_process_thread_.get()); |
755 | |
756 { | 751 { |
757 WriteLockScoped write_lock(*receive_crit_); | 752 WriteLockScoped write_lock(*receive_crit_); |
758 video_rtp_demuxer_.AddSink(config.remote_ssrc, receive_stream); | |
759 | |
760 for (auto ssrc : config.protected_media_ssrcs) | |
761 video_rtp_demuxer_.AddSink(ssrc, receive_stream); | |
762 | |
763 RTC_DCHECK(receive_rtp_config_.find(config.remote_ssrc) == | 753 RTC_DCHECK(receive_rtp_config_.find(config.remote_ssrc) == |
764 receive_rtp_config_.end()); | 754 receive_rtp_config_.end()); |
765 receive_rtp_config_[config.remote_ssrc] = | 755 receive_rtp_config_[config.remote_ssrc] = |
766 ReceiveRtpConfig(config.rtp_header_extensions, UseSendSideBwe(config)); | 756 ReceiveRtpConfig(config.rtp_header_extensions, UseSendSideBwe(config)); |
767 } | 757 } |
768 | 758 |
769 // TODO(brandtr): Store config in RtcEventLog here. | 759 // TODO(brandtr): Store config in RtcEventLog here. |
770 | 760 |
771 return receive_stream; | 761 return receive_stream; |
772 } | 762 } |
(...skipping 10 matching lines...) Expand all Loading... |
783 { | 773 { |
784 WriteLockScoped write_lock(*receive_crit_); | 774 WriteLockScoped write_lock(*receive_crit_); |
785 | 775 |
786 const FlexfecReceiveStream::Config& config = | 776 const FlexfecReceiveStream::Config& config = |
787 receive_stream_impl->GetConfig(); | 777 receive_stream_impl->GetConfig(); |
788 uint32_t ssrc = config.remote_ssrc; | 778 uint32_t ssrc = config.remote_ssrc; |
789 receive_rtp_config_.erase(ssrc); | 779 receive_rtp_config_.erase(ssrc); |
790 | 780 |
791 // Remove all SSRCs pointing to the FlexfecReceiveStreamImpl to be | 781 // Remove all SSRCs pointing to the FlexfecReceiveStreamImpl to be |
792 // destroyed. | 782 // destroyed. |
793 video_rtp_demuxer_.RemoveSink(receive_stream_impl); | |
794 receive_side_cc_.GetRemoteBitrateEstimator(UseSendSideBwe(config)) | 783 receive_side_cc_.GetRemoteBitrateEstimator(UseSendSideBwe(config)) |
795 ->RemoveStream(ssrc); | 784 ->RemoveStream(ssrc); |
796 } | 785 } |
797 | 786 |
798 delete receive_stream_impl; | 787 delete receive_stream_impl; |
799 } | 788 } |
800 | 789 |
801 Call::Stats Call::GetStats() const { | 790 Call::Stats Call::GetStats() const { |
802 // TODO(solenberg): Some test cases in EndToEndTest use this from a different | 791 // TODO(solenberg): Some test cases in EndToEndTest use this from a different |
803 // thread. Re-enable once that is fixed. | 792 // thread. Re-enable once that is fixed. |
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1155 // on parsed_packet to the receive streams. | 1144 // on parsed_packet to the receive streams. |
1156 rtc::Optional<RtpPacketReceived> parsed_packet = | 1145 rtc::Optional<RtpPacketReceived> parsed_packet = |
1157 ParseRtpPacket(packet, length, &packet_time); | 1146 ParseRtpPacket(packet, length, &packet_time); |
1158 | 1147 |
1159 if (!parsed_packet) | 1148 if (!parsed_packet) |
1160 return DELIVERY_PACKET_ERROR; | 1149 return DELIVERY_PACKET_ERROR; |
1161 | 1150 |
1162 NotifyBweOfReceivedPacket(*parsed_packet, media_type); | 1151 NotifyBweOfReceivedPacket(*parsed_packet, media_type); |
1163 | 1152 |
1164 if (media_type == MediaType::AUDIO) { | 1153 if (media_type == MediaType::AUDIO) { |
1165 if (audio_rtp_demuxer_.OnRtpPacket(*parsed_packet)) { | 1154 if (audio_transport_receive_.OnRtpPacket(*parsed_packet)) { |
1166 received_bytes_per_second_counter_.Add(static_cast<int>(length)); | 1155 received_bytes_per_second_counter_.Add(static_cast<int>(length)); |
1167 received_audio_bytes_per_second_counter_.Add(static_cast<int>(length)); | 1156 received_audio_bytes_per_second_counter_.Add(static_cast<int>(length)); |
1168 event_log_->LogRtpHeader(kIncomingPacket, media_type, packet, length); | 1157 event_log_->LogRtpHeader(kIncomingPacket, media_type, packet, length); |
1169 return DELIVERY_OK; | 1158 return DELIVERY_OK; |
1170 } | 1159 } |
1171 } else if (media_type == MediaType::VIDEO) { | 1160 } else if (media_type == MediaType::VIDEO) { |
1172 if (video_rtp_demuxer_.OnRtpPacket(*parsed_packet)) { | 1161 if (video_transport_receive_.OnRtpPacket(*parsed_packet)) { |
1173 received_bytes_per_second_counter_.Add(static_cast<int>(length)); | 1162 received_bytes_per_second_counter_.Add(static_cast<int>(length)); |
1174 received_video_bytes_per_second_counter_.Add(static_cast<int>(length)); | 1163 received_video_bytes_per_second_counter_.Add(static_cast<int>(length)); |
1175 event_log_->LogRtpHeader(kIncomingPacket, media_type, packet, length); | 1164 event_log_->LogRtpHeader(kIncomingPacket, media_type, packet, length); |
1176 return DELIVERY_OK; | 1165 return DELIVERY_OK; |
1177 } | 1166 } |
1178 } | 1167 } |
1179 return DELIVERY_UNKNOWN_SSRC; | 1168 return DELIVERY_UNKNOWN_SSRC; |
1180 } | 1169 } |
1181 | 1170 |
1182 PacketReceiver::DeliveryStatus Call::DeliverPacket( | 1171 PacketReceiver::DeliveryStatus Call::DeliverPacket( |
(...skipping 15 matching lines...) Expand all Loading... |
1198 // audio packets with FlexFEC. | 1187 // audio packets with FlexFEC. |
1199 void Call::OnRecoveredPacket(const uint8_t* packet, size_t length) { | 1188 void Call::OnRecoveredPacket(const uint8_t* packet, size_t length) { |
1200 ReadLockScoped read_lock(*receive_crit_); | 1189 ReadLockScoped read_lock(*receive_crit_); |
1201 rtc::Optional<RtpPacketReceived> parsed_packet = | 1190 rtc::Optional<RtpPacketReceived> parsed_packet = |
1202 ParseRtpPacket(packet, length, nullptr); | 1191 ParseRtpPacket(packet, length, nullptr); |
1203 if (!parsed_packet) | 1192 if (!parsed_packet) |
1204 return; | 1193 return; |
1205 | 1194 |
1206 parsed_packet->set_recovered(true); | 1195 parsed_packet->set_recovered(true); |
1207 | 1196 |
1208 video_rtp_demuxer_.OnRtpPacket(*parsed_packet); | 1197 video_transport_receive_.OnRtpPacket(*parsed_packet); |
1209 } | 1198 } |
1210 | 1199 |
1211 void Call::NotifyBweOfReceivedPacket(const RtpPacketReceived& packet, | 1200 void Call::NotifyBweOfReceivedPacket(const RtpPacketReceived& packet, |
1212 MediaType media_type) { | 1201 MediaType media_type) { |
1213 auto it = receive_rtp_config_.find(packet.Ssrc()); | 1202 auto it = receive_rtp_config_.find(packet.Ssrc()); |
1214 bool use_send_side_bwe = | 1203 bool use_send_side_bwe = |
1215 (it != receive_rtp_config_.end()) && it->second.use_send_side_bwe; | 1204 (it != receive_rtp_config_.end()) && it->second.use_send_side_bwe; |
1216 | 1205 |
1217 RTPHeader header; | 1206 RTPHeader header; |
1218 packet.GetHeader(&header); | 1207 packet.GetHeader(&header); |
(...skipping 13 matching lines...) Expand all Loading... |
1232 (use_send_side_bwe && header.extension.hasTransportSequenceNumber)) { | 1221 (use_send_side_bwe && header.extension.hasTransportSequenceNumber)) { |
1233 receive_side_cc_.OnReceivedPacket( | 1222 receive_side_cc_.OnReceivedPacket( |
1234 packet.arrival_time_ms(), packet.payload_size() + packet.padding_size(), | 1223 packet.arrival_time_ms(), packet.payload_size() + packet.padding_size(), |
1235 header); | 1224 header); |
1236 } | 1225 } |
1237 } | 1226 } |
1238 | 1227 |
1239 } // namespace internal | 1228 } // namespace internal |
1240 | 1229 |
1241 } // namespace webrtc | 1230 } // namespace webrtc |
OLD | NEW |