| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/audio_manager_base.h" | 5 #include "media/audio/audio_manager_base.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 // dispatcher are the same as the request dispatcher. | 70 // dispatcher are the same as the request dispatcher. |
| 71 return (dispatcher_->input_params.Equals(dispatcher_in->input_params) && | 71 return (dispatcher_->input_params.Equals(dispatcher_in->input_params) && |
| 72 dispatcher_->output_params.Equals(dispatcher_in->output_params) && | 72 dispatcher_->output_params.Equals(dispatcher_in->output_params) && |
| 73 dispatcher_->output_device_id == dispatcher_in->output_device_id); | 73 dispatcher_->output_device_id == dispatcher_in->output_device_id); |
| 74 } | 74 } |
| 75 | 75 |
| 76 private: | 76 private: |
| 77 const DispatcherParams* dispatcher_; | 77 const DispatcherParams* dispatcher_; |
| 78 }; | 78 }; |
| 79 | 79 |
| 80 static bool IsDefaultDeviceId(const std::string& device_id) { | 80 // static |
| 81 bool AudioManagerBase::IsDefaultDeviceId(const std::string& device_id) { |
| 81 return device_id.empty() || device_id == AudioManagerBase::kDefaultDeviceId; | 82 return device_id.empty() || device_id == AudioManagerBase::kDefaultDeviceId; |
| 82 } | 83 } |
| 83 | 84 |
| 85 // static |
| 86 bool AudioManagerBase::UseSessionIdToSelectDevice( |
| 87 int session_id, |
| 88 const std::string& device_id) { |
| 89 return session_id && device_id.empty(); |
| 90 } |
| 91 |
| 84 AudioManagerBase::AudioManagerBase(AudioLogFactory* audio_log_factory) | 92 AudioManagerBase::AudioManagerBase(AudioLogFactory* audio_log_factory) |
| 85 : max_num_output_streams_(kDefaultMaxOutputStreams), | 93 : max_num_output_streams_(kDefaultMaxOutputStreams), |
| 86 max_num_input_streams_(kDefaultMaxInputStreams), | 94 max_num_input_streams_(kDefaultMaxInputStreams), |
| 87 num_output_streams_(0), | 95 num_output_streams_(0), |
| 88 num_input_streams_(0), | 96 num_input_streams_(0), |
| 89 // TODO(dalecurtis): Switch this to an base::ObserverListThreadSafe, so we | 97 // TODO(dalecurtis): Switch this to an base::ObserverListThreadSafe, so we |
| 90 // don't | 98 // don't |
| 91 // block the UI thread when swapping devices. | 99 // block the UI thread when swapping devices. |
| 92 output_listeners_( | 100 output_listeners_( |
| 93 base::ObserverList<AudioDeviceListener>::NOTIFY_EXISTING_ONLY), | 101 base::ObserverList<AudioDeviceListener>::NOTIFY_EXISTING_ONLY), |
| (...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 401 | 409 |
| 402 return 0; | 410 return 0; |
| 403 } | 411 } |
| 404 | 412 |
| 405 scoped_ptr<AudioLog> AudioManagerBase::CreateAudioLog( | 413 scoped_ptr<AudioLog> AudioManagerBase::CreateAudioLog( |
| 406 AudioLogFactory::AudioComponent component) { | 414 AudioLogFactory::AudioComponent component) { |
| 407 return audio_log_factory_->CreateAudioLog(component); | 415 return audio_log_factory_->CreateAudioLog(component); |
| 408 } | 416 } |
| 409 | 417 |
| 410 } // namespace media | 418 } // namespace media |
| OLD | NEW |