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

Side by Side Diff: webrtc/common_audio/audio_converter.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/audio_converter.h ('k') | webrtc/common_audio/audio_ring_buffer.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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 private: 99 private:
100 ScopedVector<PushSincResampler> resamplers_; 100 ScopedVector<PushSincResampler> resamplers_;
101 }; 101 };
102 102
103 // Apply a vector of converters in serial, in the order given. At least two 103 // Apply a vector of converters in serial, in the order given. At least two
104 // converters must be provided. 104 // converters must be provided.
105 class CompositionConverter : public AudioConverter { 105 class CompositionConverter : public AudioConverter {
106 public: 106 public:
107 CompositionConverter(ScopedVector<AudioConverter> converters) 107 CompositionConverter(ScopedVector<AudioConverter> converters)
108 : converters_(converters.Pass()) { 108 : converters_(converters.Pass()) {
109 CHECK_GE(converters_.size(), 2u); 109 RTC_CHECK_GE(converters_.size(), 2u);
110 // We need an intermediate buffer after every converter. 110 // We need an intermediate buffer after every converter.
111 for (auto it = converters_.begin(); it != converters_.end() - 1; ++it) 111 for (auto it = converters_.begin(); it != converters_.end() - 1; ++it)
112 buffers_.push_back(new ChannelBuffer<float>((*it)->dst_frames(), 112 buffers_.push_back(new ChannelBuffer<float>((*it)->dst_frames(),
113 (*it)->dst_channels())); 113 (*it)->dst_channels()));
114 } 114 }
115 ~CompositionConverter() override {}; 115 ~CompositionConverter() override {};
116 116
117 void Convert(const float* const* src, size_t src_size, float* const* dst, 117 void Convert(const float* const* src, size_t src_size, float* const* dst,
118 size_t dst_capacity) override { 118 size_t dst_capacity) override {
119 converters_.front()->Convert(src, src_size, buffers_.front()->channels(), 119 converters_.front()->Convert(src, src_size, buffers_.front()->channels(),
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 src_frames_(0), 181 src_frames_(0),
182 dst_channels_(0), 182 dst_channels_(0),
183 dst_frames_(0) {} 183 dst_frames_(0) {}
184 184
185 AudioConverter::AudioConverter(int src_channels, size_t src_frames, 185 AudioConverter::AudioConverter(int src_channels, size_t src_frames,
186 int dst_channels, size_t dst_frames) 186 int dst_channels, size_t dst_frames)
187 : src_channels_(src_channels), 187 : src_channels_(src_channels),
188 src_frames_(src_frames), 188 src_frames_(src_frames),
189 dst_channels_(dst_channels), 189 dst_channels_(dst_channels),
190 dst_frames_(dst_frames) { 190 dst_frames_(dst_frames) {
191 CHECK(dst_channels == src_channels || dst_channels == 1 || src_channels == 1); 191 RTC_CHECK(dst_channels == src_channels || dst_channels == 1 ||
192 src_channels == 1);
192 } 193 }
193 194
194 void AudioConverter::CheckSizes(size_t src_size, size_t dst_capacity) const { 195 void AudioConverter::CheckSizes(size_t src_size, size_t dst_capacity) const {
195 CHECK_EQ(src_size, src_channels() * src_frames()); 196 RTC_CHECK_EQ(src_size, src_channels() * src_frames());
196 CHECK_GE(dst_capacity, dst_channels() * dst_frames()); 197 RTC_CHECK_GE(dst_capacity, dst_channels() * dst_frames());
197 } 198 }
198 199
199 } // namespace webrtc 200 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/common_audio/audio_converter.h ('k') | webrtc/common_audio/audio_ring_buffer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698