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/macros.h" | 9 #include "base/macros.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
11 #include "base/time/time.h" | 11 #include "base/time/time.h" |
12 #include "media/base/buffering_state.h" | 12 #include "media/base/buffering_state.h" |
13 #include "media/base/cdm_context.h" | 13 #include "media/base/cdm_context.h" |
14 #include "media/base/media_export.h" | 14 #include "media/base/media_export.h" |
15 #include "media/base/pipeline_status.h" | 15 #include "media/base/pipeline_status.h" |
16 | 16 |
17 namespace media { | 17 namespace media { |
18 | 18 |
| 19 class DemuxerStream; |
19 class DemuxerStreamProvider; | 20 class DemuxerStreamProvider; |
20 class RendererClient; | 21 class RendererClient; |
21 class VideoFrame; | 22 class VideoFrame; |
22 | 23 |
23 class MEDIA_EXPORT Renderer { | 24 class MEDIA_EXPORT Renderer { |
24 public: | 25 public: |
25 Renderer(); | 26 Renderer(); |
26 | 27 |
27 // Stops rendering and fires any pending callbacks. | 28 // Stops rendering and fires any pending callbacks. |
28 virtual ~Renderer(); | 29 virtual ~Renderer(); |
(...skipping 13 matching lines...) Expand all Loading... |
42 const CdmAttachedCB& cdm_attached_cb) = 0; | 43 const CdmAttachedCB& cdm_attached_cb) = 0; |
43 | 44 |
44 // The following functions must be called after Initialize(). | 45 // The following functions must be called after Initialize(). |
45 | 46 |
46 // Discards any buffered data, executing |flush_cb| when completed. | 47 // Discards any buffered data, executing |flush_cb| when completed. |
47 virtual void Flush(const base::Closure& flush_cb) = 0; | 48 virtual void Flush(const base::Closure& flush_cb) = 0; |
48 | 49 |
49 // Starts rendering from |time|. | 50 // Starts rendering from |time|. |
50 virtual void StartPlayingFrom(base::TimeDelta time) = 0; | 51 virtual void StartPlayingFrom(base::TimeDelta time) = 0; |
51 | 52 |
| 53 virtual void RestartStreamPlayback(DemuxerStream* stream, |
| 54 base::TimeDelta time) = 0; |
| 55 |
52 // Updates the current playback rate. The default playback rate should be 1. | 56 // Updates the current playback rate. The default playback rate should be 1. |
53 virtual void SetPlaybackRate(double playback_rate) = 0; | 57 virtual void SetPlaybackRate(double playback_rate) = 0; |
54 | 58 |
55 // Sets the output volume. The default volume should be 1. | 59 // Sets the output volume. The default volume should be 1. |
56 virtual void SetVolume(float volume) = 0; | 60 virtual void SetVolume(float volume) = 0; |
57 | 61 |
58 // Returns the current media time. | 62 // Returns the current media time. |
59 virtual base::TimeDelta GetMediaTime() = 0; | 63 virtual base::TimeDelta GetMediaTime() = 0; |
60 | 64 |
61 // Returns whether |this| renders audio. | 65 // Returns whether |this| renders audio. |
62 virtual bool HasAudio() = 0; | 66 virtual bool HasAudio() = 0; |
63 | 67 |
64 // Returns whether |this| renders video. | 68 // Returns whether |this| renders video. |
65 virtual bool HasVideo() = 0; | 69 virtual bool HasVideo() = 0; |
66 | 70 |
67 private: | 71 private: |
68 DISALLOW_COPY_AND_ASSIGN(Renderer); | 72 DISALLOW_COPY_AND_ASSIGN(Renderer); |
69 }; | 73 }; |
70 | 74 |
71 } // namespace media | 75 } // namespace media |
72 | 76 |
73 #endif // MEDIA_BASE_RENDERER_H_ | 77 #endif // MEDIA_BASE_RENDERER_H_ |
OLD | NEW |