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

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

Issue 259453003: Introduce AudioDiscardHelper. Refactor audio decoders to use it. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix x64 type. Created 6 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | media/base/audio_discard_helper.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « no previous file | media/base/audio_discard_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698