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/base/mock_audio_renderer_sink.h" | 5 #include "media/base/mock_audio_renderer_sink.h" |
6 | 6 |
7 namespace media { | 7 namespace media { |
8 MockAudioRendererSink::MockAudioRendererSink() | 8 MockAudioRendererSink::MockAudioRendererSink() |
9 : MockAudioRendererSink(OUTPUT_DEVICE_STATUS_OK) {} | 9 : MockAudioRendererSink(OUTPUT_DEVICE_STATUS_OK) {} |
10 | 10 |
11 MockAudioRendererSink::MockAudioRendererSink(OutputDeviceStatus device_status) | 11 MockAudioRendererSink::MockAudioRendererSink(OutputDeviceStatus device_status) |
12 : MockAudioRendererSink(std::string(), device_status) {} | 12 : MockAudioRendererSink(std::string(), device_status) {} |
13 | 13 |
14 MockAudioRendererSink::MockAudioRendererSink(const std::string& device_id, | 14 MockAudioRendererSink::MockAudioRendererSink(const std::string& device_id, |
15 OutputDeviceStatus device_status) | 15 OutputDeviceStatus device_status) |
16 : MockAudioRendererSink( | 16 : MockAudioRendererSink( |
17 device_id, | 17 device_id, |
18 device_status, | 18 device_status, |
19 media::AudioParameters(media::AudioParameters::AUDIO_FAKE, | 19 AudioParameters(AudioParameters::AUDIO_FAKE, |
20 media::CHANNEL_LAYOUT_STEREO, | 20 CHANNEL_LAYOUT_STEREO, |
21 media::AudioParameters::kTelephoneSampleRate, | 21 AudioParameters::kTelephoneSampleRate, |
22 16, | 22 16, |
23 1)) {} | 23 1)) {} |
24 | 24 |
25 MockAudioRendererSink::MockAudioRendererSink( | 25 MockAudioRendererSink::MockAudioRendererSink( |
26 const std::string& device_id, | 26 const std::string& device_id, |
27 OutputDeviceStatus device_status, | 27 OutputDeviceStatus device_status, |
28 const AudioParameters& device_output_params) | 28 const AudioParameters& device_output_params) |
29 : output_device_info_(device_id, device_status, device_output_params) {} | 29 : output_device_info_(device_id, device_status, device_output_params) {} |
30 | 30 |
31 MockAudioRendererSink::~MockAudioRendererSink() {} | 31 MockAudioRendererSink::~MockAudioRendererSink() {} |
32 | 32 |
33 void MockAudioRendererSink::SwitchOutputDevice( | 33 void MockAudioRendererSink::SwitchOutputDevice( |
34 const std::string& device_id, | 34 const std::string& device_id, |
35 const url::Origin& security_origin, | 35 const url::Origin& security_origin, |
36 const OutputDeviceStatusCB& callback) { | 36 const OutputDeviceStatusCB& callback) { |
37 // NB: output device won't be changed, since it's not required by any tests | 37 // NB: output device won't be changed, since it's not required by any tests |
38 // now. | 38 // now. |
39 callback.Run(output_device_info_.device_status()); | 39 callback.Run(output_device_info_.device_status()); |
40 } | 40 } |
41 | 41 |
42 void MockAudioRendererSink::Initialize(const AudioParameters& params, | 42 void MockAudioRendererSink::Initialize(const AudioParameters& params, |
43 RenderCallback* renderer) { | 43 RenderCallback* renderer) { |
44 callback_ = renderer; | 44 callback_ = renderer; |
45 } | 45 } |
46 | 46 |
47 OutputDeviceInfo MockAudioRendererSink::GetOutputDeviceInfo() { | 47 OutputDeviceInfo MockAudioRendererSink::GetOutputDeviceInfo() { |
48 return output_device_info_; | 48 return output_device_info_; |
49 } | 49 } |
50 | 50 |
51 } // namespace media | 51 } // namespace media |
OLD | NEW |