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

Side by Side Diff: media/audio/win/audio_low_latency_input_win.cc

Issue 8872028: Make check for 'opened' consistent across all audio stream implementations of Start() and log an ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years 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 | « media/audio/pulse/pulse_output.cc ('k') | media/audio/win/audio_low_latency_output_win.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) 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_input_win.h" 5 #include "media/audio/win/audio_low_latency_input_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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 return false; 114 return false;
115 } 115 }
116 116
117 opened_ = true; 117 opened_ = true;
118 118
119 return true; 119 return true;
120 } 120 }
121 121
122 void WASAPIAudioInputStream::Start(AudioInputCallback* callback) { 122 void WASAPIAudioInputStream::Start(AudioInputCallback* callback) {
123 DCHECK(callback); 123 DCHECK(callback);
124 DCHECK(opened_); 124 DLOG_IF(ERROR, !opened_) << "Open() has not been called successfully";
125
126 if (!opened_) 125 if (!opened_)
127 return; 126 return;
128 127
129 if (started_) 128 if (started_)
130 return; 129 return;
131 130
132 sink_ = callback; 131 sink_ = callback;
133 132
134 // Create and start the thread that will drive the capturing by waiting for 133 // Create and start the thread that will drive the capturing by waiting for
135 // capture events. 134 // capture events.
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after
514 hr = audio_client_->SetEventHandle(audio_samples_ready_event_.Get()); 513 hr = audio_client_->SetEventHandle(audio_samples_ready_event_.Get());
515 if (FAILED(hr)) 514 if (FAILED(hr))
516 return hr; 515 return hr;
517 516
518 // Get access to the IAudioCaptureClient interface. This interface 517 // Get access to the IAudioCaptureClient interface. This interface
519 // enables us to read input data from the capture endpoint buffer. 518 // enables us to read input data from the capture endpoint buffer.
520 hr = audio_client_->GetService(__uuidof(IAudioCaptureClient), 519 hr = audio_client_->GetService(__uuidof(IAudioCaptureClient),
521 audio_capture_client_.ReceiveVoid()); 520 audio_capture_client_.ReceiveVoid());
522 return hr; 521 return hr;
523 } 522 }
OLDNEW
« no previous file with comments | « media/audio/pulse/pulse_output.cc ('k') | media/audio/win/audio_low_latency_output_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698