| 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 WEBKIT_MEDIA_WEBMEDIAPLAYER_PROXY_H_ | 5 #ifndef WEBKIT_MEDIA_WEBMEDIAPLAYER_PROXY_H_ |
| 6 #define WEBKIT_MEDIA_WEBMEDIAPLAYER_PROXY_H_ | 6 #define WEBKIT_MEDIA_WEBMEDIAPLAYER_PROXY_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 } | 55 } |
| 56 | 56 |
| 57 // TODO(scherkus): remove this once VideoRendererBase::PaintCB passes | 57 // TODO(scherkus): remove this once VideoRendererBase::PaintCB passes |
| 58 // ownership of the VideoFrame http://crbug.com/108435 | 58 // ownership of the VideoFrame http://crbug.com/108435 |
| 59 void set_frame_provider(media::VideoRendererBase* frame_provider) { | 59 void set_frame_provider(media::VideoRendererBase* frame_provider) { |
| 60 frame_provider_ = frame_provider; | 60 frame_provider_ = frame_provider; |
| 61 } | 61 } |
| 62 | 62 |
| 63 // Methods for Filter -> WebMediaPlayerImpl communication. | 63 // Methods for Filter -> WebMediaPlayerImpl communication. |
| 64 void Repaint(); | 64 void Repaint(); |
| 65 void SetOpaque(bool opaque); | |
| 66 | 65 |
| 67 // Methods for WebMediaPlayerImpl -> Filter communication. | 66 // Methods for WebMediaPlayerImpl -> Filter communication. |
| 68 void Paint(SkCanvas* canvas, const gfx::Rect& dest_rect, uint8_t alpha); | 67 void Paint(SkCanvas* canvas, const gfx::Rect& dest_rect, uint8_t alpha); |
| 69 void Detach(); | 68 void Detach(); |
| 70 void GetCurrentFrame(scoped_refptr<media::VideoFrame>* frame_out); | 69 void GetCurrentFrame(scoped_refptr<media::VideoFrame>* frame_out); |
| 71 void PutCurrentFrame(scoped_refptr<media::VideoFrame> frame); | 70 void PutCurrentFrame(scoped_refptr<media::VideoFrame> frame); |
| 72 bool HasSingleOrigin(); | 71 bool HasSingleOrigin(); |
| 73 bool DidPassCORSAccessCheck() const; | 72 bool DidPassCORSAccessCheck() const; |
| 74 | 73 |
| 75 void AbortDataSource(); | 74 void AbortDataSource(); |
| 76 | 75 |
| 77 // Methods for Pipeline -> WebMediaPlayerImpl communication. | |
| 78 void PipelineSeekCallback(media::PipelineStatus status); | |
| 79 void PipelineEndedCallback(media::PipelineStatus status); | |
| 80 void PipelineErrorCallback(media::PipelineStatus error); | |
| 81 void PipelineBufferingStateCallback( | |
| 82 media::Pipeline::BufferingState buffering_state); | |
| 83 | |
| 84 // ChunkDemuxerClient implementation. | 76 // ChunkDemuxerClient implementation. |
| 85 virtual void DemuxerOpened(media::ChunkDemuxer* demuxer) OVERRIDE; | 77 virtual void DemuxerOpened(media::ChunkDemuxer* demuxer) OVERRIDE; |
| 86 virtual void DemuxerClosed() OVERRIDE; | 78 virtual void DemuxerClosed() OVERRIDE; |
| 87 virtual void DemuxerNeedKey(scoped_array<uint8> init_data, | 79 virtual void DemuxerNeedKey(scoped_array<uint8> init_data, |
| 88 int init_data_size) OVERRIDE; | 80 int init_data_size) OVERRIDE; |
| 89 | 81 |
| 90 // Methods for Demuxer communication. | 82 // Methods for Demuxer communication. |
| 91 void DemuxerStartWaitingForSeek(); | 83 void DemuxerStartWaitingForSeek(); |
| 92 void DemuxerCancelPendingSeek(); | 84 void DemuxerCancelPendingSeek(); |
| 93 media::ChunkDemuxer::Status DemuxerAddId(const std::string& id, | 85 media::ChunkDemuxer::Status DemuxerAddId(const std::string& id, |
| (...skipping 24 matching lines...) Expand all Loading... |
| 118 scoped_array<uint8> init_data, | 110 scoped_array<uint8> init_data, |
| 119 int init_data_size) OVERRIDE; | 111 int init_data_size) OVERRIDE; |
| 120 | 112 |
| 121 private: | 113 private: |
| 122 friend class base::RefCountedThreadSafe<WebMediaPlayerProxy>; | 114 friend class base::RefCountedThreadSafe<WebMediaPlayerProxy>; |
| 123 virtual ~WebMediaPlayerProxy(); | 115 virtual ~WebMediaPlayerProxy(); |
| 124 | 116 |
| 125 // Invoke |webmediaplayer_| to perform a repaint. | 117 // Invoke |webmediaplayer_| to perform a repaint. |
| 126 void RepaintTask(); | 118 void RepaintTask(); |
| 127 | 119 |
| 128 // Notify |webmediaplayer_| that a seek has finished. | |
| 129 void PipelineSeekTask(media::PipelineStatus status); | |
| 130 | |
| 131 // Notify |webmediaplayer_| that the media has ended. | |
| 132 void PipelineEndedTask(media::PipelineStatus status); | |
| 133 | |
| 134 // Notify |webmediaplayer_| that a pipeline error has occurred during | |
| 135 // playback. | |
| 136 void PipelineErrorTask(media::PipelineStatus error); | |
| 137 | |
| 138 // Notify |webmediaplayer_| of buffering state changes. | |
| 139 void PipelineBufferingStateTask( | |
| 140 media::Pipeline::BufferingState buffering_state); | |
| 141 | |
| 142 // Inform |webmediaplayer_| whether the video content is opaque. | |
| 143 void SetOpaqueTask(bool opaque); | |
| 144 | |
| 145 void DemuxerOpenedTask(const scoped_refptr<media::ChunkDemuxer>& demuxer); | 120 void DemuxerOpenedTask(const scoped_refptr<media::ChunkDemuxer>& demuxer); |
| 146 void DemuxerClosedTask(); | 121 void DemuxerClosedTask(); |
| 147 | 122 |
| 148 // Notify |webmediaplayer_| that a key has been added. | 123 // Notify |webmediaplayer_| that a key has been added. |
| 149 void KeyAddedTask(const std::string& key_system, | 124 void KeyAddedTask(const std::string& key_system, |
| 150 const std::string& session_id); | 125 const std::string& session_id); |
| 151 | 126 |
| 152 // Notify |webmediaplayer_| that a key error occurred. | 127 // Notify |webmediaplayer_| that a key error occurred. |
| 153 void KeyErrorTask(const std::string& key_system, | 128 void KeyErrorTask(const std::string& key_system, |
| 154 const std::string& session_id, | 129 const std::string& session_id, |
| (...skipping 25 matching lines...) Expand all Loading... |
| 180 int outstanding_repaints_; | 155 int outstanding_repaints_; |
| 181 | 156 |
| 182 scoped_refptr<media::ChunkDemuxer> chunk_demuxer_; | 157 scoped_refptr<media::ChunkDemuxer> chunk_demuxer_; |
| 183 | 158 |
| 184 DISALLOW_IMPLICIT_CONSTRUCTORS(WebMediaPlayerProxy); | 159 DISALLOW_IMPLICIT_CONSTRUCTORS(WebMediaPlayerProxy); |
| 185 }; | 160 }; |
| 186 | 161 |
| 187 } // namespace webkit_media | 162 } // namespace webkit_media |
| 188 | 163 |
| 189 #endif // WEBKIT_MEDIA_WEBMEDIAPLAYER_PROXY_H_ | 164 #endif // WEBKIT_MEDIA_WEBMEDIAPLAYER_PROXY_H_ |
| OLD | NEW |