OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 613 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
624 bool RTPSender::SendPacketToNetwork(const RtpPacketToSend& packet, | 624 bool RTPSender::SendPacketToNetwork(const RtpPacketToSend& packet, |
625 const PacketOptions& options, | 625 const PacketOptions& options, |
626 const PacedPacketInfo& pacing_info) { | 626 const PacedPacketInfo& pacing_info) { |
627 int bytes_sent = -1; | 627 int bytes_sent = -1; |
628 if (transport_) { | 628 if (transport_) { |
629 UpdateRtpOverhead(packet); | 629 UpdateRtpOverhead(packet); |
630 bytes_sent = transport_->SendRtp(packet.data(), packet.size(), options) | 630 bytes_sent = transport_->SendRtp(packet.data(), packet.size(), options) |
631 ? static_cast<int>(packet.size()) | 631 ? static_cast<int>(packet.size()) |
632 : -1; | 632 : -1; |
633 if (event_log_ && bytes_sent > 0) { | 633 if (event_log_ && bytes_sent > 0) { |
634 event_log_->LogRtpHeader(kOutgoingPacket, MediaType::ANY, packet.data(), | 634 event_log_->LogRtpHeader(kOutgoingPacket, packet.data(), packet.size(), |
635 packet.size(), pacing_info.probe_cluster_id); | 635 pacing_info.probe_cluster_id); |
636 } | 636 } |
637 } | 637 } |
638 TRACE_EVENT_INSTANT2(TRACE_DISABLED_BY_DEFAULT("webrtc_rtp"), | 638 TRACE_EVENT_INSTANT2(TRACE_DISABLED_BY_DEFAULT("webrtc_rtp"), |
639 "RTPSender::SendPacketToNetwork", "size", packet.size(), | 639 "RTPSender::SendPacketToNetwork", "size", packet.size(), |
640 "sent", bytes_sent); | 640 "sent", bytes_sent); |
641 // TODO(pwestin): Add a separate bitrate for sent bitrate after pacer. | 641 // TODO(pwestin): Add a separate bitrate for sent bitrate after pacer. |
642 if (bytes_sent <= 0) { | 642 if (bytes_sent <= 0) { |
643 LOG(LS_WARNING) << "Transport failed to send packet."; | 643 LOG(LS_WARNING) << "Transport failed to send packet."; |
644 return false; | 644 return false; |
645 } | 645 } |
(...skipping 622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1268 if (rtp_overhead_bytes_per_packet_ == packet.headers_size()) { | 1268 if (rtp_overhead_bytes_per_packet_ == packet.headers_size()) { |
1269 return; | 1269 return; |
1270 } | 1270 } |
1271 rtp_overhead_bytes_per_packet_ = packet.headers_size(); | 1271 rtp_overhead_bytes_per_packet_ = packet.headers_size(); |
1272 overhead_bytes_per_packet = rtp_overhead_bytes_per_packet_; | 1272 overhead_bytes_per_packet = rtp_overhead_bytes_per_packet_; |
1273 } | 1273 } |
1274 overhead_observer_->OnOverheadChanged(overhead_bytes_per_packet); | 1274 overhead_observer_->OnOverheadChanged(overhead_bytes_per_packet); |
1275 } | 1275 } |
1276 | 1276 |
1277 } // namespace webrtc | 1277 } // namespace webrtc |
OLD | NEW |