| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_VIDEO_RENDERER_H_ | 5 #ifndef MEDIA_BASE_VIDEO_RENDERER_H_ |
| 6 #define MEDIA_BASE_VIDEO_RENDERER_H_ | 6 #define MEDIA_BASE_VIDEO_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 27 matching lines...) Expand all Loading... |
| 38 // | 38 // |
| 39 // |set_decryptor_ready_cb| is fired when a Decryptor is needed, i.e. when the | 39 // |set_decryptor_ready_cb| is fired when a Decryptor is needed, i.e. when the |
| 40 // |stream| is encrypted. | 40 // |stream| is encrypted. |
| 41 // | 41 // |
| 42 // |statistics_cb| is executed periodically with video rendering stats, such | 42 // |statistics_cb| is executed periodically with video rendering stats, such |
| 43 // as dropped frames. | 43 // as dropped frames. |
| 44 // | 44 // |
| 45 // |buffering_state_cb| is executed when video rendering has either run out of | 45 // |buffering_state_cb| is executed when video rendering has either run out of |
| 46 // data or has enough data to continue playback. | 46 // data or has enough data to continue playback. |
| 47 // | 47 // |
| 48 // |paint_cb| is executed on the video frame timing thread whenever a new | |
| 49 // frame is available for painting. Can be called from any thread. | |
| 50 // | |
| 51 // |ended_cb| is executed when video rendering has reached the end of stream. | 48 // |ended_cb| is executed when video rendering has reached the end of stream. |
| 52 // | 49 // |
| 53 // |error_cb| is executed if an error was encountered after initialization. | 50 // |error_cb| is executed if an error was encountered after initialization. |
| 54 // | 51 // |
| 55 // |wall_clock_time_cb| is used to convert media timestamps into wallclock | 52 // |wall_clock_time_cb| is used to convert media timestamps into wallclock |
| 56 // timestamps. | 53 // timestamps. |
| 57 // | 54 // |
| 58 // |waiting_for_decryption_key_cb| is executed whenever the key needed to | 55 // |waiting_for_decryption_key_cb| is executed whenever the key needed to |
| 59 // decrypt the stream is not available. | 56 // decrypt the stream is not available. |
| 60 virtual void Initialize( | 57 virtual void Initialize( |
| 61 DemuxerStream* stream, | 58 DemuxerStream* stream, |
| 62 const PipelineStatusCB& init_cb, | 59 const PipelineStatusCB& init_cb, |
| 63 const SetDecryptorReadyCB& set_decryptor_ready_cb, | 60 const SetDecryptorReadyCB& set_decryptor_ready_cb, |
| 64 const StatisticsCB& statistics_cb, | 61 const StatisticsCB& statistics_cb, |
| 65 const BufferingStateCB& buffering_state_cb, | 62 const BufferingStateCB& buffering_state_cb, |
| 66 const PaintCB& paint_cb, | |
| 67 const base::Closure& ended_cb, | 63 const base::Closure& ended_cb, |
| 68 const PipelineStatusCB& error_cb, | 64 const PipelineStatusCB& error_cb, |
| 69 const WallClockTimeCB& wall_clock_time_cb, | 65 const WallClockTimeCB& wall_clock_time_cb, |
| 70 const base::Closure& waiting_for_decryption_key_cb) = 0; | 66 const base::Closure& waiting_for_decryption_key_cb) = 0; |
| 71 | 67 |
| 72 // Discards any video data and stops reading from |stream|, executing | 68 // Discards any video data and stops reading from |stream|, executing |
| 73 // |callback| when completed. | 69 // |callback| when completed. |
| 74 // | 70 // |
| 75 // Clients should expect |buffering_state_cb| to be called with | 71 // Clients should expect |buffering_state_cb| to be called with |
| 76 // BUFFERING_HAVE_NOTHING while flushing is in progress. | 72 // BUFFERING_HAVE_NOTHING while flushing is in progress. |
| (...skipping 10 matching lines...) Expand all Loading... |
| 87 // |time_progressing| will be false. | 83 // |time_progressing| will be false. |
| 88 virtual void OnTimeStateChanged(bool time_progressing) = 0; | 84 virtual void OnTimeStateChanged(bool time_progressing) = 0; |
| 89 | 85 |
| 90 private: | 86 private: |
| 91 DISALLOW_COPY_AND_ASSIGN(VideoRenderer); | 87 DISALLOW_COPY_AND_ASSIGN(VideoRenderer); |
| 92 }; | 88 }; |
| 93 | 89 |
| 94 } // namespace media | 90 } // namespace media |
| 95 | 91 |
| 96 #endif // MEDIA_BASE_VIDEO_RENDERER_H_ | 92 #endif // MEDIA_BASE_VIDEO_RENDERER_H_ |
| OLD | NEW |