OLD | NEW |
---|---|
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_CLIENT_H_ | 5 #ifndef MEDIA_BASE_RENDERER_CLIENT_H_ |
6 #define MEDIA_BASE_RENDERER_CLIENT_H_ | 6 #define MEDIA_BASE_RENDERER_CLIENT_H_ |
7 | 7 |
8 #include "media/base/pipeline_status.h" | |
9 #include "ui/gfx/geometry/size.h" | |
10 | |
8 namespace media { | 11 namespace media { |
9 | 12 |
10 // Interface used by Renderer, AudioRenderer, and VideoRenderer implementations | 13 // Interface used by Renderer, AudioRenderer, and VideoRenderer implementations |
11 // to notify their clients. | 14 // to notify their clients. |
12 class RendererClient { | 15 class RendererClient { |
13 public: | 16 public: |
14 // Executed if any error was encountered after Renderer initialization. | 17 // Executed if any error was encountered after Renderer initialization. |
15 virtual void OnError(PipelineStatus status) = 0; | 18 virtual void OnError(PipelineStatus status) = 0; |
16 | 19 |
17 // Executed when rendering has reached the end of stream. | 20 // Executed when rendering has reached the end of stream. |
18 virtual void OnEnded() = 0; | 21 virtual void OnEnded() = 0; |
19 | 22 |
20 // Executed periodically with rendering statistics. | 23 // Executed periodically with rendering statistics. |
21 virtual void OnStatisticsUpdate(const PipelineStatistics& stats) = 0; | 24 virtual void OnStatisticsUpdate(const PipelineStatistics& stats) = 0; |
22 | 25 |
23 // Executed when buffering state is changed. | 26 // Executed when buffering state is changed. |
24 virtual void OnBufferingStateChange(BufferingState state) = 0; | 27 virtual void OnBufferingStateChange(BufferingState state) = 0; |
25 | 28 |
26 // Executed whenever the key needed to decrypt the stream is not available. | 29 // Executed whenever the key needed to decrypt the stream is not available. |
27 virtual void OnWaitingForDecryptionKey() = 0; | 30 virtual void OnWaitingForDecryptionKey() = 0; |
31 | |
32 // Executed for the first video frame and whenever natural size changes. | |
33 virtual void OnVideoNaturalSizeChange(const gfx::Size& size) = 0; | |
34 | |
35 // Executed for the first video frame and whenever opacity changes. | |
36 virtual void OnVideoOpacityChange(bool opaque) = 0; | |
xhwang
2016/05/17 06:24:12
This client is also used by AudioRenderer, where t
alokp
2016/05/17 16:25:49
Added comment. This is equivalent to DemuxerStream
| |
28 }; | 37 }; |
29 | 38 |
30 } // namespace media | 39 } // namespace media |
31 | 40 |
32 #endif // MEDIA_BASE_RENDERER_CLIENT_H_ | 41 #endif // MEDIA_BASE_RENDERER_CLIENT_H_ |
OLD | NEW |