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

Side by Side Diff: webrtc/test/layer_filtering_transport.cc

Issue 2534683002: RTC_[D]CHECK_op: Remove superfluous casts (Closed)
Patch Set: test Created 4 years 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) 2015 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2015 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 if (selected_tl_ == -1 && selected_sl_ == -1) { 44 if (selected_tl_ == -1 && selected_sl_ == -1) {
45 // Nothing to change, forward the packet immediately. 45 // Nothing to change, forward the packet immediately.
46 return test::DirectTransport::SendRtp(packet, length, options); 46 return test::DirectTransport::SendRtp(packet, length, options);
47 } 47 }
48 48
49 bool set_marker_bit = false; 49 bool set_marker_bit = false;
50 RtpUtility::RtpHeaderParser parser(packet, length); 50 RtpUtility::RtpHeaderParser parser(packet, length);
51 RTPHeader header; 51 RTPHeader header;
52 parser.Parse(&header); 52 parser.Parse(&header);
53 53
54 RTC_DCHECK_LE(length, static_cast<size_t>(IP_PACKET_SIZE)); 54 RTC_DCHECK_LE(length, IP_PACKET_SIZE);
55 uint8_t temp_buffer[IP_PACKET_SIZE]; 55 uint8_t temp_buffer[IP_PACKET_SIZE];
56 memcpy(temp_buffer, packet, length); 56 memcpy(temp_buffer, packet, length);
57 57
58 if (header.payloadType == vp8_video_payload_type_ || 58 if (header.payloadType == vp8_video_payload_type_ ||
59 header.payloadType == vp9_video_payload_type_) { 59 header.payloadType == vp9_video_payload_type_) {
60 const uint8_t* payload = packet + header.headerLength; 60 const uint8_t* payload = packet + header.headerLength;
61 RTC_DCHECK_GT(length, header.headerLength); 61 RTC_DCHECK_GT(length, header.headerLength);
62 const size_t payload_length = length - header.headerLength; 62 const size_t payload_length = length - header.headerLength;
63 RTC_DCHECK_GT(payload_length, header.paddingLength); 63 RTC_DCHECK_GT(payload_length, header.paddingLength);
64 const size_t payload_data_length = payload_length - header.paddingLength; 64 const size_t payload_data_length = payload_length - header.paddingLength;
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 // make sure the marker bit is set properly, and that sequence numbers are 98 // make sure the marker bit is set properly, and that sequence numbers are
99 // continuous. 99 // continuous.
100 if (set_marker_bit) 100 if (set_marker_bit)
101 temp_buffer[1] |= kRtpMarkerBitMask; 101 temp_buffer[1] |= kRtpMarkerBitMask;
102 102
103 return test::DirectTransport::SendRtp(temp_buffer, length, options); 103 return test::DirectTransport::SendRtp(temp_buffer, length, options);
104 } 104 }
105 105
106 } // namespace test 106 } // namespace test
107 } // namespace webrtc 107 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698