Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(172)

Side by Side Diff: media/base/audio_bus.h

Issue 2024993004: AudioBus: Add a ToInterleavedFloat() method to AudioBus (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <memory> 10 #include <memory>
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 62
63 // Helper methods for converting an AudioBus from and to interleaved integer 63 // Helper methods for converting an AudioBus from and to interleaved integer
64 // data. Expects interleaving to be [ch0, ch1, ..., chN, ch0, ch1, ...] with 64 // data. Expects interleaving to be [ch0, ch1, ..., chN, ch0, ch1, ...] with
65 // |bytes_per_sample| per value. Values are scaled and bias corrected during 65 // |bytes_per_sample| per value. Values are scaled and bias corrected during
66 // conversion. ToInterleaved() will also clip values to format range. 66 // conversion. ToInterleaved() will also clip values to format range.
67 // Handles uint8_t, int16_t, and int32_t currently. FromInterleaved() will 67 // Handles uint8_t, int16_t, and int32_t currently. FromInterleaved() will
68 // zero out 68 // zero out
69 // any unfilled frames when |frames| is less than frames(). 69 // any unfilled frames when |frames| is less than frames().
70 void FromInterleaved(const void* source, int frames, int bytes_per_sample); 70 void FromInterleaved(const void* source, int frames, int bytes_per_sample);
71 void ToInterleaved(int frames, int bytes_per_sample, void* dest) const; 71 void ToInterleaved(int frames, int bytes_per_sample, void* dest) const;
72 void ToInterleavedFloat(int source_offset,
73 int destination_offset,
74 int num_channels,
75 float* buffer) const;
72 void ToInterleavedPartial(int start_frame, int frames, int bytes_per_sample, 76 void ToInterleavedPartial(int start_frame, int frames, int bytes_per_sample,
73 void* dest) const; 77 void* dest) const;
74 78
75 // Similar to FromInterleaved() above, but meant for streaming sources. Does 79 // Similar to FromInterleaved() above, but meant for streaming sources. Does
76 // not zero out remaining frames, the caller is responsible for doing so using 80 // not zero out remaining frames, the caller is responsible for doing so using
77 // ZeroFramesPartial(). Frames are deinterleaved from the start of |source| 81 // ZeroFramesPartial(). Frames are deinterleaved from the start of |source|
78 // to channel(x)[start_frame]. 82 // to channel(x)[start_frame].
79 void FromInterleavedPartial(const void* source, int start_frame, int frames, 83 void FromInterleavedPartial(const void* source, int start_frame, int frames,
80 int bytes_per_sample); 84 int bytes_per_sample);
81 85
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 162
159 AudioBusRefCounted(int channels, int frames); 163 AudioBusRefCounted(int channels, int frames);
160 ~AudioBusRefCounted() override; 164 ~AudioBusRefCounted() override;
161 165
162 DISALLOW_COPY_AND_ASSIGN(AudioBusRefCounted); 166 DISALLOW_COPY_AND_ASSIGN(AudioBusRefCounted);
163 }; 167 };
164 168
165 } // namespace media 169 } // namespace media
166 170
167 #endif // MEDIA_BASE_AUDIO_BUS_H_ 171 #endif // MEDIA_BASE_AUDIO_BUS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698