OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef SERVICES_MEDIA_AUDIO_AUDIO_OUTPUT_MANAGER_H_ | 5 #ifndef SERVICES_MEDIA_AUDIO_AUDIO_OUTPUT_MANAGER_H_ |
6 #define SERVICES_MEDIA_AUDIO_AUDIO_OUTPUT_MANAGER_H_ | 6 #define SERVICES_MEDIA_AUDIO_AUDIO_OUTPUT_MANAGER_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/synchronization/lock.h" | 10 #include "base/synchronization/lock.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 | 50 |
51 // Schedule a closure to run on our encapsulating server's main message loop. | 51 // Schedule a closure to run on our encapsulating server's main message loop. |
52 void ScheduleMessageLoopTask(const tracked_objects::Location& from_here, | 52 void ScheduleMessageLoopTask(const tracked_objects::Location& from_here, |
53 const base::Closure& task); | 53 const base::Closure& task); |
54 | 54 |
55 // Shutdown the specified audio output and remove it from the set of active | 55 // Shutdown the specified audio output and remove it from the set of active |
56 // outputs. | 56 // outputs. |
57 void ShutdownOutput(AudioOutputPtr output); | 57 void ShutdownOutput(AudioOutputPtr output); |
58 | 58 |
59 private: | 59 private: |
| 60 void CreateAlsaOutputs(); |
| 61 |
60 // TODO(johngro): A SequencedWorkerPool currently seems to be as close to what | 62 // TODO(johngro): A SequencedWorkerPool currently seems to be as close to what |
61 // we want which we can currently get using the chrome/mojo framework. Things | 63 // we want which we can currently get using the chrome/mojo framework. Things |
62 // which are missing and will eventually need to be addressed include... | 64 // which are missing and will eventually need to be addressed include... |
63 // | 65 // |
64 // 1) Threads are created on the fly, as needed. We really want to be able to | 66 // 1) Threads are created on the fly, as needed. We really want to be able to |
65 // spin up the proper number of threads at pool creation time. Audio | 67 // spin up the proper number of threads at pool creation time. Audio |
66 // mixing is very timing sensitive... If we are in a situation where we | 68 // mixing is very timing sensitive... If we are in a situation where we |
67 // have not hit the max number of threads in the pool, and we need to spin | 69 // have not hit the max number of threads in the pool, and we need to spin |
68 // up a thread in order to mix, we *really* do not want to have to wait to | 70 // up a thread in order to mix, we *really* do not want to have to wait to |
69 // create the thread at the OS level before we can mix some audio. The | 71 // create the thread at the OS level before we can mix some audio. The |
(...skipping 30 matching lines...) Expand all Loading... |
100 // Contents of the output set must only be manipulated on the main message | 102 // Contents of the output set must only be manipulated on the main message |
101 // loop thread, so no synchronization should be needed. | 103 // loop thread, so no synchronization should be needed. |
102 AudioOutputSet outputs_; | 104 AudioOutputSet outputs_; |
103 }; | 105 }; |
104 | 106 |
105 } // namespace audio | 107 } // namespace audio |
106 } // namespace media | 108 } // namespace media |
107 } // namespace mojo | 109 } // namespace mojo |
108 | 110 |
109 #endif // SERVICES_MEDIA_AUDIO_AUDIO_OUTPUT_MANAGER_H_ | 111 #endif // SERVICES_MEDIA_AUDIO_AUDIO_OUTPUT_MANAGER_H_ |
OLD | NEW |