| 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 732 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 743 } else { | 743 } else { |
| 744 video_stream->SetSyncChannel(voice_engine(), -1); | 744 video_stream->SetSyncChannel(voice_engine(), -1); |
| 745 } | 745 } |
| 746 } | 746 } |
| 747 } | 747 } |
| 748 | 748 |
| 749 PacketReceiver::DeliveryStatus Call::DeliverRtcp(MediaType media_type, | 749 PacketReceiver::DeliveryStatus Call::DeliverRtcp(MediaType media_type, |
| 750 const uint8_t* packet, | 750 const uint8_t* packet, |
| 751 size_t length) { | 751 size_t length) { |
| 752 TRACE_EVENT0("webrtc", "Call::DeliverRtcp"); | 752 TRACE_EVENT0("webrtc", "Call::DeliverRtcp"); |
| 753 // TODO(pbos): Figure out what channel needs it actually. | 753 // TODO(pbos): Make sure it's a valid packet. |
| 754 // Do NOT broadcast! Also make sure it's a valid packet. | |
| 755 // Return DELIVERY_UNKNOWN_SSRC if it can be determined that | 754 // Return DELIVERY_UNKNOWN_SSRC if it can be determined that |
| 756 // there's no receiver of the packet. | 755 // there's no receiver of the packet. |
| 757 received_rtcp_bytes_ += length; | 756 received_rtcp_bytes_ += length; |
| 758 bool rtcp_delivered = false; | 757 bool rtcp_delivered = false; |
| 759 if (media_type == MediaType::ANY || media_type == MediaType::VIDEO) { | 758 if (media_type == MediaType::ANY || media_type == MediaType::VIDEO) { |
| 760 ReadLockScoped read_lock(*receive_crit_); | 759 ReadLockScoped read_lock(*receive_crit_); |
| 761 for (VideoReceiveStream* stream : video_receive_streams_) { | 760 for (VideoReceiveStream* stream : video_receive_streams_) { |
| 762 if (stream->DeliverRtcp(packet, length)) { | 761 if (stream->DeliverRtcp(packet, length)) |
| 763 rtcp_delivered = true; | 762 rtcp_delivered = true; |
| 764 if (event_log_) | 763 } |
| 765 event_log_->LogRtcpPacket(kIncomingPacket, media_type, packet, | 764 } |
| 766 length); | 765 if (media_type == MediaType::ANY || media_type == MediaType::AUDIO) { |
| 767 } | 766 ReadLockScoped read_lock(*receive_crit_); |
| 767 for (auto& kv : audio_receive_ssrcs_) { |
| 768 if (kv.second->DeliverRtcp(packet, length)) |
| 769 rtcp_delivered = true; |
| 768 } | 770 } |
| 769 } | 771 } |
| 770 if (media_type == MediaType::ANY || media_type == MediaType::VIDEO) { | 772 if (media_type == MediaType::ANY || media_type == MediaType::VIDEO) { |
| 771 ReadLockScoped read_lock(*send_crit_); | 773 ReadLockScoped read_lock(*send_crit_); |
| 772 for (VideoSendStream* stream : video_send_streams_) { | 774 for (VideoSendStream* stream : video_send_streams_) { |
| 773 if (stream->DeliverRtcp(packet, length)) { | 775 if (stream->DeliverRtcp(packet, length)) |
| 774 rtcp_delivered = true; | 776 rtcp_delivered = true; |
| 775 if (event_log_) | |
| 776 event_log_->LogRtcpPacket(kIncomingPacket, media_type, packet, | |
| 777 length); | |
| 778 } | |
| 779 } | 777 } |
| 780 } | 778 } |
| 779 if (media_type == MediaType::ANY || media_type == MediaType::AUDIO) { |
| 780 ReadLockScoped read_lock(*send_crit_); |
| 781 for (auto& kv : audio_send_ssrcs_) { |
| 782 if (kv.second->DeliverRtcp(packet, length)) |
| 783 rtcp_delivered = true; |
| 784 } |
| 785 } |
| 786 |
| 787 if (event_log_ && rtcp_delivered) |
| 788 event_log_->LogRtcpPacket(kIncomingPacket, media_type, packet, length); |
| 789 |
| 781 return rtcp_delivered ? DELIVERY_OK : DELIVERY_PACKET_ERROR; | 790 return rtcp_delivered ? DELIVERY_OK : DELIVERY_PACKET_ERROR; |
| 782 } | 791 } |
| 783 | 792 |
| 784 PacketReceiver::DeliveryStatus Call::DeliverRtp(MediaType media_type, | 793 PacketReceiver::DeliveryStatus Call::DeliverRtp(MediaType media_type, |
| 785 const uint8_t* packet, | 794 const uint8_t* packet, |
| 786 size_t length, | 795 size_t length, |
| 787 const PacketTime& packet_time) { | 796 const PacketTime& packet_time) { |
| 788 TRACE_EVENT0("webrtc", "Call::DeliverRtp"); | 797 TRACE_EVENT0("webrtc", "Call::DeliverRtp"); |
| 789 // Minimum RTP header size. | 798 // Minimum RTP header size. |
| 790 if (length < 12) | 799 if (length < 12) |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 833 // thread. Then this check can be enabled. | 842 // thread. Then this check can be enabled. |
| 834 // RTC_DCHECK(!configuration_thread_checker_.CalledOnValidThread()); | 843 // RTC_DCHECK(!configuration_thread_checker_.CalledOnValidThread()); |
| 835 if (RtpHeaderParser::IsRtcp(packet, length)) | 844 if (RtpHeaderParser::IsRtcp(packet, length)) |
| 836 return DeliverRtcp(media_type, packet, length); | 845 return DeliverRtcp(media_type, packet, length); |
| 837 | 846 |
| 838 return DeliverRtp(media_type, packet, length, packet_time); | 847 return DeliverRtp(media_type, packet, length, packet_time); |
| 839 } | 848 } |
| 840 | 849 |
| 841 } // namespace internal | 850 } // namespace internal |
| 842 } // namespace webrtc | 851 } // namespace webrtc |
| OLD | NEW |