OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef MEDIA_BASE_AUDIO_BUS_H_ | 5 #ifndef MEDIA_BASE_AUDIO_BUS_H_ |
6 #define MEDIA_BASE_AUDIO_BUS_H_ | 6 #define MEDIA_BASE_AUDIO_BUS_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <vector> | 10 #include <vector> |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 | 59 |
60 // Helper methods for converting an AudioBus from and to interleaved integer | 60 // Helper methods for converting an AudioBus from and to interleaved integer |
61 // data. Expects interleaving to be [ch0, ch1, ..., chN, ch0, ch1, ...] with | 61 // data. Expects interleaving to be [ch0, ch1, ..., chN, ch0, ch1, ...] with |
62 // |bytes_per_sample| per value. Values are scaled and bias corrected during | 62 // |bytes_per_sample| per value. Values are scaled and bias corrected during |
63 // conversion. ToInterleaved() will also clip values to format range. | 63 // conversion. ToInterleaved() will also clip values to format range. |
64 // Handles uint8_t, int16_t, and int32_t currently. FromInterleaved() will | 64 // Handles uint8_t, int16_t, and int32_t currently. FromInterleaved() will |
65 // zero out | 65 // zero out |
66 // any unfilled frames when |frames| is less than frames(). | 66 // any unfilled frames when |frames| is less than frames(). |
67 void FromInterleaved(const void* source, int frames, int bytes_per_sample); | 67 void FromInterleaved(const void* source, int frames, int bytes_per_sample); |
68 void ToInterleaved(int frames, int bytes_per_sample, void* dest) const; | 68 void ToInterleaved(int frames, int bytes_per_sample, void* dest) const; |
| 69 void ToInterleavedFloat(int source_offset, |
| 70 int destination_offset, |
| 71 int num_samples, |
| 72 int num_channels, |
| 73 float* buffer) const; |
69 void ToInterleavedPartial(int start_frame, int frames, int bytes_per_sample, | 74 void ToInterleavedPartial(int start_frame, int frames, int bytes_per_sample, |
70 void* dest) const; | 75 void* dest) const; |
71 | 76 |
72 // Similar to FromInterleaved() above, but meant for streaming sources. Does | 77 // Similar to FromInterleaved() above, but meant for streaming sources. Does |
73 // not zero out remaining frames, the caller is responsible for doing so using | 78 // not zero out remaining frames, the caller is responsible for doing so using |
74 // ZeroFramesPartial(). Frames are deinterleaved from the start of |source| | 79 // ZeroFramesPartial(). Frames are deinterleaved from the start of |source| |
75 // to channel(x)[start_frame]. | 80 // to channel(x)[start_frame]. |
76 void FromInterleavedPartial(const void* source, int start_frame, int frames, | 81 void FromInterleavedPartial(const void* source, int start_frame, int frames, |
77 int bytes_per_sample); | 82 int bytes_per_sample); |
78 | 83 |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 | 160 |
156 AudioBusRefCounted(int channels, int frames); | 161 AudioBusRefCounted(int channels, int frames); |
157 ~AudioBusRefCounted() override; | 162 ~AudioBusRefCounted() override; |
158 | 163 |
159 DISALLOW_COPY_AND_ASSIGN(AudioBusRefCounted); | 164 DISALLOW_COPY_AND_ASSIGN(AudioBusRefCounted); |
160 }; | 165 }; |
161 | 166 |
162 } // namespace media | 167 } // namespace media |
163 | 168 |
164 #endif // MEDIA_BASE_AUDIO_BUS_H_ | 169 #endif // MEDIA_BASE_AUDIO_BUS_H_ |
OLD | NEW |