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