OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_AUDIO_AUDIO_UTIL_H_ | 5 #ifndef MEDIA_AUDIO_AUDIO_UTIL_H_ |
6 #define MEDIA_AUDIO_AUDIO_UTIL_H_ | 6 #define MEDIA_AUDIO_AUDIO_UTIL_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 | 9 |
10 namespace media { | 10 namespace media { |
11 | 11 |
(...skipping 30 matching lines...) Expand all Loading... |
42 // since clamping is performed a value of more than 1 is allowed to increase | 42 // since clamping is performed a value of more than 1 is allowed to increase |
43 // volume. | 43 // volume. |
44 // The buffer is modified in-place to avoid memory management, as this | 44 // The buffer is modified in-place to avoid memory management, as this |
45 // function may be called in performance critical code. | 45 // function may be called in performance critical code. |
46 bool FoldChannels(void* buf, | 46 bool FoldChannels(void* buf, |
47 size_t buflen, | 47 size_t buflen, |
48 int channels, | 48 int channels, |
49 int bytes_per_sample, | 49 int bytes_per_sample, |
50 float volume); | 50 float volume); |
51 | 51 |
| 52 // DeinterleaveAudioChannel() takes interleaved audio buffer |source| |
| 53 // of the given |sample_fmt| and |number_of_channels| and extracts |
| 54 // |number_of_frames| data for the given |channel_index| and |
| 55 // puts it in the floating point |destination|. |
| 56 // It returns |true| on success, or |false| if the |sample_fmt| is |
| 57 // not recognized. |
| 58 bool DeinterleaveAudioChannel(void* source, |
| 59 float* destination, |
| 60 int channels, |
| 61 int channel_index, |
| 62 int bytes_per_sample, |
| 63 size_t number_of_frames); |
| 64 |
52 } // namespace media | 65 } // namespace media |
53 | 66 |
54 #endif // MEDIA_AUDIO_AUDIO_UTIL_H_ | 67 #endif // MEDIA_AUDIO_AUDIO_UTIL_H_ |
OLD | NEW |