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

Unified Diff: webrtc/modules/rtp_rtcp/source/rtp_sender.cc

Issue 2067673004: Style cleanups in RtpSender. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: fix compilation Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/rtp_rtcp/source/rtp_sender.cc
diff --git a/webrtc/modules/rtp_rtcp/source/rtp_sender.cc b/webrtc/modules/rtp_rtcp/source/rtp_sender.cc
index fe0e49f79e6a2df6194a307095fe8c40beb49062..f0f7d0d4c12d84be189aa7ffa4a659a4a5e246bb 100644
--- a/webrtc/modules/rtp_rtcp/source/rtp_sender.cc
+++ b/webrtc/modules/rtp_rtcp/source/rtp_sender.cc
@@ -619,19 +619,11 @@ void RTPSender::BuildPaddingPacket(uint8_t* packet,
static_cast<uint8_t>(padding_length);
}
-size_t RTPSender::SendPadData(size_t bytes,
- bool timestamp_provided,
- uint32_t timestamp,
- int64_t capture_time_ms) {
- return SendPadData(bytes, timestamp_provided, timestamp, capture_time_ms,
- PacketInfo::kNotAProbe);
-}
size_t RTPSender::SendPadData(size_t bytes,
- bool timestamp_provided,
- uint32_t timestamp,
- int64_t capture_time_ms,
int probe_cluster_id) {
+ uint32_t timestamp = 0;
+ int64_t capture_time_ms = 0;
// Always send full padding packets. This is accounted for by the
// RtpPacketSender,
// which will make sure we don't send too much padding even if a single packet
@@ -654,10 +646,8 @@ size_t RTPSender::SendPadData(size_t bytes,
rtc::CritScope lock(&send_critsect_);
if (!sending_media_)
return bytes_sent;
- if (!timestamp_provided) {
- timestamp = timestamp_;
- capture_time_ms = capture_time_ms_;
- }
+ timestamp = timestamp_;
+ capture_time_ms = capture_time_ms_;
if (rtx_ == kRtxOff) {
// Without RTX we can't send padding in the middle of frames.
if (!last_packet_marker_bit_)
@@ -1053,8 +1043,7 @@ size_t RTPSender::TimeToSendPadding(size_t bytes, int probe_cluster_id) {
return 0;
size_t bytes_sent = TrySendRedundantPayloads(bytes, probe_cluster_id);
if (bytes_sent < bytes)
- bytes_sent +=
- SendPadData(bytes - bytes_sent, false, 0, 0, probe_cluster_id);
+ bytes_sent += SendPadData(bytes - bytes_sent, probe_cluster_id);
return bytes_sent;
}
@@ -1240,7 +1229,7 @@ size_t RTPSender::CreateRtpHeader(uint8_t* header,
}
uint16_t len =
- BuildRTPHeaderExtension(header + rtp_header_length, marker_bit);
+ BuildRtpHeaderExtension(header + rtp_header_length, marker_bit);
if (len > 0) {
header[0] |= 0x10; // Set extension bit.
rtp_header_length += len;
@@ -1248,24 +1237,15 @@ size_t RTPSender::CreateRtpHeader(uint8_t* header,
return rtp_header_length;
}
-int32_t RTPSender::BuildRTPheader(uint8_t* data_buffer,
+int32_t RTPSender::BuildRtpHeader(uint8_t* data_buffer,
int8_t payload_type,
bool marker_bit,
uint32_t capture_timestamp,
- int64_t capture_time_ms,
- bool timestamp_provided,
- bool inc_sequence_number) {
+ int64_t capture_time_ms) {
assert(payload_type >= 0);
rtc::CritScope lock(&send_critsect_);
- if (timestamp_provided) {
- timestamp_ = start_timestamp_ + capture_timestamp;
- } else {
- // Make a unique time stamp.
- // We can't inc by the actual time, since then we increase the risk of back
- // timing.
- timestamp_++;
- }
+ timestamp_ = start_timestamp_ + capture_timestamp;
last_timestamp_time_ms_ = clock_->TimeInMilliseconds();
uint32_t sequence_number = sequence_number_++;
capture_time_ms_ = capture_time_ms;
@@ -1274,7 +1254,7 @@ int32_t RTPSender::BuildRTPheader(uint8_t* data_buffer,
timestamp_, sequence_number, csrcs_);
}
-uint16_t RTPSender::BuildRTPHeaderExtension(uint8_t* data_buffer,
+uint16_t RTPSender::BuildRtpHeaderExtension(uint8_t* data_buffer,
bool marker_bit) const {
if (rtp_header_extension_map_.Size() <= 0) {
return 0;

Powered by Google App Engine
This is Rietveld 408576698