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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 const TimeCB& time_cb, | 50 const TimeCB& time_cb, |
51 const base::Closure& ended_cb, | 51 const base::Closure& ended_cb, |
52 const PipelineStatusCB& error_cb, | 52 const PipelineStatusCB& error_cb, |
53 const TimeDeltaCB& get_time_cb, | 53 const TimeDeltaCB& get_time_cb, |
54 const TimeDeltaCB& get_duration_cb) = 0; | 54 const TimeDeltaCB& get_duration_cb) = 0; |
55 | 55 |
56 // Start audio decoding and rendering at the current playback rate, executing | 56 // Start audio decoding and rendering at the current playback rate, executing |
57 // |callback| when playback is underway. | 57 // |callback| when playback is underway. |
58 virtual void Play(const base::Closure& callback) = 0; | 58 virtual void Play(const base::Closure& callback) = 0; |
59 | 59 |
60 // Temporarily suspend decoding and rendering video, executing |callback| when | 60 // Discard any video data and stop reading from |stream|, executing |callback| |
61 // playback has been suspended. | 61 // when completed. |
62 virtual void Pause(const base::Closure& callback) = 0; | |
63 | |
64 // Discard any video data, executing |callback| when completed. | |
65 virtual void Flush(const base::Closure& callback) = 0; | 62 virtual void Flush(const base::Closure& callback) = 0; |
66 | 63 |
67 // Start prerolling video data. If |time| equals kNoTimestamp() then all | 64 // Start prerolling video data. If |time| equals kNoTimestamp() then all |
68 // samples delivered to the renderer are used to complete preroll. If |time| | 65 // samples delivered to the renderer are used to complete preroll. If |time| |
69 // does not equal kNoTimestamp(), then any samples delivered to the renderer | 66 // does not equal kNoTimestamp(), then any samples delivered to the renderer |
70 // with timestamps less than |time| are silently dropped and not used to | 67 // with timestamps less than |time| are silently dropped and not used to |
71 // satisfy preroll. |callback| is executed when preroll has completed. | 68 // satisfy preroll. |callback| is executed when preroll has completed. |
72 // | 69 // |
73 // Only valid to call after a successful Initialize(), Pause(), or Flush(). | 70 // Only valid to call after a successful Initialize(), Pause(), or Flush(). |
74 virtual void Preroll(base::TimeDelta time, | 71 virtual void Preroll(base::TimeDelta time, |
75 const PipelineStatusCB& callback) = 0; | 72 const PipelineStatusCB& callback) = 0; |
76 | 73 |
77 // Stop all operations in preparation for being deleted, executing |callback| | 74 // Stop all operations in preparation for being deleted, executing |callback| |
78 // when complete. | 75 // when complete. |
79 virtual void Stop(const base::Closure& callback) = 0; | 76 virtual void Stop(const base::Closure& callback) = 0; |
80 | 77 |
81 // Updates the current playback rate. | 78 // Updates the current playback rate. |
82 virtual void SetPlaybackRate(float playback_rate) = 0; | 79 virtual void SetPlaybackRate(float playback_rate) = 0; |
83 | 80 |
84 private: | 81 private: |
85 DISALLOW_COPY_AND_ASSIGN(VideoRenderer); | 82 DISALLOW_COPY_AND_ASSIGN(VideoRenderer); |
86 }; | 83 }; |
87 | 84 |
88 } // namespace media | 85 } // namespace media |
89 | 86 |
90 #endif // MEDIA_BASE_VIDEO_RENDERER_H_ | 87 #endif // MEDIA_BASE_VIDEO_RENDERER_H_ |
OLD | NEW |