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

Side by Side Diff: webrtc/common_audio/wav_header.cc

Issue 1335923002: Add RTC_ prefix to (D)CHECKs and related macros. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rebase. Created 5 years, 3 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 | « webrtc/common_audio/wav_file.cc ('k') | webrtc/common_audio/window_generator.cc » ('j') | 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) 2014 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2014 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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 static inline uint16_t BlockAlign(int num_channels, int bytes_per_sample) { 144 static inline uint16_t BlockAlign(int num_channels, int bytes_per_sample) {
145 return num_channels * bytes_per_sample; 145 return num_channels * bytes_per_sample;
146 } 146 }
147 147
148 void WriteWavHeader(uint8_t* buf, 148 void WriteWavHeader(uint8_t* buf,
149 int num_channels, 149 int num_channels,
150 int sample_rate, 150 int sample_rate,
151 WavFormat format, 151 WavFormat format,
152 int bytes_per_sample, 152 int bytes_per_sample,
153 uint32_t num_samples) { 153 uint32_t num_samples) {
154 CHECK(CheckWavParameters(num_channels, sample_rate, format, 154 RTC_CHECK(CheckWavParameters(num_channels, sample_rate, format,
155 bytes_per_sample, num_samples)); 155 bytes_per_sample, num_samples));
156 156
157 WavHeader header; 157 WavHeader header;
158 const uint32_t bytes_in_payload = bytes_per_sample * num_samples; 158 const uint32_t bytes_in_payload = bytes_per_sample * num_samples;
159 159
160 WriteFourCC(&header.riff.header.ID, 'R', 'I', 'F', 'F'); 160 WriteFourCC(&header.riff.header.ID, 'R', 'I', 'F', 'F');
161 WriteLE32(&header.riff.header.Size, RiffChunkSize(bytes_in_payload)); 161 WriteLE32(&header.riff.header.Size, RiffChunkSize(bytes_in_payload));
162 WriteFourCC(&header.riff.Format, 'W', 'A', 'V', 'E'); 162 WriteFourCC(&header.riff.Format, 'W', 'A', 'V', 'E');
163 163
164 WriteFourCC(&header.fmt.header.ID, 'f', 'm', 't', ' '); 164 WriteFourCC(&header.fmt.header.ID, 'f', 'm', 't', ' ');
165 WriteLE32(&header.fmt.header.Size, kFmtSubchunkSize); 165 WriteLE32(&header.fmt.header.Size, kFmtSubchunkSize);
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 if (ReadLE16(header.fmt.BlockAlign) != 233 if (ReadLE16(header.fmt.BlockAlign) !=
234 BlockAlign(*num_channels, *bytes_per_sample)) 234 BlockAlign(*num_channels, *bytes_per_sample))
235 return false; 235 return false;
236 236
237 return CheckWavParameters(*num_channels, *sample_rate, *format, 237 return CheckWavParameters(*num_channels, *sample_rate, *format,
238 *bytes_per_sample, *num_samples); 238 *bytes_per_sample, *num_samples);
239 } 239 }
240 240
241 241
242 } // namespace webrtc 242 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/common_audio/wav_file.cc ('k') | webrtc/common_audio/window_generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698