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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 | 92 |
93 // Return the number of frames held. | 93 // Return the number of frames held. |
94 int frame_count() const { return adjusted_frame_count_; } | 94 int frame_count() const { return adjusted_frame_count_; } |
95 | 95 |
96 // Return the sample rate. | 96 // Return the sample rate. |
97 int sample_rate() const { return sample_rate_; } | 97 int sample_rate() const { return sample_rate_; } |
98 | 98 |
99 // Return the channel layout. | 99 // Return the channel layout. |
100 ChannelLayout channel_layout() const { return channel_layout_; } | 100 ChannelLayout channel_layout() const { return channel_layout_; } |
101 | 101 |
102 // Access to constructor parameters. | |
103 base::TimeDelta timestamp() const { return timestamp_; } | 102 base::TimeDelta timestamp() const { return timestamp_; } |
104 base::TimeDelta duration() const { return duration_; } | 103 base::TimeDelta duration() const { return duration_; } |
105 | |
106 // TODO(jrummell): Remove set_timestamp() and set_duration() once | |
107 // DecryptingAudioDecoder::EnqueueFrames() is changed to set them when | |
108 // creating the buffer. See http://crbug.com/255261. | |
109 void set_timestamp(base::TimeDelta timestamp) { timestamp_ = timestamp; } | 104 void set_timestamp(base::TimeDelta timestamp) { timestamp_ = timestamp; } |
110 void set_duration(base::TimeDelta duration) { duration_ = duration; } | 105 void set_duration(base::TimeDelta duration) { duration_ = duration; } |
111 | 106 |
112 // If there's no data in this buffer, it represents end of stream. | 107 // If there's no data in this buffer, it represents end of stream. |
113 bool end_of_stream() const { return end_of_stream_; } | 108 bool end_of_stream() const { return end_of_stream_; } |
114 | 109 |
115 // Access to the raw buffer for ffmpeg to write directly to. Data for planar | 110 // Access to the raw buffer for ffmpeg to write directly to. Data for planar |
116 // data is grouped by channel. There is only 1 entry for interleaved formats. | 111 // data is grouped by channel. There is only 1 entry for interleaved formats. |
117 const std::vector<uint8*>& channel_data() const { return channel_data_; } | 112 const std::vector<uint8*>& channel_data() const { return channel_data_; } |
118 | 113 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 | 146 |
152 // For planar data, points to each channels data. | 147 // For planar data, points to each channels data. |
153 std::vector<uint8*> channel_data_; | 148 std::vector<uint8*> channel_data_; |
154 | 149 |
155 DISALLOW_IMPLICIT_CONSTRUCTORS(AudioBuffer); | 150 DISALLOW_IMPLICIT_CONSTRUCTORS(AudioBuffer); |
156 }; | 151 }; |
157 | 152 |
158 } // namespace media | 153 } // namespace media |
159 | 154 |
160 #endif // MEDIA_BASE_AUDIO_BUFFER_H_ | 155 #endif // MEDIA_BASE_AUDIO_BUFFER_H_ |
OLD | NEW |