| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/cras/cras_unified.h" | 5 #include "media/audio/cras/cras_unified.h" |
| 6 | 6 |
| 7 #include <cras_client.h> | 7 #include <cras_client.h> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 CrasUnifiedStream::CrasUnifiedStream(const AudioParameters& params, | 80 CrasUnifiedStream::CrasUnifiedStream(const AudioParameters& params, |
| 81 AudioManagerCras* manager) | 81 AudioManagerCras* manager) |
| 82 : client_(NULL), | 82 : client_(NULL), |
| 83 stream_id_(0), | 83 stream_id_(0), |
| 84 params_(params), | 84 params_(params), |
| 85 bytes_per_frame_(0), | 85 bytes_per_frame_(0), |
| 86 is_playing_(false), | 86 is_playing_(false), |
| 87 volume_(1.0), | 87 volume_(1.0), |
| 88 manager_(manager), | 88 manager_(manager), |
| 89 source_callback_(NULL), | 89 source_callback_(NULL), |
| 90 input_bus_(NULL), | |
| 91 output_bus_(NULL), | |
| 92 stream_direction_(CRAS_STREAM_OUTPUT) { | 90 stream_direction_(CRAS_STREAM_OUTPUT) { |
| 93 DCHECK(manager_); | 91 DCHECK(manager_); |
| 94 DCHECK(params_.channels() > 0); | 92 DCHECK(params_.channels() > 0); |
| 95 | 93 |
| 96 // Must have at least one input or output. If there are both they must be the | 94 // Must have at least one input or output. If there are both they must be the |
| 97 // same. | 95 // same. |
| 98 int input_channels = params_.input_channels(); | 96 int input_channels = params_.input_channels(); |
| 99 | 97 |
| 100 if (input_channels) { | 98 if (input_channels) { |
| 101 // A unified stream for input and output. | 99 // A unified stream for input and output. |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 360 return frames_filled; | 358 return frames_filled; |
| 361 } | 359 } |
| 362 | 360 |
| 363 void CrasUnifiedStream::NotifyStreamError(int err) { | 361 void CrasUnifiedStream::NotifyStreamError(int err) { |
| 364 // This will remove the stream from the client. | 362 // This will remove the stream from the client. |
| 365 if (source_callback_) | 363 if (source_callback_) |
| 366 source_callback_->OnError(this); | 364 source_callback_->OnError(this); |
| 367 } | 365 } |
| 368 | 366 |
| 369 } // namespace media | 367 } // namespace media |
| OLD | NEW |