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

Side by Side Diff: media/filters/audio_renderer_impl.h

Issue 11183048: Miscellaneous AudioRendererImpl cleanup salvaged from http://codereview.chromium.org/10918022/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 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/filters/audio_renderer_impl.cc » ('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 (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 // Audio rendering unit utilizing an AudioRendererSink to output data. 5 // Audio rendering unit utilizing an AudioRendererSink to output data.
6 // 6 //
7 // This class lives inside three threads during it's lifetime, namely: 7 // This class lives inside three threads during it's lifetime, namely:
8 // 1. Render thread. 8 // 1. Render thread.
9 // This object is created on the render thread. 9 // This object is created on the render thread.
10 // 2. Pipeline thread 10 // 2. Pipeline thread
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 base::Closure underflow_cb_; 190 base::Closure underflow_cb_;
191 TimeCB time_cb_; 191 TimeCB time_cb_;
192 base::Closure ended_cb_; 192 base::Closure ended_cb_;
193 base::Closure disabled_cb_; 193 base::Closure disabled_cb_;
194 PipelineStatusCB error_cb_; 194 PipelineStatusCB error_cb_;
195 195
196 base::TimeDelta preroll_timestamp_; 196 base::TimeDelta preroll_timestamp_;
197 197
198 uint32 bytes_per_frame_; 198 uint32 bytes_per_frame_;
199 199
200 // Used to calculate audio delay given bytes.
201 uint32 bytes_per_second_;
202
203 // A flag that indicates this filter is called to stop. 200 // A flag that indicates this filter is called to stop.
204 bool stopped_; 201 bool stopped_;
205 202
206 // The sink (destination) for rendered audio. 203 // The sink (destination) for rendered audio.
207 scoped_refptr<media::AudioRendererSink> sink_; 204 scoped_refptr<media::AudioRendererSink> sink_;
208 205
209 // Set to true when OnInitialize() is called.
210 bool is_initialized_;
211
212 // We're supposed to know amount of audio data OS or hardware buffered, but 206 // We're supposed to know amount of audio data OS or hardware buffered, but
213 // that is not always so -- on my Linux box 207 // that is not always so -- on my Linux box
214 // AudioBuffersState::hardware_delay_bytes never reaches 0. 208 // AudioBuffersState::hardware_delay_bytes never reaches 0.
215 // 209 //
216 // As a result we cannot use it to find when stream ends. If we just ignore 210 // As a result we cannot use it to find when stream ends. If we just ignore
217 // buffered data we will notify host that stream ended before it is actually 211 // buffered data we will notify host that stream ended before it is actually
218 // did so, I've seen it done ~140ms too early when playing ~150ms file. 212 // did so, I've seen it done ~140ms too early when playing ~150ms file.
219 // 213 //
220 // Instead of trying to invent OS-specific solution for each and every OS we 214 // Instead of trying to invent OS-specific solution for each and every OS we
221 // are supporting, use simple workaround: every time we fill the buffer we 215 // are supporting, use simple workaround: every time we fill the buffer we
(...skipping 10 matching lines...) Expand all
232 // True if the renderer receives a buffer with kAborted status during preroll, 226 // True if the renderer receives a buffer with kAborted status during preroll,
233 // false otherwise. This flag is cleared on the next Preroll() call. 227 // false otherwise. This flag is cleared on the next Preroll() call.
234 bool preroll_aborted_; 228 bool preroll_aborted_;
235 229
236 DISALLOW_COPY_AND_ASSIGN(AudioRendererImpl); 230 DISALLOW_COPY_AND_ASSIGN(AudioRendererImpl);
237 }; 231 };
238 232
239 } // namespace media 233 } // namespace media
240 234
241 #endif // MEDIA_FILTERS_AUDIO_RENDERER_IMPL_H_ 235 #endif // MEDIA_FILTERS_AUDIO_RENDERER_IMPL_H_
OLDNEW
« no previous file with comments | « no previous file | media/filters/audio_renderer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698