| 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 <utility> | 14 #include <utility> |
| 15 | 15 |
| 16 #include "webrtc/base/checks.h" | 16 #include "webrtc/base/checks.h" |
| 17 #include "webrtc/base/safe_conversions.h" | 17 #include "webrtc/base/numerics/safe_conversions.h" |
| 18 #include "webrtc/common_audio/channel_buffer.h" | 18 #include "webrtc/common_audio/channel_buffer.h" |
| 19 #include "webrtc/common_audio/resampler/push_sinc_resampler.h" | 19 #include "webrtc/common_audio/resampler/push_sinc_resampler.h" |
| 20 #include "webrtc/system_wrappers/include/scoped_vector.h" | 20 #include "webrtc/system_wrappers/include/scoped_vector.h" |
| 21 | 21 |
| 22 using rtc::checked_cast; | 22 using rtc::checked_cast; |
| 23 | 23 |
| 24 namespace webrtc { | 24 namespace webrtc { |
| 25 | 25 |
| 26 class CopyConverter : public AudioConverter { | 26 class CopyConverter : public AudioConverter { |
| 27 public: | 27 public: |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 RTC_CHECK(dst_channels == src_channels || dst_channels == 1 || | 192 RTC_CHECK(dst_channels == src_channels || dst_channels == 1 || |
| 193 src_channels == 1); | 193 src_channels == 1); |
| 194 } | 194 } |
| 195 | 195 |
| 196 void AudioConverter::CheckSizes(size_t src_size, size_t dst_capacity) const { | 196 void AudioConverter::CheckSizes(size_t src_size, size_t dst_capacity) const { |
| 197 RTC_CHECK_EQ(src_size, src_channels() * src_frames()); | 197 RTC_CHECK_EQ(src_size, src_channels() * src_frames()); |
| 198 RTC_CHECK_GE(dst_capacity, dst_channels() * dst_frames()); | 198 RTC_CHECK_GE(dst_capacity, dst_channels() * dst_frames()); |
| 199 } | 199 } |
| 200 | 200 |
| 201 } // namespace webrtc | 201 } // namespace webrtc |
| OLD | NEW |