Home | History | Annotate | Download | only in audio
      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
      3 // found in the LICENSE file.
      4 
      5 #include "media/audio/mock_audio_manager.h"
      6 
      7 #include "base/logging.h"
      8 #include "base/message_loop/message_loop_proxy.h"
      9 #include "media/audio/audio_parameters.h"
     10 
     11 namespace media {
     12 
     13 MockAudioManager::MockAudioManager(base::MessageLoopProxy* message_loop_proxy)
     14     : message_loop_proxy_(message_loop_proxy) {
     15 }
     16 
     17 MockAudioManager::~MockAudioManager() {
     18 }
     19 
     20 bool MockAudioManager::HasAudioOutputDevices() {
     21   return true;
     22 }
     23 
     24 bool MockAudioManager::HasAudioInputDevices() {
     25   return true;
     26 }
     27 
     28 base::string16 MockAudioManager::GetAudioInputDeviceModel() {
     29   return base::string16();
     30 }
     31 
     32 void MockAudioManager::ShowAudioInputSettings() {
     33 }
     34 
     35 void MockAudioManager::GetAudioInputDeviceNames(
     36     AudioDeviceNames* device_names) {
     37   DCHECK(device_names->empty());
     38   device_names->push_back(media::AudioDeviceName("fake_device_name_1",
     39                                                  "fake_device_id_1"));
     40   device_names->push_back(media::AudioDeviceName("fake_device_name_2",
     41                                                  "fake_device_id_2"));
     42 }
     43 
     44 void MockAudioManager::GetAudioOutputDeviceNames(
     45     AudioDeviceNames* device_names) {
     46 }
     47 
     48 media::AudioOutputStream* MockAudioManager::MakeAudioOutputStream(
     49     const media::AudioParameters& params,
     50     const std::string& device_id,
     51     const std::string& input_device_id) {
     52   NOTREACHED();
     53   return NULL;
     54 }
     55 
     56 media::AudioOutputStream* MockAudioManager::MakeAudioOutputStreamProxy(
     57     const media::AudioParameters& params,
     58     const std::string& device_id,
     59     const std::string& input_device_id) {
     60   NOTREACHED();
     61   return NULL;
     62 }
     63 
     64 media::AudioInputStream* MockAudioManager::MakeAudioInputStream(
     65     const media::AudioParameters& params,
     66     const std::string& device_id) {
     67   NOTREACHED();
     68   return NULL;
     69 }
     70 
     71 scoped_refptr<base::MessageLoopProxy> MockAudioManager::GetMessageLoop() {
     72   return message_loop_proxy_;
     73 }
     74 
     75 scoped_refptr<base::MessageLoopProxy> MockAudioManager::GetWorkerLoop() {
     76   return message_loop_proxy_;
     77 }
     78 
     79 void MockAudioManager::AddOutputDeviceChangeListener(
     80     AudioDeviceListener* listener) {
     81 }
     82 
     83 void MockAudioManager::RemoveOutputDeviceChangeListener(
     84     AudioDeviceListener* listener) {
     85 }
     86 
     87 AudioParameters MockAudioManager::GetDefaultOutputStreamParameters() {
     88   return AudioParameters();
     89 }
     90 
     91 AudioParameters MockAudioManager::GetOutputStreamParameters(
     92       const std::string& device_id) {
     93   return AudioParameters();
     94 }
     95 
     96 AudioParameters MockAudioManager::GetInputStreamParameters(
     97     const std::string& device_id) {
     98   return AudioParameters();
     99 }
    100 
    101 std::string MockAudioManager::GetAssociatedOutputDeviceID(
    102     const std::string& input_device_id) {
    103   return std::string();
    104 }
    105 
    106 scoped_ptr<AudioLog> MockAudioManager::CreateAudioLog(
    107     AudioLogFactory::AudioComponent component) {
    108   return scoped_ptr<AudioLog>();
    109 }
    110 
    111 void MockAudioManager::FixWedgedAudio() {}
    112 
    113 }  // namespace media.
    114