| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_BASE_AUDIO_RENDERER_H_ | 5 #ifndef MEDIA_BASE_AUDIO_RENDERER_H_ |
| 6 #define MEDIA_BASE_AUDIO_RENDERER_H_ | 6 #define MEDIA_BASE_AUDIO_RENDERER_H_ |
| 7 | 7 |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 virtual void Initialize(DemuxerStream* stream, | 42 virtual void Initialize(DemuxerStream* stream, |
| 43 const PipelineStatusCB& init_cb, | 43 const PipelineStatusCB& init_cb, |
| 44 const StatisticsCB& statistics_cb, | 44 const StatisticsCB& statistics_cb, |
| 45 const base::Closure& underflow_cb, | 45 const base::Closure& underflow_cb, |
| 46 const TimeCB& time_cb, | 46 const TimeCB& time_cb, |
| 47 const base::Closure& ended_cb, | 47 const base::Closure& ended_cb, |
| 48 const PipelineStatusCB& error_cb) = 0; | 48 const PipelineStatusCB& error_cb) = 0; |
| 49 | 49 |
| 50 // Signal audio playback to start at the current rate. It is expected that | 50 // Signal audio playback to start at the current rate. It is expected that |
| 51 // |time_cb| will eventually start being run with time updates. | 51 // |time_cb| will eventually start being run with time updates. |
| 52 virtual void StartRendering() = 0; | 52 virtual void Play() = 0; |
| 53 | 53 |
| 54 // Signal audio playback to stop until further notice. It is expected that | 54 // Signal audio playback to stop until further notice. It is expected that |
| 55 // |time_cb| will no longer be run. | 55 // |time_cb| will no longer be run. |
| 56 virtual void StopRendering() = 0; | 56 virtual void Pause() = 0; |
| 57 | 57 |
| 58 // Discard any audio data, executing |callback| when completed. | 58 // Discard any audio data, executing |callback| when completed. |
| 59 virtual void Flush(const base::Closure& callback) = 0; | 59 virtual void Flush(const base::Closure& callback) = 0; |
| 60 | 60 |
| 61 // Start prerolling audio data for samples starting at |time|, executing | 61 // Start prerolling audio data for samples starting at |time|, executing |
| 62 // |callback| when completed. | 62 // |callback| when completed. |
| 63 // | 63 // |
| 64 // Only valid to call after a successful Initialize() or Flush(). | 64 // Only valid to call after a successful Initialize() or Flush(). |
| 65 virtual void Preroll(base::TimeDelta time, | 65 virtual void Preroll(base::TimeDelta time, |
| 66 const PipelineStatusCB& callback) = 0; | 66 const PipelineStatusCB& callback) = 0; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 78 // Resumes playback after underflow occurs. | 78 // Resumes playback after underflow occurs. |
| 79 virtual void ResumeAfterUnderflow() = 0; | 79 virtual void ResumeAfterUnderflow() = 0; |
| 80 | 80 |
| 81 private: | 81 private: |
| 82 DISALLOW_COPY_AND_ASSIGN(AudioRenderer); | 82 DISALLOW_COPY_AND_ASSIGN(AudioRenderer); |
| 83 }; | 83 }; |
| 84 | 84 |
| 85 } // namespace media | 85 } // namespace media |
| 86 | 86 |
| 87 #endif // MEDIA_BASE_AUDIO_RENDERER_H_ | 87 #endif // MEDIA_BASE_AUDIO_RENDERER_H_ |
| OLD | NEW |