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_stream_receiver_controller.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 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
270 // Audio, Video, and FlexFEC receive streams are owned by the client that | 270 // Audio, Video, and FlexFEC receive streams are owned by the client that |
271 // creates them. | 271 // creates them. |
272 std::set<AudioReceiveStream*> audio_receive_streams_ | 272 std::set<AudioReceiveStream*> audio_receive_streams_ |
273 GUARDED_BY(receive_crit_); | 273 GUARDED_BY(receive_crit_); |
274 std::set<VideoReceiveStream*> video_receive_streams_ | 274 std::set<VideoReceiveStream*> video_receive_streams_ |
275 GUARDED_BY(receive_crit_); | 275 GUARDED_BY(receive_crit_); |
276 | 276 |
277 std::map<std::string, AudioReceiveStream*> sync_stream_mapping_ | 277 std::map<std::string, AudioReceiveStream*> sync_stream_mapping_ |
278 GUARDED_BY(receive_crit_); | 278 GUARDED_BY(receive_crit_); |
279 | 279 |
280 // TODO(nisse): Should eventually be part of injected | 280 // TODO(nisse): Should eventually be injected at creation, |
281 // RtpTransportControllerReceive, with a single demuxer in the bundled case. | 281 // with a single object in the bundled case. |
282 RtpDemuxer audio_rtp_demuxer_ GUARDED_BY(receive_crit_); | 282 RtpStreamReceiverController audio_receiver_controller; |
283 RtpDemuxer video_rtp_demuxer_ GUARDED_BY(receive_crit_); | 283 RtpStreamReceiverController video_receiver_controller; |
284 | 284 |
285 // This extra map is used for receive processing which is | 285 // This extra map is used for receive processing which is |
286 // independent of media type. | 286 // independent of media type. |
287 | 287 |
288 // TODO(nisse): In the RTP transport refactoring, we should have a | 288 // TODO(nisse): In the RTP transport refactoring, we should have a |
289 // single mapping from ssrc to a more abstract receive stream, with | 289 // single mapping from ssrc to a more abstract receive stream, with |
290 // accessor methods for all configuration we need at this level. | 290 // accessor methods for all configuration we need at this level. |
291 struct ReceiveRtpConfig { | 291 struct ReceiveRtpConfig { |
292 ReceiveRtpConfig() = default; // Needed by std::map | 292 ReceiveRtpConfig() = default; // Needed by std::map |
293 ReceiveRtpConfig(const std::vector<RtpExtension>& extensions, | 293 ReceiveRtpConfig(const std::vector<RtpExtension>& extensions, |
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
641 } | 641 } |
642 UpdateAggregateNetworkState(); | 642 UpdateAggregateNetworkState(); |
643 delete audio_send_stream; | 643 delete audio_send_stream; |
644 } | 644 } |
645 | 645 |
646 webrtc::AudioReceiveStream* Call::CreateAudioReceiveStream( | 646 webrtc::AudioReceiveStream* Call::CreateAudioReceiveStream( |
647 const webrtc::AudioReceiveStream::Config& config) { | 647 const webrtc::AudioReceiveStream::Config& config) { |
648 TRACE_EVENT0("webrtc", "Call::CreateAudioReceiveStream"); | 648 TRACE_EVENT0("webrtc", "Call::CreateAudioReceiveStream"); |
649 RTC_DCHECK_RUN_ON(&configuration_thread_checker_); | 649 RTC_DCHECK_RUN_ON(&configuration_thread_checker_); |
650 event_log_->LogAudioReceiveStreamConfig(CreateRtcLogStreamConfig(config)); | 650 event_log_->LogAudioReceiveStreamConfig(CreateRtcLogStreamConfig(config)); |
651 AudioReceiveStream* receive_stream = | 651 AudioReceiveStream* receive_stream = new AudioReceiveStream( |
652 new AudioReceiveStream(transport_send_->packet_router(), config, | 652 &audio_receiver_controller, transport_send_->packet_router(), config, |
653 config_.audio_state, event_log_); | 653 config_.audio_state, event_log_); |
654 { | 654 { |
655 WriteLockScoped write_lock(*receive_crit_); | 655 WriteLockScoped write_lock(*receive_crit_); |
656 audio_rtp_demuxer_.AddSink(config.rtp.remote_ssrc, receive_stream); | |
657 receive_rtp_config_[config.rtp.remote_ssrc] = | 656 receive_rtp_config_[config.rtp.remote_ssrc] = |
658 ReceiveRtpConfig(config.rtp.extensions, UseSendSideBwe(config)); | 657 ReceiveRtpConfig(config.rtp.extensions, UseSendSideBwe(config)); |
659 audio_receive_streams_.insert(receive_stream); | 658 audio_receive_streams_.insert(receive_stream); |
660 | 659 |
661 ConfigureSync(config.sync_group); | 660 ConfigureSync(config.sync_group); |
662 } | 661 } |
663 { | 662 { |
664 ReadLockScoped read_lock(*send_crit_); | 663 ReadLockScoped read_lock(*send_crit_); |
665 auto it = audio_send_ssrcs_.find(config.rtp.local_ssrc); | 664 auto it = audio_send_ssrcs_.find(config.rtp.local_ssrc); |
666 if (it != audio_send_ssrcs_.end()) { | 665 if (it != audio_send_ssrcs_.end()) { |
(...skipping 11 matching lines...) Expand all Loading... | |
678 RTC_DCHECK_RUN_ON(&configuration_thread_checker_); | 677 RTC_DCHECK_RUN_ON(&configuration_thread_checker_); |
679 RTC_DCHECK(receive_stream != nullptr); | 678 RTC_DCHECK(receive_stream != nullptr); |
680 webrtc::internal::AudioReceiveStream* audio_receive_stream = | 679 webrtc::internal::AudioReceiveStream* audio_receive_stream = |
681 static_cast<webrtc::internal::AudioReceiveStream*>(receive_stream); | 680 static_cast<webrtc::internal::AudioReceiveStream*>(receive_stream); |
682 { | 681 { |
683 WriteLockScoped write_lock(*receive_crit_); | 682 WriteLockScoped write_lock(*receive_crit_); |
684 const AudioReceiveStream::Config& config = audio_receive_stream->config(); | 683 const AudioReceiveStream::Config& config = audio_receive_stream->config(); |
685 uint32_t ssrc = config.rtp.remote_ssrc; | 684 uint32_t ssrc = config.rtp.remote_ssrc; |
686 receive_side_cc_.GetRemoteBitrateEstimator(UseSendSideBwe(config)) | 685 receive_side_cc_.GetRemoteBitrateEstimator(UseSendSideBwe(config)) |
687 ->RemoveStream(ssrc); | 686 ->RemoveStream(ssrc); |
688 size_t num_deleted = audio_rtp_demuxer_.RemoveSink(audio_receive_stream); | |
689 RTC_DCHECK(num_deleted == 1); | |
690 audio_receive_streams_.erase(audio_receive_stream); | 687 audio_receive_streams_.erase(audio_receive_stream); |
691 const std::string& sync_group = audio_receive_stream->config().sync_group; | 688 const std::string& sync_group = audio_receive_stream->config().sync_group; |
692 const auto it = sync_stream_mapping_.find(sync_group); | 689 const auto it = sync_stream_mapping_.find(sync_group); |
693 if (it != sync_stream_mapping_.end() && | 690 if (it != sync_stream_mapping_.end() && |
694 it->second == audio_receive_stream) { | 691 it->second == audio_receive_stream) { |
695 sync_stream_mapping_.erase(it); | 692 sync_stream_mapping_.erase(it); |
696 ConfigureSync(sync_group); | 693 ConfigureSync(sync_group); |
697 } | 694 } |
698 receive_rtp_config_.erase(ssrc); | 695 receive_rtp_config_.erase(ssrc); |
699 } | 696 } |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
771 | 768 |
772 UpdateAggregateNetworkState(); | 769 UpdateAggregateNetworkState(); |
773 delete send_stream_impl; | 770 delete send_stream_impl; |
774 } | 771 } |
775 | 772 |
776 webrtc::VideoReceiveStream* Call::CreateVideoReceiveStream( | 773 webrtc::VideoReceiveStream* Call::CreateVideoReceiveStream( |
777 webrtc::VideoReceiveStream::Config configuration) { | 774 webrtc::VideoReceiveStream::Config configuration) { |
778 TRACE_EVENT0("webrtc", "Call::CreateVideoReceiveStream"); | 775 TRACE_EVENT0("webrtc", "Call::CreateVideoReceiveStream"); |
779 RTC_DCHECK_RUN_ON(&configuration_thread_checker_); | 776 RTC_DCHECK_RUN_ON(&configuration_thread_checker_); |
780 | 777 |
781 VideoReceiveStream* receive_stream = | 778 VideoReceiveStream* receive_stream = new VideoReceiveStream( |
782 new VideoReceiveStream(num_cpu_cores_, transport_send_->packet_router(), | 779 &video_receiver_controller, num_cpu_cores_, |
783 std::move(configuration), | 780 transport_send_->packet_router(), std::move(configuration), |
784 module_process_thread_.get(), call_stats_.get()); | 781 module_process_thread_.get(), call_stats_.get()); |
785 | 782 |
786 const webrtc::VideoReceiveStream::Config& config = receive_stream->config(); | 783 const webrtc::VideoReceiveStream::Config& config = receive_stream->config(); |
787 ReceiveRtpConfig receive_config(config.rtp.extensions, | 784 ReceiveRtpConfig receive_config(config.rtp.extensions, |
788 UseSendSideBwe(config)); | 785 UseSendSideBwe(config)); |
789 { | 786 { |
790 WriteLockScoped write_lock(*receive_crit_); | 787 WriteLockScoped write_lock(*receive_crit_); |
791 video_rtp_demuxer_.AddSink(config.rtp.remote_ssrc, receive_stream); | |
792 if (config.rtp.rtx_ssrc) { | 788 if (config.rtp.rtx_ssrc) { |
793 video_rtp_demuxer_.AddSink(config.rtp.rtx_ssrc, receive_stream); | |
794 // We record identical config for the rtx stream as for the main | 789 // We record identical config for the rtx stream as for the main |
795 // stream. Since the transport_send_cc negotiation is per payload | 790 // stream. Since the transport_send_cc negotiation is per payload |
796 // type, we may get an incorrect value for the rtx stream, but | 791 // type, we may get an incorrect value for the rtx stream, but |
797 // that is unlikely to matter in practice. | 792 // that is unlikely to matter in practice. |
798 receive_rtp_config_[config.rtp.rtx_ssrc] = receive_config; | 793 receive_rtp_config_[config.rtp.rtx_ssrc] = receive_config; |
799 } | 794 } |
800 receive_rtp_config_[config.rtp.remote_ssrc] = receive_config; | 795 receive_rtp_config_[config.rtp.remote_ssrc] = receive_config; |
801 video_receive_streams_.insert(receive_stream); | 796 video_receive_streams_.insert(receive_stream); |
802 ConfigureSync(config.sync_group); | 797 ConfigureSync(config.sync_group); |
803 } | 798 } |
804 receive_stream->SignalNetworkState(video_network_state_); | 799 receive_stream->SignalNetworkState(video_network_state_); |
805 UpdateAggregateNetworkState(); | 800 UpdateAggregateNetworkState(); |
806 event_log_->LogVideoReceiveStreamConfig(CreateRtcLogStreamConfig(config)); | 801 event_log_->LogVideoReceiveStreamConfig(CreateRtcLogStreamConfig(config)); |
807 return receive_stream; | 802 return receive_stream; |
808 } | 803 } |
809 | 804 |
810 void Call::DestroyVideoReceiveStream( | 805 void Call::DestroyVideoReceiveStream( |
811 webrtc::VideoReceiveStream* receive_stream) { | 806 webrtc::VideoReceiveStream* receive_stream) { |
812 TRACE_EVENT0("webrtc", "Call::DestroyVideoReceiveStream"); | 807 TRACE_EVENT0("webrtc", "Call::DestroyVideoReceiveStream"); |
813 RTC_DCHECK_RUN_ON(&configuration_thread_checker_); | 808 RTC_DCHECK_RUN_ON(&configuration_thread_checker_); |
814 RTC_DCHECK(receive_stream != nullptr); | 809 RTC_DCHECK(receive_stream != nullptr); |
815 VideoReceiveStream* receive_stream_impl = | 810 VideoReceiveStream* receive_stream_impl = |
816 static_cast<VideoReceiveStream*>(receive_stream); | 811 static_cast<VideoReceiveStream*>(receive_stream); |
817 const VideoReceiveStream::Config& config = receive_stream_impl->config(); | 812 const VideoReceiveStream::Config& config = receive_stream_impl->config(); |
818 { | 813 { |
819 WriteLockScoped write_lock(*receive_crit_); | 814 WriteLockScoped write_lock(*receive_crit_); |
820 // Remove all ssrcs pointing to a receive stream. As RTX retransmits on a | 815 // Remove all ssrcs pointing to a receive stream. As RTX retransmits on a |
821 // separate SSRC there can be either one or two. | 816 // separate SSRC there can be either one or two. |
822 size_t num_deleted = video_rtp_demuxer_.RemoveSink(receive_stream_impl); | |
823 RTC_DCHECK_GE(num_deleted, 1); | |
824 receive_rtp_config_.erase(config.rtp.remote_ssrc); | 817 receive_rtp_config_.erase(config.rtp.remote_ssrc); |
825 if (config.rtp.rtx_ssrc) { | 818 if (config.rtp.rtx_ssrc) { |
826 receive_rtp_config_.erase(config.rtp.rtx_ssrc); | 819 receive_rtp_config_.erase(config.rtp.rtx_ssrc); |
827 } | 820 } |
828 video_receive_streams_.erase(receive_stream_impl); | 821 video_receive_streams_.erase(receive_stream_impl); |
829 ConfigureSync(config.sync_group); | 822 ConfigureSync(config.sync_group); |
830 } | 823 } |
831 | 824 |
832 receive_side_cc_.GetRemoteBitrateEstimator(UseSendSideBwe(config)) | 825 receive_side_cc_.GetRemoteBitrateEstimator(UseSendSideBwe(config)) |
833 ->RemoveStream(config.rtp.remote_ssrc); | 826 ->RemoveStream(config.rtp.remote_ssrc); |
834 | 827 |
835 UpdateAggregateNetworkState(); | 828 UpdateAggregateNetworkState(); |
836 delete receive_stream_impl; | 829 delete receive_stream_impl; |
danilchap
2017/06/09 13:49:32
by making removal from demuxer automatic, you move
nisse-webrtc
2017/06/13 10:56:07
I don't think we have any testcase.
Hmm. We have
| |
837 } | 830 } |
838 | 831 |
839 FlexfecReceiveStream* Call::CreateFlexfecReceiveStream( | 832 FlexfecReceiveStream* Call::CreateFlexfecReceiveStream( |
840 const FlexfecReceiveStream::Config& config) { | 833 const FlexfecReceiveStream::Config& config) { |
841 TRACE_EVENT0("webrtc", "Call::CreateFlexfecReceiveStream"); | 834 TRACE_EVENT0("webrtc", "Call::CreateFlexfecReceiveStream"); |
842 RTC_DCHECK_RUN_ON(&configuration_thread_checker_); | 835 RTC_DCHECK_RUN_ON(&configuration_thread_checker_); |
843 | 836 |
844 RecoveredPacketReceiver* recovered_packet_receiver = this; | 837 RecoveredPacketReceiver* recovered_packet_receiver = this; |
838 | |
845 FlexfecReceiveStreamImpl* receive_stream = new FlexfecReceiveStreamImpl( | 839 FlexfecReceiveStreamImpl* receive_stream = new FlexfecReceiveStreamImpl( |
846 config, recovered_packet_receiver, call_stats_->rtcp_rtt_stats(), | 840 &video_receiver_controller, config, recovered_packet_receiver, |
847 module_process_thread_.get()); | 841 call_stats_->rtcp_rtt_stats(), module_process_thread_.get()); |
848 | |
849 { | 842 { |
850 WriteLockScoped write_lock(*receive_crit_); | 843 WriteLockScoped write_lock(*receive_crit_); |
851 video_rtp_demuxer_.AddSink(config.remote_ssrc, receive_stream); | |
852 | |
853 for (auto ssrc : config.protected_media_ssrcs) | |
854 video_rtp_demuxer_.AddSink(ssrc, receive_stream); | |
855 | |
856 RTC_DCHECK(receive_rtp_config_.find(config.remote_ssrc) == | 844 RTC_DCHECK(receive_rtp_config_.find(config.remote_ssrc) == |
857 receive_rtp_config_.end()); | 845 receive_rtp_config_.end()); |
858 receive_rtp_config_[config.remote_ssrc] = | 846 receive_rtp_config_[config.remote_ssrc] = |
859 ReceiveRtpConfig(config.rtp_header_extensions, UseSendSideBwe(config)); | 847 ReceiveRtpConfig(config.rtp_header_extensions, UseSendSideBwe(config)); |
860 } | 848 } |
861 | 849 |
862 // TODO(brandtr): Store config in RtcEventLog here. | 850 // TODO(brandtr): Store config in RtcEventLog here. |
863 | 851 |
864 return receive_stream; | 852 return receive_stream; |
865 } | 853 } |
(...skipping 10 matching lines...) Expand all Loading... | |
876 { | 864 { |
877 WriteLockScoped write_lock(*receive_crit_); | 865 WriteLockScoped write_lock(*receive_crit_); |
878 | 866 |
879 const FlexfecReceiveStream::Config& config = | 867 const FlexfecReceiveStream::Config& config = |
880 receive_stream_impl->GetConfig(); | 868 receive_stream_impl->GetConfig(); |
881 uint32_t ssrc = config.remote_ssrc; | 869 uint32_t ssrc = config.remote_ssrc; |
882 receive_rtp_config_.erase(ssrc); | 870 receive_rtp_config_.erase(ssrc); |
883 | 871 |
884 // Remove all SSRCs pointing to the FlexfecReceiveStreamImpl to be | 872 // Remove all SSRCs pointing to the FlexfecReceiveStreamImpl to be |
885 // destroyed. | 873 // destroyed. |
886 video_rtp_demuxer_.RemoveSink(receive_stream_impl); | |
887 receive_side_cc_.GetRemoteBitrateEstimator(UseSendSideBwe(config)) | 874 receive_side_cc_.GetRemoteBitrateEstimator(UseSendSideBwe(config)) |
888 ->RemoveStream(ssrc); | 875 ->RemoveStream(ssrc); |
889 } | 876 } |
890 | 877 |
891 delete receive_stream_impl; | 878 delete receive_stream_impl; |
892 } | 879 } |
893 | 880 |
894 Call::Stats Call::GetStats() const { | 881 Call::Stats Call::GetStats() const { |
895 // TODO(solenberg): Some test cases in EndToEndTest use this from a different | 882 // TODO(solenberg): Some test cases in EndToEndTest use this from a different |
896 // thread. Re-enable once that is fixed. | 883 // thread. Re-enable once that is fixed. |
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1314 // on parsed_packet to the receive streams. | 1301 // on parsed_packet to the receive streams. |
1315 rtc::Optional<RtpPacketReceived> parsed_packet = | 1302 rtc::Optional<RtpPacketReceived> parsed_packet = |
1316 ParseRtpPacket(packet, length, &packet_time); | 1303 ParseRtpPacket(packet, length, &packet_time); |
1317 | 1304 |
1318 if (!parsed_packet) | 1305 if (!parsed_packet) |
1319 return DELIVERY_PACKET_ERROR; | 1306 return DELIVERY_PACKET_ERROR; |
1320 | 1307 |
1321 NotifyBweOfReceivedPacket(*parsed_packet, media_type); | 1308 NotifyBweOfReceivedPacket(*parsed_packet, media_type); |
1322 | 1309 |
1323 if (media_type == MediaType::AUDIO) { | 1310 if (media_type == MediaType::AUDIO) { |
1324 if (audio_rtp_demuxer_.OnRtpPacket(*parsed_packet)) { | 1311 if (audio_receiver_controller.OnRtpPacket(*parsed_packet)) { |
1325 received_bytes_per_second_counter_.Add(static_cast<int>(length)); | 1312 received_bytes_per_second_counter_.Add(static_cast<int>(length)); |
1326 received_audio_bytes_per_second_counter_.Add(static_cast<int>(length)); | 1313 received_audio_bytes_per_second_counter_.Add(static_cast<int>(length)); |
1327 event_log_->LogRtpHeader(kIncomingPacket, packet, length); | 1314 event_log_->LogRtpHeader(kIncomingPacket, packet, length); |
1328 return DELIVERY_OK; | 1315 return DELIVERY_OK; |
1329 } | 1316 } |
1330 } else if (media_type == MediaType::VIDEO) { | 1317 } else if (media_type == MediaType::VIDEO) { |
1331 if (video_rtp_demuxer_.OnRtpPacket(*parsed_packet)) { | 1318 if (video_receiver_controller.OnRtpPacket(*parsed_packet)) { |
1332 received_bytes_per_second_counter_.Add(static_cast<int>(length)); | 1319 received_bytes_per_second_counter_.Add(static_cast<int>(length)); |
1333 received_video_bytes_per_second_counter_.Add(static_cast<int>(length)); | 1320 received_video_bytes_per_second_counter_.Add(static_cast<int>(length)); |
1334 event_log_->LogRtpHeader(kIncomingPacket, packet, length); | 1321 event_log_->LogRtpHeader(kIncomingPacket, packet, length); |
1335 return DELIVERY_OK; | 1322 return DELIVERY_OK; |
1336 } | 1323 } |
1337 } | 1324 } |
1338 return DELIVERY_UNKNOWN_SSRC; | 1325 return DELIVERY_UNKNOWN_SSRC; |
1339 } | 1326 } |
1340 | 1327 |
1341 PacketReceiver::DeliveryStatus Call::DeliverPacket( | 1328 PacketReceiver::DeliveryStatus Call::DeliverPacket( |
(...skipping 15 matching lines...) Expand all Loading... | |
1357 // audio packets with FlexFEC. | 1344 // audio packets with FlexFEC. |
1358 void Call::OnRecoveredPacket(const uint8_t* packet, size_t length) { | 1345 void Call::OnRecoveredPacket(const uint8_t* packet, size_t length) { |
1359 ReadLockScoped read_lock(*receive_crit_); | 1346 ReadLockScoped read_lock(*receive_crit_); |
1360 rtc::Optional<RtpPacketReceived> parsed_packet = | 1347 rtc::Optional<RtpPacketReceived> parsed_packet = |
1361 ParseRtpPacket(packet, length, nullptr); | 1348 ParseRtpPacket(packet, length, nullptr); |
1362 if (!parsed_packet) | 1349 if (!parsed_packet) |
1363 return; | 1350 return; |
1364 | 1351 |
1365 parsed_packet->set_recovered(true); | 1352 parsed_packet->set_recovered(true); |
1366 | 1353 |
1367 video_rtp_demuxer_.OnRtpPacket(*parsed_packet); | 1354 video_receiver_controller.OnRtpPacket(*parsed_packet); |
1368 } | 1355 } |
1369 | 1356 |
1370 void Call::NotifyBweOfReceivedPacket(const RtpPacketReceived& packet, | 1357 void Call::NotifyBweOfReceivedPacket(const RtpPacketReceived& packet, |
1371 MediaType media_type) { | 1358 MediaType media_type) { |
1372 auto it = receive_rtp_config_.find(packet.Ssrc()); | 1359 auto it = receive_rtp_config_.find(packet.Ssrc()); |
1373 bool use_send_side_bwe = | 1360 bool use_send_side_bwe = |
1374 (it != receive_rtp_config_.end()) && it->second.use_send_side_bwe; | 1361 (it != receive_rtp_config_.end()) && it->second.use_send_side_bwe; |
1375 | 1362 |
1376 RTPHeader header; | 1363 RTPHeader header; |
1377 packet.GetHeader(&header); | 1364 packet.GetHeader(&header); |
(...skipping 13 matching lines...) Expand all Loading... | |
1391 (use_send_side_bwe && header.extension.hasTransportSequenceNumber)) { | 1378 (use_send_side_bwe && header.extension.hasTransportSequenceNumber)) { |
1392 receive_side_cc_.OnReceivedPacket( | 1379 receive_side_cc_.OnReceivedPacket( |
1393 packet.arrival_time_ms(), packet.payload_size() + packet.padding_size(), | 1380 packet.arrival_time_ms(), packet.payload_size() + packet.padding_size(), |
1394 header); | 1381 header); |
1395 } | 1382 } |
1396 } | 1383 } |
1397 | 1384 |
1398 } // namespace internal | 1385 } // namespace internal |
1399 | 1386 |
1400 } // namespace webrtc | 1387 } // namespace webrtc |
OLD | NEW |