| 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(); | 40 Shutdown(); |
| 36 } | 41 } |
| 37 | 42 |
| 38 bool CastAudioManager::HasAudioOutputDevices() { | 43 bool CastAudioManager::HasAudioOutputDevices() { |
| 39 return true; | 44 return true; |
| 40 } | 45 } |
| 41 | 46 |
| 42 bool CastAudioManager::HasAudioInputDevices() { | 47 bool CastAudioManager::HasAudioInputDevices() { |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 } | 121 } |
| 117 | 122 |
| 118 ::media::AudioParameters output_params( | 123 ::media::AudioParameters output_params( |
| 119 ::media::AudioParameters::AUDIO_PCM_LOW_LATENCY, channel_layout, | 124 ::media::AudioParameters::AUDIO_PCM_LOW_LATENCY, channel_layout, |
| 120 sample_rate, bits_per_sample, buffer_size); | 125 sample_rate, bits_per_sample, buffer_size); |
| 121 return output_params; | 126 return output_params; |
| 122 } | 127 } |
| 123 | 128 |
| 124 } // namespace media | 129 } // namespace media |
| 125 } // namespace chromecast | 130 } // namespace chromecast |
| OLD | NEW |