| 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/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 class AudioManagerBase::CompareByParams { | 55 class AudioManagerBase::CompareByParams { |
| 56 public: | 56 public: |
| 57 explicit CompareByParams(const DispatcherParams* dispatcher) | 57 explicit CompareByParams(const DispatcherParams* dispatcher) |
| 58 : dispatcher_(dispatcher) {} | 58 : dispatcher_(dispatcher) {} |
| 59 bool operator()(DispatcherParams* dispatcher_in) const { | 59 bool operator()(DispatcherParams* dispatcher_in) const { |
| 60 // We will reuse the existing dispatcher when: | 60 // We will reuse the existing dispatcher when: |
| 61 // 1) Unified IO is not used, input_params and output_params of the | 61 // 1) Unified IO is not used, input_params and output_params of the |
| 62 // existing dispatcher are the same as the requested dispatcher. | 62 // existing dispatcher are the same as the requested dispatcher. |
| 63 // 2) Unified IO is used, input_params and output_params of the existing | 63 // 2) Unified IO is used, input_params and output_params of the existing |
| 64 // dispatcher are the same as the request dispatcher. | 64 // dispatcher are the same as the request dispatcher. |
| 65 return (dispatcher_->input_params == dispatcher_in->input_params && | 65 return (dispatcher_->input_params.Equals(dispatcher_in->input_params) && |
| 66 dispatcher_->output_params == dispatcher_in->output_params && | 66 dispatcher_->output_params.Equals(dispatcher_in->output_params) && |
| 67 dispatcher_->output_device_id == dispatcher_in->output_device_id); | 67 dispatcher_->output_device_id == dispatcher_in->output_device_id); |
| 68 } | 68 } |
| 69 | 69 |
| 70 private: | 70 private: |
| 71 const DispatcherParams* dispatcher_; | 71 const DispatcherParams* dispatcher_; |
| 72 }; | 72 }; |
| 73 | 73 |
| 74 AudioManagerBase::AudioManagerBase(AudioLogFactory* audio_log_factory) | 74 AudioManagerBase::AudioManagerBase(AudioLogFactory* audio_log_factory) |
| 75 : max_num_output_streams_(kDefaultMaxOutputStreams), | 75 : max_num_output_streams_(kDefaultMaxOutputStreams), |
| 76 max_num_input_streams_(kDefaultMaxInputStreams), | 76 max_num_input_streams_(kDefaultMaxInputStreams), |
| (...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 394 | 394 |
| 395 return 0; | 395 return 0; |
| 396 } | 396 } |
| 397 | 397 |
| 398 scoped_ptr<AudioLog> AudioManagerBase::CreateAudioLog( | 398 scoped_ptr<AudioLog> AudioManagerBase::CreateAudioLog( |
| 399 AudioLogFactory::AudioComponent component) { | 399 AudioLogFactory::AudioComponent component) { |
| 400 return audio_log_factory_->CreateAudioLog(component); | 400 return audio_log_factory_->CreateAudioLog(component); |
| 401 } | 401 } |
| 402 | 402 |
| 403 } // namespace media | 403 } // namespace media |
| OLD | NEW |