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 #ifndef MEDIA_AUDIO_CLOCKLESS_AUDIO_SINK_H_ | 5 #ifndef MEDIA_AUDIO_CLOCKLESS_AUDIO_SINK_H_ |
6 #define MEDIA_AUDIO_CLOCKLESS_AUDIO_SINK_H_ | 6 #define MEDIA_AUDIO_CLOCKLESS_AUDIO_SINK_H_ |
7 | 7 |
| 8 #include <memory> |
8 #include <string> | 9 #include <string> |
9 | 10 |
10 #include "base/macros.h" | 11 #include "base/macros.h" |
11 #include "base/memory/scoped_ptr.h" | |
12 #include "base/time/time.h" | 12 #include "base/time/time.h" |
13 #include "media/base/audio_renderer_sink.h" | 13 #include "media/base/audio_renderer_sink.h" |
14 | 14 |
15 namespace base { | 15 namespace base { |
16 class SingleThreadTaskRunner; | 16 class SingleThreadTaskRunner; |
17 } | 17 } |
18 | 18 |
19 namespace media { | 19 namespace media { |
20 class AudioBus; | 20 class AudioBus; |
21 class ClocklessAudioSinkThread; | 21 class ClocklessAudioSinkThread; |
(...skipping 21 matching lines...) Expand all Loading... |
43 // Enables audio frame hashing. Must be called prior to Initialize(). | 43 // Enables audio frame hashing. Must be called prior to Initialize(). |
44 void StartAudioHashForTesting(); | 44 void StartAudioHashForTesting(); |
45 | 45 |
46 // Returns the hash of all audio frames seen since construction. | 46 // Returns the hash of all audio frames seen since construction. |
47 std::string GetAudioHashForTesting(); | 47 std::string GetAudioHashForTesting(); |
48 | 48 |
49 protected: | 49 protected: |
50 ~ClocklessAudioSink() override; | 50 ~ClocklessAudioSink() override; |
51 | 51 |
52 private: | 52 private: |
53 scoped_ptr<ClocklessAudioSinkThread> thread_; | 53 std::unique_ptr<ClocklessAudioSinkThread> thread_; |
54 bool initialized_; | 54 bool initialized_; |
55 bool playing_; | 55 bool playing_; |
56 bool hashing_; | 56 bool hashing_; |
57 | 57 |
58 // Time taken in last set of Render() calls. | 58 // Time taken in last set of Render() calls. |
59 base::TimeDelta playback_time_; | 59 base::TimeDelta playback_time_; |
60 | 60 |
61 DISALLOW_COPY_AND_ASSIGN(ClocklessAudioSink); | 61 DISALLOW_COPY_AND_ASSIGN(ClocklessAudioSink); |
62 }; | 62 }; |
63 | 63 |
64 } // namespace media | 64 } // namespace media |
65 | 65 |
66 #endif // MEDIA_AUDIO_CLOCKLESS_AUDIO_SINK_H_ | 66 #endif // MEDIA_AUDIO_CLOCKLESS_AUDIO_SINK_H_ |
OLD | NEW |