Chromium Code Reviews| 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/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 36 // destruction of the caller, so it must be run only prior to returning. | 36 // destruction of the caller, so it must be run only prior to returning. |
| 37 // | 37 // |
| 38 // Permanent callbacks: | 38 // Permanent callbacks: |
| 39 // - |statistics_cb|: Executed periodically with rendering statistics. | 39 // - |statistics_cb|: Executed periodically with rendering statistics. |
| 40 // - |buffering_state_cb|: Executed when buffering state is changed. | 40 // - |buffering_state_cb|: Executed when buffering state is changed. |
| 41 // - |paint_cb|: Executed when there is a VideoFrame ready to paint. Can be | 41 // - |paint_cb|: Executed when there is a VideoFrame ready to paint. Can be |
| 42 // ignored if the Renderer handles the painting by itself. Can | 42 // ignored if the Renderer handles the painting by itself. Can |
| 43 // be called from any thread. | 43 // be called from any thread. |
| 44 // - |ended_cb|: Executed when rendering has reached the end of stream. | 44 // - |ended_cb|: Executed when rendering has reached the end of stream. |
| 45 // - |error_cb|: Executed if any error was encountered after initialization. | 45 // - |error_cb|: Executed if any error was encountered after initialization. |
| 46 virtual void Initialize(DemuxerStreamProvider* demuxer_stream_provider, | 46 // - |waiting_for_encryption_key_cb|: Executed whenever a stream needs a |
|
ddorwin
2015/02/19 05:33:17
dittos
jrummell
2015/02/23 22:06:32
Done.
| |
| 47 const PipelineStatusCB& init_cb, | 47 // new key provided in order to decrypt |
| 48 const StatisticsCB& statistics_cb, | 48 // the stream. |
| 49 const BufferingStateCB& buffering_state_cb, | 49 virtual void Initialize( |
| 50 const PaintCB& paint_cb, | 50 DemuxerStreamProvider* demuxer_stream_provider, |
| 51 const base::Closure& ended_cb, | 51 const PipelineStatusCB& init_cb, |
| 52 const PipelineStatusCB& error_cb) = 0; | 52 const StatisticsCB& statistics_cb, |
| 53 const BufferingStateCB& buffering_state_cb, | |
| 54 const PaintCB& paint_cb, | |
| 55 const base::Closure& ended_cb, | |
| 56 const PipelineStatusCB& error_cb, | |
| 57 const base::Closure& waiting_for_encryption_key_cb) = 0; | |
| 53 | 58 |
| 54 // Associates the |cdm_context| with this Renderer for decryption (and | 59 // Associates the |cdm_context| with this Renderer for decryption (and |
| 55 // decoding) of media data, then fires |cdm_attached_cb| with the result. | 60 // decoding) of media data, then fires |cdm_attached_cb| with the result. |
| 56 virtual void SetCdm(CdmContext* cdm_context, | 61 virtual void SetCdm(CdmContext* cdm_context, |
| 57 const CdmAttachedCB& cdm_attached_cb) = 0; | 62 const CdmAttachedCB& cdm_attached_cb) = 0; |
| 58 | 63 |
| 59 // The following functions must be called after Initialize(). | 64 // The following functions must be called after Initialize(). |
| 60 | 65 |
| 61 // Discards any buffered data, executing |flush_cb| when completed. | 66 // Discards any buffered data, executing |flush_cb| when completed. |
| 62 virtual void Flush(const base::Closure& flush_cb) = 0; | 67 virtual void Flush(const base::Closure& flush_cb) = 0; |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 79 // Returns whether |this| renders video. | 84 // Returns whether |this| renders video. |
| 80 virtual bool HasVideo() = 0; | 85 virtual bool HasVideo() = 0; |
| 81 | 86 |
| 82 private: | 87 private: |
| 83 DISALLOW_COPY_AND_ASSIGN(Renderer); | 88 DISALLOW_COPY_AND_ASSIGN(Renderer); |
| 84 }; | 89 }; |
| 85 | 90 |
| 86 } // namespace media | 91 } // namespace media |
| 87 | 92 |
| 88 #endif // MEDIA_BASE_RENDERER_H_ | 93 #endif // MEDIA_BASE_RENDERER_H_ |
| OLD | NEW |