| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "chromecast/media/audio/cast_audio_manager.h" | 5 #include "chromecast/media/audio/cast_audio_manager.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "chromecast/media/audio/cast_audio_output_stream.h" | 10 #include "chromecast/media/audio/cast_audio_output_stream.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 // Note: These values are copied from AudioManagerPulse implementation. | 21 // Note: These values are copied from AudioManagerPulse implementation. |
| 22 // TODO(alokp): Query the preferred value from media backend. | 22 // TODO(alokp): Query the preferred value from media backend. |
| 23 static const int kMinimumOutputBufferSize = 512; | 23 static const int kMinimumOutputBufferSize = 512; |
| 24 static const int kMaximumOutputBufferSize = 8192; | 24 static const int kMaximumOutputBufferSize = 8192; |
| 25 static const int kDefaultOutputBufferSize = 2048; | 25 static const int kDefaultOutputBufferSize = 2048; |
| 26 } // namespace | 26 } // namespace |
| 27 | 27 |
| 28 namespace chromecast { | 28 namespace chromecast { |
| 29 namespace media { | 29 namespace media { |
| 30 | 30 |
| 31 CastAudioManager::CastAudioManager(::media::AudioLogFactory* audio_log_factory) | 31 CastAudioManager::CastAudioManager( |
| 32 : AudioManagerBase(audio_log_factory) {} | 32 scoped_refptr<base::SingleThreadTaskRunner> task_runner, |
| 33 scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner, |
| 34 ::media::AudioLogFactory* audio_log_factory) |
| 35 : AudioManagerBase(std::move(task_runner), |
| 36 std::move(worker_task_runner), |
| 37 audio_log_factory) {} |
| 33 | 38 |
| 34 CastAudioManager::~CastAudioManager() { | 39 CastAudioManager::~CastAudioManager() {} |
| 35 Shutdown(); | |
| 36 } | |
| 37 | 40 |
| 38 bool CastAudioManager::HasAudioOutputDevices() { | 41 bool CastAudioManager::HasAudioOutputDevices() { |
| 39 return true; | 42 return true; |
| 40 } | 43 } |
| 41 | 44 |
| 42 bool CastAudioManager::HasAudioInputDevices() { | 45 bool CastAudioManager::HasAudioInputDevices() { |
| 43 return false; | 46 return false; |
| 44 } | 47 } |
| 45 | 48 |
| 46 void CastAudioManager::ShowAudioInputSettings() { | 49 void CastAudioManager::ShowAudioInputSettings() { |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 } | 119 } |
| 117 | 120 |
| 118 ::media::AudioParameters output_params( | 121 ::media::AudioParameters output_params( |
| 119 ::media::AudioParameters::AUDIO_PCM_LOW_LATENCY, channel_layout, | 122 ::media::AudioParameters::AUDIO_PCM_LOW_LATENCY, channel_layout, |
| 120 sample_rate, bits_per_sample, buffer_size); | 123 sample_rate, bits_per_sample, buffer_size); |
| 121 return output_params; | 124 return output_params; |
| 122 } | 125 } |
| 123 | 126 |
| 124 } // namespace media | 127 } // namespace media |
| 125 } // namespace chromecast | 128 } // namespace chromecast |
| OLD | NEW |