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

Side by Side Diff: webrtc/modules/rtp_rtcp/source/rtp_sender.cc

Issue 2960363002: Implement RTP keepalive in native stack. (Closed)
Patch Set: Cleanup Created 3 years, 5 months 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) 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 1271 matching lines...) Expand 10 before | Expand all | Expand 10 after
1282 rtc::CritScope lock(&send_critsect_); 1282 rtc::CritScope lock(&send_critsect_);
1283 if (rtp_overhead_bytes_per_packet_ == packet.headers_size()) { 1283 if (rtp_overhead_bytes_per_packet_ == packet.headers_size()) {
1284 return; 1284 return;
1285 } 1285 }
1286 rtp_overhead_bytes_per_packet_ = packet.headers_size(); 1286 rtp_overhead_bytes_per_packet_ = packet.headers_size();
1287 overhead_bytes_per_packet = rtp_overhead_bytes_per_packet_; 1287 overhead_bytes_per_packet = rtp_overhead_bytes_per_packet_;
1288 } 1288 }
1289 overhead_observer_->OnOverheadChanged(overhead_bytes_per_packet); 1289 overhead_observer_->OnOverheadChanged(overhead_bytes_per_packet);
1290 } 1290 }
1291 1291
1292 int64_t RTPSender::LastTimestampTimeMs() const {
1293 rtc::CritScope lock(&send_critsect_);
1294 return last_timestamp_time_ms_;
1295 }
1296
1297 void RTPSender::SendKeepAlive(uint8_t payload_type) {
1298 std::unique_ptr<RtpPacketToSend> packet = AllocatePacket();
1299 packet->SetPayloadType(payload_type);
1300 // Set marker bit and timestamps in the same manner as plain padding packets.
1301 packet->SetMarker(false);
1302 {
1303 rtc::CritScope lock(&send_critsect_);
1304 packet->SetTimestamp(last_rtp_timestamp_);
1305 packet->set_capture_time_ms(capture_time_ms_);
1306 }
1307 AssignSequenceNumber(packet.get());
1308 SendToNetwork(std::move(packet), StorageType::kDontRetransmit,
1309 RtpPacketSender::Priority::kLowPriority);
1310 }
1311
1292 } // namespace webrtc 1312 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtp_sender.h ('k') | webrtc/modules/rtp_rtcp/source/rtp_sender_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698