| 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 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 // The source and destination chunks have the same duration in time; specifying | 24 // The source and destination chunks have the same duration in time; specifying |
| 25 // the number of frames is equivalent to specifying the sample rates. | 25 // the number of frames is equivalent to specifying the sample rates. |
| 26 class AudioConverter { | 26 class AudioConverter { |
| 27 public: | 27 public: |
| 28 // Returns a new AudioConverter, which will use the supplied format for its | 28 // Returns a new AudioConverter, which will use the supplied format for its |
| 29 // lifetime. Caller is responsible for the memory. | 29 // lifetime. Caller is responsible for the memory. |
| 30 static std::unique_ptr<AudioConverter> Create(size_t src_channels, | 30 static std::unique_ptr<AudioConverter> Create(size_t src_channels, |
| 31 size_t src_frames, | 31 size_t src_frames, |
| 32 size_t dst_channels, | 32 size_t dst_channels, |
| 33 size_t dst_frames); | 33 size_t dst_frames); |
| 34 virtual ~AudioConverter() {}; | 34 virtual ~AudioConverter() {} |
| 35 | 35 |
| 36 // Convert |src|, containing |src_size| samples, to |dst|, having a sample | 36 // Convert |src|, containing |src_size| samples, to |dst|, having a sample |
| 37 // capacity of |dst_capacity|. Both point to a series of buffers containing | 37 // capacity of |dst_capacity|. Both point to a series of buffers containing |
| 38 // the samples for each channel. The sizes must correspond to the format | 38 // the samples for each channel. The sizes must correspond to the format |
| 39 // passed to Create(). | 39 // passed to Create(). |
| 40 virtual void Convert(const float* const* src, size_t src_size, | 40 virtual void Convert(const float* const* src, size_t src_size, |
| 41 float* const* dst, size_t dst_capacity) = 0; | 41 float* const* dst, size_t dst_capacity) = 0; |
| 42 | 42 |
| 43 size_t src_channels() const { return src_channels_; } | 43 size_t src_channels() const { return src_channels_; } |
| 44 size_t src_frames() const { return src_frames_; } | 44 size_t src_frames() const { return src_frames_; } |
| (...skipping 13 matching lines...) Expand all Loading... |
| 58 const size_t src_frames_; | 58 const size_t src_frames_; |
| 59 const size_t dst_channels_; | 59 const size_t dst_channels_; |
| 60 const size_t dst_frames_; | 60 const size_t dst_frames_; |
| 61 | 61 |
| 62 RTC_DISALLOW_COPY_AND_ASSIGN(AudioConverter); | 62 RTC_DISALLOW_COPY_AND_ASSIGN(AudioConverter); |
| 63 }; | 63 }; |
| 64 | 64 |
| 65 } // namespace webrtc | 65 } // namespace webrtc |
| 66 | 66 |
| 67 #endif // WEBRTC_COMMON_AUDIO_AUDIO_CONVERTER_H_ | 67 #endif // WEBRTC_COMMON_AUDIO_AUDIO_CONVERTER_H_ |
| OLD | NEW |