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 VideoFrame; | 21 class VideoFrame; |
21 | 22 |
22 class MEDIA_EXPORT Renderer { | 23 class MEDIA_EXPORT Renderer { |
23 public: | 24 public: |
24 Renderer(); | 25 Renderer(); |
25 | 26 |
26 // Stops rendering and fires any pending callbacks. | 27 // Stops rendering and fires any pending callbacks. |
27 virtual ~Renderer(); | 28 virtual ~Renderer(); |
28 | 29 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 | 71 |
71 // Returns the current media time. | 72 // Returns the current media time. |
72 virtual base::TimeDelta GetMediaTime() = 0; | 73 virtual base::TimeDelta GetMediaTime() = 0; |
73 | 74 |
74 // Returns whether |this| renders audio. | 75 // Returns whether |this| renders audio. |
75 virtual bool HasAudio() = 0; | 76 virtual bool HasAudio() = 0; |
76 | 77 |
77 // Returns whether |this| renders video. | 78 // Returns whether |this| renders video. |
78 virtual bool HasVideo() = 0; | 79 virtual bool HasVideo() = 0; |
79 | 80 |
| 81 // Notifies renderer that the set of enabled audio streams/tracks has changed. |
| 82 // The input parameter |enabledAudioStreams| might be empty, which means that |
| 83 // all audio tracks should be disabled/muted. |
| 84 virtual void OnEnabledAudioStreamsChanged( |
| 85 const std::vector<const DemuxerStream*>& enabledAudioStreams) {} |
| 86 |
| 87 // Notifies renderer that the selected video stream has changed. The input |
| 88 // parameter |selectedVideoStream| can be null, which means video is disabled. |
| 89 virtual void OnSelectedVideoStreamChanged( |
| 90 const DemuxerStream* selectedVideoStream) {} |
| 91 |
80 private: | 92 private: |
81 DISALLOW_COPY_AND_ASSIGN(Renderer); | 93 DISALLOW_COPY_AND_ASSIGN(Renderer); |
82 }; | 94 }; |
83 | 95 |
84 } // namespace media | 96 } // namespace media |
85 | 97 |
86 #endif // MEDIA_BASE_RENDERER_H_ | 98 #endif // MEDIA_BASE_RENDERER_H_ |
OLD | NEW |