| 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_VIDEO_RENDERER_H_ | 5 #ifndef MEDIA_BASE_VIDEO_RENDERER_H_ |
| 6 #define MEDIA_BASE_VIDEO_RENDERER_H_ | 6 #define MEDIA_BASE_VIDEO_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 24 matching lines...) Expand all Loading... |
| 35 // | 35 // |
| 36 // |buffering_state_cb| is executed when video rendering has either run out of | 36 // |buffering_state_cb| is executed when video rendering has either run out of |
| 37 // data or has enough data to continue playback. | 37 // data or has enough data to continue playback. |
| 38 // | 38 // |
| 39 // |ended_cb| is executed when video rendering has reached the end of stream. | 39 // |ended_cb| is executed when video rendering has reached the end of stream. |
| 40 // | 40 // |
| 41 // |error_cb| is executed if an error was encountered. | 41 // |error_cb| is executed if an error was encountered. |
| 42 // | 42 // |
| 43 // |get_time_cb| is used to query the current media playback time. | 43 // |get_time_cb| is used to query the current media playback time. |
| 44 virtual void Initialize(DemuxerStream* stream, | 44 virtual void Initialize(DemuxerStream* stream, |
| 45 bool low_delay, | |
| 46 const PipelineStatusCB& init_cb, | 45 const PipelineStatusCB& init_cb, |
| 47 const StatisticsCB& statistics_cb, | 46 const StatisticsCB& statistics_cb, |
| 48 const BufferingStateCB& buffering_state_cb, | 47 const BufferingStateCB& buffering_state_cb, |
| 49 const base::Closure& ended_cb, | 48 const base::Closure& ended_cb, |
| 50 const PipelineStatusCB& error_cb, | 49 const PipelineStatusCB& error_cb, |
| 51 const TimeDeltaCB& get_time_cb) = 0; | 50 const TimeDeltaCB& get_time_cb) = 0; |
| 52 | 51 |
| 53 // Discards any video data and stops reading from |stream|, executing | 52 // Discards any video data and stops reading from |stream|, executing |
| 54 // |callback| when completed. | 53 // |callback| when completed. |
| 55 // | 54 // |
| 56 // Clients should expect |buffering_state_cb| to be called with | 55 // Clients should expect |buffering_state_cb| to be called with |
| 57 // BUFFERING_HAVE_NOTHING while flushing is in progress. | 56 // BUFFERING_HAVE_NOTHING while flushing is in progress. |
| 58 virtual void Flush(const base::Closure& callback) = 0; | 57 virtual void Flush(const base::Closure& callback) = 0; |
| 59 | 58 |
| 60 // Starts playback at |timestamp| by reading from |stream| and decoding and | 59 // Starts playback at |timestamp| by reading from |stream| and decoding and |
| 61 // rendering video. | 60 // rendering video. |
| 62 // | 61 // |
| 63 // Only valid to call after a successful Initialize() or Flush(). | 62 // Only valid to call after a successful Initialize() or Flush(). |
| 64 virtual void StartPlayingFrom(base::TimeDelta timestamp) = 0; | 63 virtual void StartPlayingFrom(base::TimeDelta timestamp) = 0; |
| 65 | 64 |
| 66 private: | 65 private: |
| 67 DISALLOW_COPY_AND_ASSIGN(VideoRenderer); | 66 DISALLOW_COPY_AND_ASSIGN(VideoRenderer); |
| 68 }; | 67 }; |
| 69 | 68 |
| 70 } // namespace media | 69 } // namespace media |
| 71 | 70 |
| 72 #endif // MEDIA_BASE_VIDEO_RENDERER_H_ | 71 #endif // MEDIA_BASE_VIDEO_RENDERER_H_ |
| OLD | NEW |