OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 #ifndef MEDIA_AUDIO_AUDIO_SILENCE_DETECTOR_H_ | 5 #ifndef MEDIA_AUDIO_AUDIO_SILENCE_DETECTOR_H_ |
6 #define MEDIA_AUDIO_AUDIO_SILENCE_DETECTOR_H_ | 6 #define MEDIA_AUDIO_AUDIO_SILENCE_DETECTOR_H_ |
7 | 7 |
8 #include "base/atomic_ref_count.h" | 8 #include "base/atomic_ref_count.h" |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "base/threading/thread_checker.h" | 11 #include "base/threading/thread_checker.h" |
12 #include "base/timer.h" | 12 #include "base/timer/timer.h" |
13 #include "media/base/media_export.h" | 13 #include "media/base/media_export.h" |
14 | 14 |
15 // An audio silence detector. It is periodically provided an AudioBus by the | 15 // An audio silence detector. It is periodically provided an AudioBus by the |
16 // native audio thread, where simple logic determines whether the audio samples | 16 // native audio thread, where simple logic determines whether the audio samples |
17 // in each channel in the buffer represent silence. If a long-enough period of | 17 // in each channel in the buffer represent silence. If a long-enough period of |
18 // contiguous silence is observed in all channels, a notification callback is | 18 // contiguous silence is observed in all channels, a notification callback is |
19 // run on the thread that constructed AudioSilenceDetector. | 19 // run on the thread that constructed AudioSilenceDetector. |
20 // | 20 // |
21 // Note that extreme care has been taken to make the | 21 // Note that extreme care has been taken to make the |
22 // AudioSilenceDetector::Scan() method safe to be called on the native audio | 22 // AudioSilenceDetector::Scan() method safe to be called on the native audio |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 | 103 |
104 // Constructor, destructor and most methods must be called on the same thread. | 104 // Constructor, destructor and most methods must be called on the same thread. |
105 base::ThreadChecker thread_checker_; | 105 base::ThreadChecker thread_checker_; |
106 | 106 |
107 DISALLOW_COPY_AND_ASSIGN(AudioSilenceDetector); | 107 DISALLOW_COPY_AND_ASSIGN(AudioSilenceDetector); |
108 }; | 108 }; |
109 | 109 |
110 } // namespace media | 110 } // namespace media |
111 | 111 |
112 #endif // MEDIA_AUDIO_AUDIO_SILENCE_DETECTOR_H_ | 112 #endif // MEDIA_AUDIO_AUDIO_SILENCE_DETECTOR_H_ |
OLD | NEW |