OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 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_AUDIO_THREAD_H_ |
| 6 #define MEDIA_AUDIO_AUDIO_THREAD_H_ |
| 7 |
| 8 #include "media/base/media_export.h" |
| 9 |
| 10 namespace base { |
| 11 class SingleThreadTaskRunner; |
| 12 } // namespace base |
| 13 |
| 14 namespace media { |
| 15 |
| 16 // This class encapulates the logic for the thread and task runners that the |
| 17 // AudioManager and related classes run on. |
| 18 class MEDIA_EXPORT AudioThread { |
| 19 public: |
| 20 virtual ~AudioThread() {} |
| 21 |
| 22 // Synchronously stops all underlying threads. |
| 23 virtual void Stop() = 0; |
| 24 |
| 25 // Returns the task runner used for audio IO. |
| 26 // It always returns a non-null task runner (even after Stop has been called). |
| 27 virtual base::SingleThreadTaskRunner* GetTaskRunner() = 0; |
| 28 |
| 29 // Heavyweight tasks should use GetWorkerTaskRunner() instead of |
| 30 // GetTaskRunner(). On most platforms they are the same, but some share the |
| 31 // UI loop with the audio IO loop. |
| 32 // It always returns a non-null task runner (even after Stop has been called). |
| 33 virtual base::SingleThreadTaskRunner* GetWorkerTaskRunner() = 0; |
| 34 }; |
| 35 |
| 36 } // namespace media |
| 37 |
| 38 #endif // MEDIA_AUDIO_AUDIO_THREAD_H_ |
OLD | NEW |