Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(150)

Side by Side Diff: webrtc/call/call.cc

Issue 1457383002: Implement standalone event tracing in AppRTCDemo. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: revert test_main.cc, it shouldn't be on for all tests either way Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 650 matching lines...) Expand 10 before | Expand all | Expand 10 after
661 sync_audio_stream->config().voe_channel_id); 661 sync_audio_stream->config().voe_channel_id);
662 } else { 662 } else {
663 video_stream->SetSyncChannel(voice_engine(), -1); 663 video_stream->SetSyncChannel(voice_engine(), -1);
664 } 664 }
665 } 665 }
666 } 666 }
667 667
668 PacketReceiver::DeliveryStatus Call::DeliverRtcp(MediaType media_type, 668 PacketReceiver::DeliveryStatus Call::DeliverRtcp(MediaType media_type,
669 const uint8_t* packet, 669 const uint8_t* packet,
670 size_t length) { 670 size_t length) {
671 TRACE_EVENT0("webrtc", "Call::DeliverRtcp");
671 // TODO(pbos): Figure out what channel needs it actually. 672 // TODO(pbos): Figure out what channel needs it actually.
672 // Do NOT broadcast! Also make sure it's a valid packet. 673 // Do NOT broadcast! Also make sure it's a valid packet.
673 // Return DELIVERY_UNKNOWN_SSRC if it can be determined that 674 // Return DELIVERY_UNKNOWN_SSRC if it can be determined that
674 // there's no receiver of the packet. 675 // there's no receiver of the packet.
675 received_rtcp_bytes_per_sec_.AddSamples(length); 676 received_rtcp_bytes_per_sec_.AddSamples(length);
676 bool rtcp_delivered = false; 677 bool rtcp_delivered = false;
677 if (media_type == MediaType::ANY || media_type == MediaType::VIDEO) { 678 if (media_type == MediaType::ANY || media_type == MediaType::VIDEO) {
678 ReadLockScoped read_lock(*receive_crit_); 679 ReadLockScoped read_lock(*receive_crit_);
679 for (VideoReceiveStream* stream : video_receive_streams_) { 680 for (VideoReceiveStream* stream : video_receive_streams_) {
680 if (stream->DeliverRtcp(packet, length)) { 681 if (stream->DeliverRtcp(packet, length)) {
(...skipping 13 matching lines...) Expand all
694 } 695 }
695 } 696 }
696 } 697 }
697 return rtcp_delivered ? DELIVERY_OK : DELIVERY_PACKET_ERROR; 698 return rtcp_delivered ? DELIVERY_OK : DELIVERY_PACKET_ERROR;
698 } 699 }
699 700
700 PacketReceiver::DeliveryStatus Call::DeliverRtp(MediaType media_type, 701 PacketReceiver::DeliveryStatus Call::DeliverRtp(MediaType media_type,
701 const uint8_t* packet, 702 const uint8_t* packet,
702 size_t length, 703 size_t length,
703 const PacketTime& packet_time) { 704 const PacketTime& packet_time) {
705 TRACE_EVENT0("webrtc", "Call::DeliverRtp");
704 // Minimum RTP header size. 706 // Minimum RTP header size.
705 if (length < 12) 707 if (length < 12)
706 return DELIVERY_PACKET_ERROR; 708 return DELIVERY_PACKET_ERROR;
707 709
708 if (first_rtp_packet_received_ms_ == -1) 710 if (first_rtp_packet_received_ms_ == -1)
709 first_rtp_packet_received_ms_ = clock_->TimeInMilliseconds(); 711 first_rtp_packet_received_ms_ = clock_->TimeInMilliseconds();
710 712
711 uint32_t ssrc = ByteReader<uint32_t>::ReadBigEndian(&packet[8]); 713 uint32_t ssrc = ByteReader<uint32_t>::ReadBigEndian(&packet[8]);
712 ReadLockScoped read_lock(*receive_crit_); 714 ReadLockScoped read_lock(*receive_crit_);
713 if (media_type == MediaType::ANY || media_type == MediaType::AUDIO) { 715 if (media_type == MediaType::ANY || media_type == MediaType::AUDIO) {
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
747 // thread. Then this check can be enabled. 749 // thread. Then this check can be enabled.
748 // RTC_DCHECK(!configuration_thread_checker_.CalledOnValidThread()); 750 // RTC_DCHECK(!configuration_thread_checker_.CalledOnValidThread());
749 if (RtpHeaderParser::IsRtcp(packet, length)) 751 if (RtpHeaderParser::IsRtcp(packet, length))
750 return DeliverRtcp(media_type, packet, length); 752 return DeliverRtcp(media_type, packet, length);
751 753
752 return DeliverRtp(media_type, packet, length, packet_time); 754 return DeliverRtp(media_type, packet, length, packet_time);
753 } 755 }
754 756
755 } // namespace internal 757 } // namespace internal
756 } // namespace webrtc 758 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698