realtime_audio_thread.h 825 B

1234567891011121314151617181920212223242526272829
  1. // Copyright 2022 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. #ifndef SERVICES_AUDIO_REALTIME_AUDIO_THREAD_H_
  5. #define SERVICES_AUDIO_REALTIME_AUDIO_THREAD_H_
  6. #include "base/threading/thread.h"
  7. namespace audio {
  8. // Simple base::Thread which uses a configurable realtime thread period for Mac.
  9. class RealtimeAudioThread : public base::Thread {
  10. public:
  11. RealtimeAudioThread(const std::string& name, base::TimeDelta realtime_period);
  12. ~RealtimeAudioThread() override;
  13. #if BUILDFLAG(IS_APPLE)
  14. // base::PlatformThread::Delegate override.
  15. base::TimeDelta GetRealtimePeriod() override;
  16. #endif
  17. private:
  18. base::TimeDelta realtime_period_;
  19. };
  20. } // namespace audio
  21. #endif // SERVICES_AUDIO_PROCESSING_AUDIO_FIFO_H_