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" |
(...skipping 17 matching lines...) Expand all Loading... | |
28 | 28 |
29 // Initializes the Renderer with |demuxer_stream_provider|, executing | 29 // Initializes the Renderer with |demuxer_stream_provider|, executing |
30 // |init_cb| upon completion. If initialization fails, only |init_cb| (not | 30 // |init_cb| upon completion. If initialization fails, only |init_cb| (not |
31 // |error_cb|) should be called. |demuxer_stream_provider| must be valid for | 31 // |error_cb|) should be called. |demuxer_stream_provider| must be valid for |
32 // the lifetime of the Renderer object. |init_cb| must only be run after this | 32 // the lifetime of the Renderer object. |init_cb| must only be run after this |
33 // method has returned. Firing |init_cb| may result in the immediate | 33 // method has returned. Firing |init_cb| may result in the immediate |
34 // destruction of the caller, so it must be run only prior to returning. | 34 // destruction of the caller, so it must be run only prior to returning. |
35 // | 35 // |
36 // Permanent callbacks: | 36 // Permanent callbacks: |
37 // - |statistics_cb|: Executed periodically with rendering statistics. | 37 // - |statistics_cb|: Executed periodically with rendering statistics. |
38 // - |buffering_state_cb|: Executed when buffering state is changed. | 38 // - |buffering_state_cb|: Executed when buffering state is changed. |
xhwang
2016/04/12 19:40:37
Add comment for the new callback
alokp
2016/04/19 00:16:07
Done.
| |
39 // - |ended_cb|: Executed when rendering has reached the end of stream. | 39 // - |ended_cb|: Executed when rendering has reached the end of stream. |
40 // - |error_cb|: Executed if any error was encountered after initialization. | 40 // - |error_cb|: Executed if any error was encountered after initialization. |
41 // - |waiting_for_decryption_key_cb|: Executed whenever the key needed to | 41 // - |waiting_for_decryption_key_cb|: Executed whenever the key needed to |
42 // decrypt the stream is not available. | 42 // decrypt the stream is not available. |
43 virtual void Initialize( | 43 virtual void Initialize( |
44 DemuxerStreamProvider* demuxer_stream_provider, | 44 DemuxerStreamProvider* demuxer_stream_provider, |
45 const PipelineStatusCB& init_cb, | 45 const PipelineStatusCB& init_cb, |
46 const StatisticsCB& statistics_cb, | 46 const StatisticsCB& statistics_cb, |
47 const BufferingStateCB& buffering_state_cb, | 47 const BufferingStateCB& buffering_state_cb, |
48 const NaturalSizeChangedCB& natural_size_changed_cb, | |
48 const base::Closure& ended_cb, | 49 const base::Closure& ended_cb, |
49 const PipelineStatusCB& error_cb, | 50 const PipelineStatusCB& error_cb, |
50 const base::Closure& waiting_for_decryption_key_cb) = 0; | 51 const base::Closure& waiting_for_decryption_key_cb) = 0; |
51 | 52 |
52 // Associates the |cdm_context| with this Renderer for decryption (and | 53 // Associates the |cdm_context| with this Renderer for decryption (and |
53 // decoding) of media data, then fires |cdm_attached_cb| with the result. | 54 // decoding) of media data, then fires |cdm_attached_cb| with the result. |
54 virtual void SetCdm(CdmContext* cdm_context, | 55 virtual void SetCdm(CdmContext* cdm_context, |
55 const CdmAttachedCB& cdm_attached_cb) = 0; | 56 const CdmAttachedCB& cdm_attached_cb) = 0; |
56 | 57 |
57 // The following functions must be called after Initialize(). | 58 // The following functions must be called after Initialize(). |
(...skipping 19 matching lines...) Expand all Loading... | |
77 // Returns whether |this| renders video. | 78 // Returns whether |this| renders video. |
78 virtual bool HasVideo() = 0; | 79 virtual bool HasVideo() = 0; |
79 | 80 |
80 private: | 81 private: |
81 DISALLOW_COPY_AND_ASSIGN(Renderer); | 82 DISALLOW_COPY_AND_ASSIGN(Renderer); |
82 }; | 83 }; |
83 | 84 |
84 } // namespace media | 85 } // namespace media |
85 | 86 |
86 #endif // MEDIA_BASE_RENDERER_H_ | 87 #endif // MEDIA_BASE_RENDERER_H_ |
OLD | NEW |