OLD | NEW |
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 |
11 #include "webrtc/common_audio/audio_converter.h" | 11 #include "webrtc/common_audio/audio_converter.h" |
12 | 12 |
13 #include <cstring> | 13 #include <cstring> |
14 #include <memory> | 14 #include <memory> |
15 #include <utility> | 15 #include <utility> |
16 #include <vector> | 16 #include <vector> |
17 | 17 |
18 #include "webrtc/base/checks.h" | |
19 #include "webrtc/base/safe_conversions.h" | |
20 #include "webrtc/common_audio/channel_buffer.h" | 18 #include "webrtc/common_audio/channel_buffer.h" |
21 #include "webrtc/common_audio/resampler/push_sinc_resampler.h" | 19 #include "webrtc/common_audio/resampler/push_sinc_resampler.h" |
| 20 #include "webrtc/rtc_base/checks.h" |
| 21 #include "webrtc/rtc_base/safe_conversions.h" |
22 | 22 |
23 using rtc::checked_cast; | 23 using rtc::checked_cast; |
24 | 24 |
25 namespace webrtc { | 25 namespace webrtc { |
26 | 26 |
27 class CopyConverter : public AudioConverter { | 27 class CopyConverter : public AudioConverter { |
28 public: | 28 public: |
29 CopyConverter(size_t src_channels, size_t src_frames, size_t dst_channels, | 29 CopyConverter(size_t src_channels, size_t src_frames, size_t dst_channels, |
30 size_t dst_frames) | 30 size_t dst_frames) |
31 : AudioConverter(src_channels, src_frames, dst_channels, dst_frames) {} | 31 : AudioConverter(src_channels, src_frames, dst_channels, dst_frames) {} |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 RTC_CHECK(dst_channels == src_channels || dst_channels == 1 || | 198 RTC_CHECK(dst_channels == src_channels || dst_channels == 1 || |
199 src_channels == 1); | 199 src_channels == 1); |
200 } | 200 } |
201 | 201 |
202 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 { |
203 RTC_CHECK_EQ(src_size, src_channels() * src_frames()); | 203 RTC_CHECK_EQ(src_size, src_channels() * src_frames()); |
204 RTC_CHECK_GE(dst_capacity, dst_channels() * dst_frames()); | 204 RTC_CHECK_GE(dst_capacity, dst_channels() * dst_frames()); |
205 } | 205 } |
206 | 206 |
207 } // namespace webrtc | 207 } // namespace webrtc |
OLD | NEW |