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

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

Issue 1218093002: Move early-return in TimeToSendPadding. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 940 matching lines...) Expand 10 before | Expand all | Expand 10 after
951 bool fec_enabled; 951 bool fec_enabled;
952 uint8_t pt_red; 952 uint8_t pt_red;
953 uint8_t pt_fec; 953 uint8_t pt_fec;
954 video_->GenericFECStatus(fec_enabled, pt_red, pt_fec); 954 video_->GenericFECStatus(fec_enabled, pt_red, pt_fec);
955 return fec_enabled && 955 return fec_enabled &&
956 header.payloadType == pt_red && 956 header.payloadType == pt_red &&
957 buffer[header.headerLength] == pt_fec; 957 buffer[header.headerLength] == pt_fec;
958 } 958 }
959 959
960 size_t RTPSender::TimeToSendPadding(size_t bytes) { 960 size_t RTPSender::TimeToSendPadding(size_t bytes) {
961 if (bytes == 0)
962 return 0;
961 { 963 {
962 CriticalSectionScoped cs(send_critsect_.get()); 964 CriticalSectionScoped cs(send_critsect_.get());
963 if (!sending_media_) return 0; 965 if (!sending_media_) return 0;
964 } 966 }
965 if (bytes == 0)
966 return 0;
967 size_t bytes_sent = TrySendRedundantPayloads(bytes); 967 size_t bytes_sent = TrySendRedundantPayloads(bytes);
968 if (bytes_sent < bytes) 968 if (bytes_sent < bytes)
969 bytes_sent += TrySendPadData(bytes - bytes_sent); 969 bytes_sent += TrySendPadData(bytes - bytes_sent);
970 return bytes_sent; 970 return bytes_sent;
971 } 971 }
972 972
973 // TODO(pwestin): send in the RtpHeaderParser to avoid parsing it again. 973 // TODO(pwestin): send in the RtpHeaderParser to avoid parsing it again.
974 int32_t RTPSender::SendToNetwork( 974 int32_t RTPSender::SendToNetwork(
975 uint8_t *buffer, size_t payload_length, size_t rtp_header_length, 975 uint8_t *buffer, size_t payload_length, size_t rtp_header_length,
976 int64_t capture_time_ms, StorageType storage, 976 int64_t capture_time_ms, StorageType storage,
(...skipping 900 matching lines...) Expand 10 before | Expand all | Expand 10 after
1877 CriticalSectionScoped lock(send_critsect_.get()); 1877 CriticalSectionScoped lock(send_critsect_.get());
1878 1878
1879 RtpState state; 1879 RtpState state;
1880 state.sequence_number = sequence_number_rtx_; 1880 state.sequence_number = sequence_number_rtx_;
1881 state.start_timestamp = start_timestamp_; 1881 state.start_timestamp = start_timestamp_;
1882 1882
1883 return state; 1883 return state;
1884 } 1884 }
1885 1885
1886 } // namespace webrtc 1886 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698