• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2013 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 #ifndef MEDIA_AUDIO_CRAS_AUDIO_MANAGER_CRAS_H_
6 #define MEDIA_AUDIO_CRAS_AUDIO_MANAGER_CRAS_H_
7 
8 #include <string>
9 
10 #include "base/compiler_specific.h"
11 #include "base/memory/ref_counted.h"
12 #include "media/audio/audio_manager_base.h"
13 
14 namespace media {
15 
16 class MEDIA_EXPORT AudioManagerCras : public AudioManagerBase {
17  public:
18   AudioManagerCras(AudioLogFactory* audio_log_factory);
19 
20   // AudioManager implementation.
21   virtual bool HasAudioOutputDevices() OVERRIDE;
22   virtual bool HasAudioInputDevices() OVERRIDE;
23   virtual void ShowAudioInputSettings() OVERRIDE;
24   virtual void GetAudioInputDeviceNames(
25       AudioDeviceNames* device_names) OVERRIDE;
26   virtual void GetAudioOutputDeviceNames(
27       AudioDeviceNames* device_names) OVERRIDE;
28   virtual AudioParameters GetInputStreamParameters(
29       const std::string& device_id) OVERRIDE;
30 
31   // AudioManagerBase implementation.
32   virtual AudioOutputStream* MakeLinearOutputStream(
33       const AudioParameters& params) OVERRIDE;
34   virtual AudioOutputStream* MakeLowLatencyOutputStream(
35       const AudioParameters& params,
36       const std::string& device_id,
37       const std::string& input_device_id) OVERRIDE;
38   virtual AudioInputStream* MakeLinearInputStream(
39       const AudioParameters& params, const std::string& device_id) OVERRIDE;
40   virtual AudioInputStream* MakeLowLatencyInputStream(
41       const AudioParameters& params, const std::string& device_id) OVERRIDE;
42 
43  protected:
44   virtual ~AudioManagerCras();
45 
46   virtual AudioParameters GetPreferredOutputStreamParameters(
47       const std::string& output_device_id,
48       const AudioParameters& input_params) OVERRIDE;
49 
50  private:
51   // Called by MakeLinearOutputStream and MakeLowLatencyOutputStream.
52   AudioOutputStream* MakeOutputStream(const AudioParameters& params);
53 
54   // Called by MakeLinearInputStream and MakeLowLatencyInputStream.
55   AudioInputStream* MakeInputStream(const AudioParameters& params,
56                                     const std::string& device_id);
57 
58   DISALLOW_COPY_AND_ASSIGN(AudioManagerCras);
59 };
60 
61 }  // namespace media
62 
63 #endif  // MEDIA_AUDIO_CRAS_AUDIO_MANAGER_CRAS_H_
64