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

Side by Side Diff: webrtc/common_audio/audio_converter.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
« no previous file with comments | « webrtc/call/call_perf_tests.cc ('k') | webrtc/common_audio/channel_buffer.h » ('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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 private: 102 private:
103 std::vector<std::unique_ptr<PushSincResampler>> resamplers_; 103 std::vector<std::unique_ptr<PushSincResampler>> resamplers_;
104 }; 104 };
105 105
106 // Apply a vector of converters in serial, in the order given. At least two 106 // Apply a vector of converters in serial, in the order given. At least two
107 // converters must be provided. 107 // converters must be provided.
108 class CompositionConverter : public AudioConverter { 108 class CompositionConverter : public AudioConverter {
109 public: 109 public:
110 CompositionConverter(std::vector<std::unique_ptr<AudioConverter>> converters) 110 CompositionConverter(std::vector<std::unique_ptr<AudioConverter>> converters)
111 : converters_(std::move(converters)) { 111 : converters_(std::move(converters)) {
112 RTC_CHECK_GE(converters_.size(), 2u); 112 RTC_CHECK_GE(converters_.size(), 2);
113 // We need an intermediate buffer after every converter. 113 // We need an intermediate buffer after every converter.
114 for (auto it = converters_.begin(); it != converters_.end() - 1; ++it) 114 for (auto it = converters_.begin(); it != converters_.end() - 1; ++it)
115 buffers_.push_back( 115 buffers_.push_back(
116 std::unique_ptr<ChannelBuffer<float>>(new ChannelBuffer<float>( 116 std::unique_ptr<ChannelBuffer<float>>(new ChannelBuffer<float>(
117 (*it)->dst_frames(), (*it)->dst_channels()))); 117 (*it)->dst_frames(), (*it)->dst_channels())));
118 } 118 }
119 ~CompositionConverter() override {}; 119 ~CompositionConverter() override {};
120 120
121 void Convert(const float* const* src, size_t src_size, float* const* dst, 121 void Convert(const float* const* src, size_t src_size, float* const* dst,
122 size_t dst_capacity) override { 122 size_t dst_capacity) override {
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 RTC_CHECK(dst_channels == src_channels || dst_channels == 1 || 197 RTC_CHECK(dst_channels == src_channels || dst_channels == 1 ||
198 src_channels == 1); 198 src_channels == 1);
199 } 199 }
200 200
201 void AudioConverter::CheckSizes(size_t src_size, size_t dst_capacity) const { 201 void AudioConverter::CheckSizes(size_t src_size, size_t dst_capacity) const {
202 RTC_CHECK_EQ(src_size, src_channels() * src_frames()); 202 RTC_CHECK_EQ(src_size, src_channels() * src_frames());
203 RTC_CHECK_GE(dst_capacity, dst_channels() * dst_frames()); 203 RTC_CHECK_GE(dst_capacity, dst_channels() * dst_frames());
204 } 204 }
205 205
206 } // namespace webrtc 206 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/call/call_perf_tests.cc ('k') | webrtc/common_audio/channel_buffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698