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

Side by Side Diff: media/audio/mac/audio_input_mac.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 | « no previous file | media/audio/mac/audio_low_latency_input_mac.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/mac/audio_input_mac.h" 5 #include "media/audio/mac/audio_input_mac.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "media/audio/audio_util.h" 9 #include "media/audio/audio_util.h"
10 #include "media/audio/mac/audio_manager_mac.h" 10 #include "media/audio/mac/audio_manager_mac.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 &audio_queue_); 56 &audio_queue_);
57 if (err != noErr) { 57 if (err != noErr) {
58 HandleError(err); 58 HandleError(err);
59 return false; 59 return false;
60 } 60 }
61 return SetupBuffers(); 61 return SetupBuffers();
62 } 62 }
63 63
64 void PCMQueueInAudioInputStream::Start(AudioInputCallback* callback) { 64 void PCMQueueInAudioInputStream::Start(AudioInputCallback* callback) {
65 DCHECK(callback); 65 DCHECK(callback);
66 DCHECK(audio_queue_) << "Must call Open() first"; 66 DLOG_IF(ERROR, !audio_queue_) << "Open() has not been called successfully";
67 if (callback_) 67 if (callback_ || !audio_queue_)
68 return; 68 return;
69 callback_ = callback; 69 callback_ = callback;
70 OSStatus err = AudioQueueStart(audio_queue_, NULL); 70 OSStatus err = AudioQueueStart(audio_queue_, NULL);
71 if (err != noErr) 71 if (err != noErr)
72 HandleError(err); 72 HandleError(err);
73 else 73 else
74 manager_->IncreaseActiveInputStreamCount(); 74 manager_->IncreaseActiveInputStreamCount();
75 } 75 }
76 76
77 void PCMQueueInAudioInputStream::Stop() { 77 void PCMQueueInAudioInputStream::Stop() {
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 // TODO(joth): PCMQueueOutAudioOutputStream uses callback_ to provide an 177 // TODO(joth): PCMQueueOutAudioOutputStream uses callback_ to provide an
178 // extra guard for this situation, but it seems to introduce more 178 // extra guard for this situation, but it seems to introduce more
179 // complications than it solves (memory barrier issues accessing it from 179 // complications than it solves (memory barrier issues accessing it from
180 // multiple threads, looses the means to indicate OnClosed to client). 180 // multiple threads, looses the means to indicate OnClosed to client).
181 // Should determine if we need to do something equivalent here. 181 // Should determine if we need to do something equivalent here.
182 return; 182 return;
183 } 183 }
184 HandleError(err); 184 HandleError(err);
185 } 185 }
186 } 186 }
OLDNEW
« no previous file with comments | « no previous file | media/audio/mac/audio_low_latency_input_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698