OLD | NEW |
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 #include "media/audio/win/audio_low_latency_output_win.h" | 5 #include "media/audio/win/audio_low_latency_output_win.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "media/audio/audio_util.h" | 10 #include "media/audio/audio_util.h" |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 } | 110 } |
111 | 111 |
112 opened_ = true; | 112 opened_ = true; |
113 | 113 |
114 return true; | 114 return true; |
115 } | 115 } |
116 | 116 |
117 void WASAPIAudioOutputStream::Start(AudioSourceCallback* callback) { | 117 void WASAPIAudioOutputStream::Start(AudioSourceCallback* callback) { |
118 DCHECK_EQ(GetCurrentThreadId(), creating_thread_id_); | 118 DCHECK_EQ(GetCurrentThreadId(), creating_thread_id_); |
119 DCHECK(callback); | 119 DCHECK(callback); |
120 DCHECK(opened_); | 120 DLOG_IF(ERROR, !opened_) << "Open() has not been called successfully"; |
121 | |
122 if (!opened_) | 121 if (!opened_) |
123 return; | 122 return; |
124 | 123 |
125 if (started_) | 124 if (started_) |
126 return; | 125 return; |
127 | 126 |
128 source_ = callback; | 127 source_ = callback; |
129 | 128 |
130 // Avoid start-up glitches by filling up the endpoint buffer with "silence" | 129 // Avoid start-up glitches by filling up the endpoint buffer with "silence" |
131 // before starting the stream. | 130 // before starting the stream. |
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
586 return hr; | 585 return hr; |
587 | 586 |
588 // Get access to the IAudioRenderClient interface. This interface | 587 // Get access to the IAudioRenderClient interface. This interface |
589 // enables us to write output data to a rendering endpoint buffer. | 588 // enables us to write output data to a rendering endpoint buffer. |
590 // The methods in this interface manage the movement of data packets | 589 // The methods in this interface manage the movement of data packets |
591 // that contain audio-rendering data. | 590 // that contain audio-rendering data. |
592 hr = audio_client_->GetService(__uuidof(IAudioRenderClient), | 591 hr = audio_client_->GetService(__uuidof(IAudioRenderClient), |
593 audio_render_client_.ReceiveVoid()); | 592 audio_render_client_.ReceiveVoid()); |
594 return hr; | 593 return hr; |
595 } | 594 } |
OLD | NEW |