| 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 <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 void Start() override; | 33 void Start() override; |
| 34 void Stop() override; | 34 void Stop() override; |
| 35 void Pause() override; | 35 void Pause() override; |
| 36 void Play() override; | 36 void Play() override; |
| 37 bool SetVolume(double volume) override; | 37 bool SetVolume(double volume) override; |
| 38 OutputDevice* GetOutputDevice() override; | 38 OutputDevice* GetOutputDevice() override; |
| 39 | 39 |
| 40 // Returns the time taken to consume all the audio. | 40 // Returns the time taken to consume all the audio. |
| 41 base::TimeDelta render_time() { return playback_time_; } | 41 base::TimeDelta render_time() { return playback_time_; } |
| 42 | 42 |
| 43 // Enables audio frame hashing. Must be called prior to Initialize(). |
| 44 void StartAudioHashForTesting(); |
| 45 |
| 46 // Returns the hash of all audio frames seen since construction. |
| 47 std::string GetAudioHashForTesting(); |
| 48 |
| 43 protected: | 49 protected: |
| 44 ~ClocklessAudioSink() override; | 50 ~ClocklessAudioSink() override; |
| 45 | 51 |
| 46 private: | 52 private: |
| 47 scoped_ptr<ClocklessAudioSinkThread> thread_; | 53 scoped_ptr<ClocklessAudioSinkThread> thread_; |
| 48 bool initialized_; | 54 bool initialized_; |
| 49 bool playing_; | 55 bool playing_; |
| 56 bool hashing_; |
| 50 | 57 |
| 51 // Time taken in last set of Render() calls. | 58 // Time taken in last set of Render() calls. |
| 52 base::TimeDelta playback_time_; | 59 base::TimeDelta playback_time_; |
| 53 | 60 |
| 54 DISALLOW_COPY_AND_ASSIGN(ClocklessAudioSink); | 61 DISALLOW_COPY_AND_ASSIGN(ClocklessAudioSink); |
| 55 }; | 62 }; |
| 56 | 63 |
| 57 } // namespace media | 64 } // namespace media |
| 58 | 65 |
| 59 #endif // MEDIA_AUDIO_CLOCKLESS_AUDIO_SINK_H_ | 66 #endif // MEDIA_AUDIO_CLOCKLESS_AUDIO_SINK_H_ |
| OLD | NEW |