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

Side by Side Diff: webrtc/modules/audio_coding/neteq/tools/encode_neteq_input.cc

Issue 2535593002: RTC_[D]CHECK_op: Remove "u" suffix on integer constants (Closed)
Patch Set: 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) 2016 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2016 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 52
53 rtc::Optional<RTPHeader> EncodeNetEqInput::NextHeader() const { 53 rtc::Optional<RTPHeader> EncodeNetEqInput::NextHeader() const {
54 RTC_DCHECK(packet_data_); 54 RTC_DCHECK(packet_data_);
55 return rtc::Optional<RTPHeader>(packet_data_->header.header); 55 return rtc::Optional<RTPHeader>(packet_data_->header.header);
56 } 56 }
57 57
58 void EncodeNetEqInput::CreatePacket() { 58 void EncodeNetEqInput::CreatePacket() {
59 // Create a new PacketData object. 59 // Create a new PacketData object.
60 RTC_DCHECK(!packet_data_); 60 RTC_DCHECK(!packet_data_);
61 packet_data_.reset(new NetEqInput::PacketData); 61 packet_data_.reset(new NetEqInput::PacketData);
62 RTC_DCHECK_EQ(packet_data_->payload.size(), 0u); 62 RTC_DCHECK_EQ(packet_data_->payload.size(), 0);
63 63
64 // Loop until we get a packet. 64 // Loop until we get a packet.
65 AudioEncoder::EncodedInfo info; 65 AudioEncoder::EncodedInfo info;
66 RTC_DCHECK(!info.send_even_if_empty); 66 RTC_DCHECK(!info.send_even_if_empty);
67 int num_blocks = 0; 67 int num_blocks = 0;
68 while (packet_data_->payload.size() == 0 && !info.send_even_if_empty) { 68 while (packet_data_->payload.size() == 0 && !info.send_even_if_empty) {
69 const size_t num_samples = rtc::CheckedDivExact( 69 const size_t num_samples = rtc::CheckedDivExact(
70 static_cast<int>(encoder_->SampleRateHz() * kOutputPeriodMs), 1000); 70 static_cast<int>(encoder_->SampleRateHz() * kOutputPeriodMs), 1000);
71 71
72 info = encoder_->Encode(rtp_timestamp_, generator_->Generate(num_samples), 72 info = encoder_->Encode(rtp_timestamp_, generator_->Generate(num_samples),
73 &packet_data_->payload); 73 &packet_data_->payload);
74 74
75 rtp_timestamp_ += rtc::checked_cast<uint32_t>( 75 rtp_timestamp_ += rtc::checked_cast<uint32_t>(
76 num_samples * encoder_->RtpTimestampRateHz() / 76 num_samples * encoder_->RtpTimestampRateHz() /
77 encoder_->SampleRateHz()); 77 encoder_->SampleRateHz());
78 ++num_blocks; 78 ++num_blocks;
79 } 79 }
80 packet_data_->header.header.timestamp = info.encoded_timestamp; 80 packet_data_->header.header.timestamp = info.encoded_timestamp;
81 packet_data_->header.header.payloadType = info.payload_type; 81 packet_data_->header.header.payloadType = info.payload_type;
82 packet_data_->header.header.sequenceNumber = sequence_number_++; 82 packet_data_->header.header.sequenceNumber = sequence_number_++;
83 packet_data_->time_ms = next_packet_time_ms_; 83 packet_data_->time_ms = next_packet_time_ms_;
84 next_packet_time_ms_ += num_blocks * kOutputPeriodMs; 84 next_packet_time_ms_ += num_blocks * kOutputPeriodMs;
85 } 85 }
86 86
87 } // namespace test 87 } // namespace test
88 } // namespace webrtc 88 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/audio_coding/neteq/test/RTPencode.cc ('k') | webrtc/modules/audio_coding/neteq/tools/fake_decode_from_file.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698