| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_RENDERER_H_ | 5 #ifndef MEDIA_BASE_RENDERER_H_ |
| 6 #define MEDIA_BASE_RENDERER_H_ | 6 #define MEDIA_BASE_RENDERER_H_ |
| 7 | 7 |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
| 10 #include "media/base/buffering_state.h" | 10 #include "media/base/buffering_state.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 // | 30 // |
| 31 // Permanent callbacks: | 31 // Permanent callbacks: |
| 32 // - |statistics_cb|: Executed periodically with rendering statistics. | 32 // - |statistics_cb|: Executed periodically with rendering statistics. |
| 33 // - |time_cb|: Executed whenever time has advanced through rendering. | 33 // - |time_cb|: Executed whenever time has advanced through rendering. |
| 34 // - |ended_cb|: Executed when rendering has reached the end of stream. | 34 // - |ended_cb|: Executed when rendering has reached the end of stream. |
| 35 // - |error_cb|: Executed if any error was encountered during rendering. | 35 // - |error_cb|: Executed if any error was encountered during rendering. |
| 36 virtual void Initialize(const base::Closure& init_cb, | 36 virtual void Initialize(const base::Closure& init_cb, |
| 37 const StatisticsCB& statistics_cb, | 37 const StatisticsCB& statistics_cb, |
| 38 const base::Closure& ended_cb, | 38 const base::Closure& ended_cb, |
| 39 const PipelineStatusCB& error_cb, | 39 const PipelineStatusCB& error_cb, |
| 40 const BufferingStateCB& buffering_state_cb) = 0; | 40 const BufferingStateCB& buffering_state_cb, |
| 41 const TimeDeltaCB& get_duration_cb) = 0; |
| 41 | 42 |
| 42 // The following functions must be called after Initialize(). | 43 // The following functions must be called after Initialize(). |
| 43 | 44 |
| 44 // Discards any buffered data, executing |flush_cb| when completed. | 45 // Discards any buffered data, executing |flush_cb| when completed. |
| 45 virtual void Flush(const base::Closure& flush_cb) = 0; | 46 virtual void Flush(const base::Closure& flush_cb) = 0; |
| 46 | 47 |
| 47 // Starts rendering from |time|. | 48 // Starts rendering from |time|. |
| 48 virtual void StartPlayingFrom(base::TimeDelta time) = 0; | 49 virtual void StartPlayingFrom(base::TimeDelta time) = 0; |
| 49 | 50 |
| 50 // Updates the current playback rate. The default playback rate should be 1. | 51 // Updates the current playback rate. The default playback rate should be 1. |
| (...skipping 14 matching lines...) Expand all Loading... |
| 65 // Associates the |cdm| with this Renderer. | 66 // Associates the |cdm| with this Renderer. |
| 66 virtual void SetCdm(MediaKeys* cdm) = 0; | 67 virtual void SetCdm(MediaKeys* cdm) = 0; |
| 67 | 68 |
| 68 private: | 69 private: |
| 69 DISALLOW_COPY_AND_ASSIGN(Renderer); | 70 DISALLOW_COPY_AND_ASSIGN(Renderer); |
| 70 }; | 71 }; |
| 71 | 72 |
| 72 } // namespace media | 73 } // namespace media |
| 73 | 74 |
| 74 #endif // MEDIA_BASE_RENDERER_H_ | 75 #endif // MEDIA_BASE_RENDERER_H_ |
| OLD | NEW |