| 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 <cras_client.h> | 13 #include <cras_client.h> |
| 14 #include <stddef.h> | 14 #include <stddef.h> |
| 15 #include <stdint.h> | 15 #include <stdint.h> |
| 16 | 16 |
| 17 #include <memory> |
| 18 |
| 17 #include "base/compiler_specific.h" | 19 #include "base/compiler_specific.h" |
| 18 #include "base/macros.h" | 20 #include "base/macros.h" |
| 19 #include "media/audio/audio_io.h" | 21 #include "media/audio/audio_io.h" |
| 20 #include "media/base/audio_parameters.h" | 22 #include "media/base/audio_parameters.h" |
| 21 | 23 |
| 22 namespace media { | 24 namespace media { |
| 23 | 25 |
| 24 class AudioManagerCras; | 26 class AudioManagerCras; |
| 25 | 27 |
| 26 // Implementation of AudioOuputStream for Chrome OS using the Chrome OS audio | 28 // Implementation of AudioOuputStream for Chrome OS using the Chrome OS audio |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 // Volume level from 0.0 to 1.0. | 101 // Volume level from 0.0 to 1.0. |
| 100 float volume_; | 102 float volume_; |
| 101 | 103 |
| 102 // Audio manager that created us. Used to report that we've been closed. | 104 // Audio manager that created us. Used to report that we've been closed. |
| 103 AudioManagerCras* manager_; | 105 AudioManagerCras* manager_; |
| 104 | 106 |
| 105 // Callback to get audio samples. | 107 // Callback to get audio samples. |
| 106 AudioSourceCallback* source_callback_; | 108 AudioSourceCallback* source_callback_; |
| 107 | 109 |
| 108 // Container for exchanging data with AudioSourceCallback::OnMoreData(). | 110 // Container for exchanging data with AudioSourceCallback::OnMoreData(). |
| 109 scoped_ptr<AudioBus> output_bus_; | 111 std::unique_ptr<AudioBus> output_bus_; |
| 110 | 112 |
| 111 // Direciton of the stream. | 113 // Direciton of the stream. |
| 112 CRAS_STREAM_DIRECTION stream_direction_; | 114 CRAS_STREAM_DIRECTION stream_direction_; |
| 113 | 115 |
| 114 DISALLOW_COPY_AND_ASSIGN(CrasUnifiedStream); | 116 DISALLOW_COPY_AND_ASSIGN(CrasUnifiedStream); |
| 115 }; | 117 }; |
| 116 | 118 |
| 117 } // namespace media | 119 } // namespace media |
| 118 | 120 |
| 119 #endif // MEDIA_AUDIO_LINUX_CRAS_UNIFIED_H_ | 121 #endif // MEDIA_AUDIO_LINUX_CRAS_UNIFIED_H_ |
| OLD | NEW |