OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 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 // Creates a unified stream based on the cras (ChromeOS audio server) interface. | 5 // Creates a unified stream based on the cras (ChromeOS audio server) interface. |
6 // | 6 // |
7 // CrasUnifiedStream object is *not* thread-safe and should only be used | 7 // CrasUnifiedStream object is *not* thread-safe and should only be used |
8 // from the audio thread. | 8 // from the audio thread. |
9 | 9 |
10 #ifndef MEDIA_AUDIO_LINUX_CRAS_UNIFIED_H_ | 10 #ifndef MEDIA_AUDIO_LINUX_CRAS_UNIFIED_H_ |
11 #define MEDIA_AUDIO_LINUX_CRAS_UNIFIED_H_ | 11 #define MEDIA_AUDIO_LINUX_CRAS_UNIFIED_H_ |
12 | 12 |
13 #include <alsa/asoundlib.h> | |
14 #include <cras_client.h> | 13 #include <cras_client.h> |
15 | 14 |
16 #include "base/compiler_specific.h" | 15 #include "base/compiler_specific.h" |
17 #include "base/gtest_prod_util.h" | |
18 #include "media/audio/audio_io.h" | 16 #include "media/audio/audio_io.h" |
19 #include "media/audio/audio_parameters.h" | 17 #include "media/audio/audio_parameters.h" |
20 | 18 |
21 namespace media { | 19 namespace media { |
22 | 20 |
23 class AudioManagerCras; | 21 class AudioManagerCras; |
24 class AudioParameters; | |
25 | 22 |
26 // Implementation of AudioOuputStream for Chrome OS using the Chrome OS audio | 23 // Implementation of AudioOuputStream for Chrome OS using the Chrome OS audio |
27 // server. | 24 // server. |
28 class MEDIA_EXPORT CrasUnifiedStream : public AudioOutputStream { | 25 class MEDIA_EXPORT CrasUnifiedStream : public AudioOutputStream { |
29 public: | 26 public: |
30 // The ctor takes all the usual parameters, plus |manager| which is the | 27 // The ctor takes all the usual parameters, plus |manager| which is the |
31 // audio manager who is creating this object. | 28 // audio manager who is creating this object. |
32 CrasUnifiedStream(const AudioParameters& params, AudioManagerCras* manager); | 29 CrasUnifiedStream(const AudioParameters& params, AudioManagerCras* manager); |
33 | 30 |
34 // The dtor is typically called by the AudioManager only and it is usually | 31 // The dtor is typically called by the AudioManager only and it is usually |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 | 110 |
114 // Direciton of the stream. | 111 // Direciton of the stream. |
115 CRAS_STREAM_DIRECTION stream_direction_; | 112 CRAS_STREAM_DIRECTION stream_direction_; |
116 | 113 |
117 DISALLOW_COPY_AND_ASSIGN(CrasUnifiedStream); | 114 DISALLOW_COPY_AND_ASSIGN(CrasUnifiedStream); |
118 }; | 115 }; |
119 | 116 |
120 } // namespace media | 117 } // namespace media |
121 | 118 |
122 #endif // MEDIA_AUDIO_LINUX_CRAS_UNIFIED_H_ | 119 #endif // MEDIA_AUDIO_LINUX_CRAS_UNIFIED_H_ |
OLD | NEW |