OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_BUFFER_H_ | 5 #ifndef MEDIA_BASE_AUDIO_BUFFER_H_ |
6 #define MEDIA_BASE_AUDIO_BUFFER_H_ | 6 #define MEDIA_BASE_AUDIO_BUFFER_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/memory/aligned_memory.h" | 10 #include "base/memory/aligned_memory.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
66 // Copy frames into |dest|. |frames_to_copy| is the number of frames to copy. | 66 // Copy frames into |dest|. |frames_to_copy| is the number of frames to copy. |
67 // |source_frame_offset| specifies how many frames in the buffer to skip | 67 // |source_frame_offset| specifies how many frames in the buffer to skip |
68 // first. |dest_frame_offset| is the frame offset in |dest|. The frames are | 68 // first. |dest_frame_offset| is the frame offset in |dest|. The frames are |
69 // converted from their source format into planar float32 data (which is all | 69 // converted from their source format into planar float32 data (which is all |
70 // that AudioBus handles). | 70 // that AudioBus handles). |
71 void ReadFrames(int frames_to_copy, | 71 void ReadFrames(int frames_to_copy, |
72 int source_frame_offset, | 72 int source_frame_offset, |
73 int dest_frame_offset, | 73 int dest_frame_offset, |
74 AudioBus* dest); | 74 AudioBus* dest); |
75 | 75 |
76 // Copy frames into |std::vector<int32>|. The frames are converted from their | |
77 // source format into planar int32; note that while each frame use 32 bits | |
78 // each fame is actually PCM signed 24-bit little-endian. | |
79 std::vector<int32> ReadFrames(); | |
DaleCurtis
2014/09/24 22:30:17
We don't have a SampleFormat for planar 24 bit, on
| |
80 | |
76 // Trim an AudioBuffer by removing |frames_to_trim| frames from the start. | 81 // Trim an AudioBuffer by removing |frames_to_trim| frames from the start. |
77 // Timestamp and duration are adjusted to reflect the fewer frames. | 82 // Timestamp and duration are adjusted to reflect the fewer frames. |
78 // Note that repeated calls to TrimStart() may result in timestamp() and | 83 // Note that repeated calls to TrimStart() may result in timestamp() and |
79 // duration() being off by a few microseconds due to rounding issues. | 84 // duration() being off by a few microseconds due to rounding issues. |
80 void TrimStart(int frames_to_trim); | 85 void TrimStart(int frames_to_trim); |
81 | 86 |
82 // Trim an AudioBuffer by removing |frames_to_trim| frames from the end. | 87 // Trim an AudioBuffer by removing |frames_to_trim| frames from the end. |
83 // Duration is adjusted to reflect the fewer frames. | 88 // Duration is adjusted to reflect the fewer frames. |
84 void TrimEnd(int frames_to_trim); | 89 void TrimEnd(int frames_to_trim); |
85 | 90 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
144 | 149 |
145 // For planar data, points to each channels data. | 150 // For planar data, points to each channels data. |
146 std::vector<uint8*> channel_data_; | 151 std::vector<uint8*> channel_data_; |
147 | 152 |
148 DISALLOW_IMPLICIT_CONSTRUCTORS(AudioBuffer); | 153 DISALLOW_IMPLICIT_CONSTRUCTORS(AudioBuffer); |
149 }; | 154 }; |
150 | 155 |
151 } // namespace media | 156 } // namespace media |
152 | 157 |
153 #endif // MEDIA_BASE_AUDIO_BUFFER_H_ | 158 #endif // MEDIA_BASE_AUDIO_BUFFER_H_ |
OLD | NEW |