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

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

Issue 2683033004: Enable cpplint and fix cpplint errors in webrtc/*audio (Closed)
Patch Set: Rebase Created 3 years, 9 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/blocker.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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 } 100 }
101 101
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 explicit CompositionConverter(
111 std::vector<std::unique_ptr<AudioConverter>> converters)
111 : converters_(std::move(converters)) { 112 : converters_(std::move(converters)) {
112 RTC_CHECK_GE(converters_.size(), 2); 113 RTC_CHECK_GE(converters_.size(), 2);
113 // We need an intermediate buffer after every converter. 114 // We need an intermediate buffer after every converter.
114 for (auto it = converters_.begin(); it != converters_.end() - 1; ++it) 115 for (auto it = converters_.begin(); it != converters_.end() - 1; ++it)
115 buffers_.push_back( 116 buffers_.push_back(
116 std::unique_ptr<ChannelBuffer<float>>(new ChannelBuffer<float>( 117 std::unique_ptr<ChannelBuffer<float>>(new ChannelBuffer<float>(
117 (*it)->dst_frames(), (*it)->dst_channels()))); 118 (*it)->dst_frames(), (*it)->dst_channels())));
118 } 119 }
119 ~CompositionConverter() override {}; 120 ~CompositionConverter() override {};
120 121
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 RTC_CHECK(dst_channels == src_channels || dst_channels == 1 || 198 RTC_CHECK(dst_channels == src_channels || dst_channels == 1 ||
198 src_channels == 1); 199 src_channels == 1);
199 } 200 }
200 201
201 void AudioConverter::CheckSizes(size_t src_size, size_t dst_capacity) const { 202 void AudioConverter::CheckSizes(size_t src_size, size_t dst_capacity) const {
202 RTC_CHECK_EQ(src_size, src_channels() * src_frames()); 203 RTC_CHECK_EQ(src_size, src_channels() * src_frames());
203 RTC_CHECK_GE(dst_capacity, dst_channels() * dst_frames()); 204 RTC_CHECK_GE(dst_capacity, dst_channels() * dst_frames());
204 } 205 }
205 206
206 } // namespace webrtc 207 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/common_audio/audio_converter.h ('k') | webrtc/common_audio/blocker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698