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

Side by Side Diff: content/renderer/media/audio_renderer_impl.h

Issue 8427031: First unit tests for WebRTCAudioDevice. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Latest comments addressed Created 9 years, 1 month 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 audio output stream provided by browser 5 // Audio rendering unit utilizing audio output stream provided by browser
6 // process through IPC. 6 // process through IPC.
7 // 7 //
8 // Relationship of classes. 8 // Relationship of classes.
9 // 9 //
10 // AudioRendererHost AudioRendererImpl 10 // AudioRendererHost AudioRendererImpl
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 enum LatencyType { 99 enum LatencyType {
100 kUninitializedLatency = 0, 100 kUninitializedLatency = 0,
101 kLowLatency, 101 kLowLatency,
102 kHighLatency 102 kHighLatency
103 }; 103 };
104 static LatencyType latency_type_; 104 static LatencyType latency_type_;
105 105
106 // For access to constructor and IO thread methods. 106 // For access to constructor and IO thread methods.
107 friend class AudioRendererImplTest; 107 friend class AudioRendererImplTest;
108 friend class DelegateCaller; 108 friend class DelegateCaller;
109 friend class WebRTCAudioDeviceTest;
henrika (OOO until Aug 14) 2011/11/04 10:35:12 May I ask why? And, does the comment above apply
tommi (sloooow) - chröme 2011/11/07 10:27:28 Removed. This isn't needed anymore.
109 FRIEND_TEST_ALL_PREFIXES(AudioRendererImplTest, Stop); 110 FRIEND_TEST_ALL_PREFIXES(AudioRendererImplTest, Stop);
110 FRIEND_TEST_ALL_PREFIXES(AudioRendererImplTest, 111 FRIEND_TEST_ALL_PREFIXES(AudioRendererImplTest,
111 DestroyedMessageLoop_ConsumeAudioSamples); 112 DestroyedMessageLoop_ConsumeAudioSamples);
112 FRIEND_TEST_ALL_PREFIXES(AudioRendererImplTest, UpdateEarliestEndTime); 113 FRIEND_TEST_ALL_PREFIXES(AudioRendererImplTest, UpdateEarliestEndTime);
114
113 // Helper methods. 115 // Helper methods.
114 // Convert number of bytes to duration of time using information about the 116 // Convert number of bytes to duration of time using information about the
115 // number of channels, sample rate and sample bits. 117 // number of channels, sample rate and sample bits.
116 base::TimeDelta ConvertToDuration(int bytes); 118 base::TimeDelta ConvertToDuration(int bytes);
117 119
118 // Methods call on IO thread ------------------------------------------------ 120 // Methods call on IO thread ------------------------------------------------
119 // The following methods are tasks posted on the IO thread that needs to 121 // The following methods are tasks posted on the IO thread that needs to
120 // be executed on that thread. They interact with AudioMessageFilter and 122 // be executed on that thread. They interact with AudioMessageFilter and
121 // sends IPC messages on that thread. 123 // sends IPC messages on that thread.
122 void CreateStreamTask(const AudioParameters& params); 124 void CreateStreamTask(const AudioParameters& params);
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 // remember when it should stop playing, and do not assume that buffer is 219 // remember when it should stop playing, and do not assume that buffer is
218 // empty till that time. Workaround is not bulletproof, as we don't exactly 220 // empty till that time. Workaround is not bulletproof, as we don't exactly
219 // know when that particular data would start playing, but it is much better 221 // know when that particular data would start playing, but it is much better
220 // than nothing. 222 // than nothing.
221 base::Time earliest_end_time_; 223 base::Time earliest_end_time_;
222 224
223 DISALLOW_COPY_AND_ASSIGN(AudioRendererImpl); 225 DISALLOW_COPY_AND_ASSIGN(AudioRendererImpl);
224 }; 226 };
225 227
226 #endif // CONTENT_RENDERER_MEDIA_AUDIO_RENDERER_IMPL_H_ 228 #endif // CONTENT_RENDERER_MEDIA_AUDIO_RENDERER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698