| OLD | NEW |
| 1 // Copyright (c) 2008-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2008-2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be found | 2 // Use of this source code is governed by a BSD-style license that can be found |
| 3 // in the LICENSE file. | 3 // in the LICENSE file. |
| 4 // | 4 // |
| 5 // Delegate calls from WebCore::MediaPlayerPrivate to Chrome's video player. | 5 // Delegate calls from WebCore::MediaPlayerPrivate to Chrome's video player. |
| 6 // It contains PipelineImpl which is the actual media player pipeline, it glues | 6 // It contains PipelineImpl which is the actual media player pipeline, it glues |
| 7 // the media player pipeline, data source, audio renderer and renderer. | 7 // the media player pipeline, data source, audio renderer and renderer. |
| 8 // PipelineImpl would creates multiple threads and access some public methods | 8 // PipelineImpl would creates multiple threads and access some public methods |
| 9 // of this class, so we need to be extra careful about concurrent access of | 9 // of this class, so we need to be extra careful about concurrent access of |
| 10 // methods and members. | 10 // methods and members. |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 | 99 |
| 100 // Public methods called from WebMediaPlayerImpl. | 100 // Public methods called from WebMediaPlayerImpl. |
| 101 void Paint(skia::PlatformCanvas* canvas, const gfx::Rect& dest_rect); | 101 void Paint(skia::PlatformCanvas* canvas, const gfx::Rect& dest_rect); |
| 102 void SetSize(const gfx::Rect& rect); | 102 void SetSize(const gfx::Rect& rect); |
| 103 void Detach(); | 103 void Detach(); |
| 104 | 104 |
| 105 // Public methods called from the pipeline via callback issued by | 105 // Public methods called from the pipeline via callback issued by |
| 106 // WebMediaPlayerImpl. | 106 // WebMediaPlayerImpl. |
| 107 void PipelineInitializationCallback(); | 107 void PipelineInitializationCallback(); |
| 108 void PipelineSeekCallback(); | 108 void PipelineSeekCallback(); |
| 109 void PipelineEndedCallback(); |
| 109 void PipelineErrorCallback(); | 110 void PipelineErrorCallback(); |
| 110 | 111 |
| 111 private: | 112 private: |
| 112 // Invoke |webmediaplayer_| to perform a repaint. | 113 // Invoke |webmediaplayer_| to perform a repaint. |
| 113 void RepaintTask(); | 114 void RepaintTask(); |
| 114 | 115 |
| 115 // Notify |webmediaplayer_| that initialization has finished. | 116 // Notify |webmediaplayer_| that initialization has finished. |
| 116 void PipelineInitializationTask(); | 117 void PipelineInitializationTask(); |
| 117 | 118 |
| 118 // Notify |webmediaplayer_| that a seek has finished. | 119 // Notify |webmediaplayer_| that a seek has finished. |
| 119 void PipelineSeekTask(); | 120 void PipelineSeekTask(); |
| 120 | 121 |
| 122 // Notify |webmediaplayer_| that the media has ended. |
| 123 void PipelineEndedTask(); |
| 124 |
| 121 // Notify |webmediaplayer_| that a pipeline error has been set. | 125 // Notify |webmediaplayer_| that a pipeline error has been set. |
| 122 void PipelineErrorTask(); | 126 void PipelineErrorTask(); |
| 123 | 127 |
| 124 // The render message loop where WebKit lives. | 128 // The render message loop where WebKit lives. |
| 125 MessageLoop* render_loop_; | 129 MessageLoop* render_loop_; |
| 126 WebMediaPlayerImpl* webmediaplayer_; | 130 WebMediaPlayerImpl* webmediaplayer_; |
| 127 scoped_refptr<VideoRendererImpl> video_renderer_; | 131 scoped_refptr<VideoRendererImpl> video_renderer_; |
| 128 | 132 |
| 129 Lock lock_; | 133 Lock lock_; |
| 130 int outstanding_repaints_; | 134 int outstanding_repaints_; |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 // |main_loop_| is being destroyed and we can stop posting repaint task | 217 // |main_loop_| is being destroyed and we can stop posting repaint task |
| 214 // to it. | 218 // to it. |
| 215 virtual void WillDestroyCurrentMessageLoop(); | 219 virtual void WillDestroyCurrentMessageLoop(); |
| 216 | 220 |
| 217 void Repaint(); | 221 void Repaint(); |
| 218 | 222 |
| 219 void OnPipelineInitialize(); | 223 void OnPipelineInitialize(); |
| 220 | 224 |
| 221 void OnPipelineSeek(); | 225 void OnPipelineSeek(); |
| 222 | 226 |
| 227 void OnPipelineEnded(); |
| 228 |
| 223 void OnPipelineError(); | 229 void OnPipelineError(); |
| 224 | 230 |
| 225 private: | 231 private: |
| 226 // Helpers that set the network/ready state and notifies the client if | 232 // Helpers that set the network/ready state and notifies the client if |
| 227 // they've changed. | 233 // they've changed. |
| 228 void SetNetworkState(WebKit::WebMediaPlayer::NetworkState state); | 234 void SetNetworkState(WebKit::WebMediaPlayer::NetworkState state); |
| 229 void SetReadyState(WebKit::WebMediaPlayer::ReadyState state); | 235 void SetReadyState(WebKit::WebMediaPlayer::ReadyState state); |
| 230 | 236 |
| 231 // Destroy resources held. | 237 // Destroy resources held. |
| 232 void Destroy(); | 238 void Destroy(); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 261 WebKit::WebMediaPlayerClient* client_; | 267 WebKit::WebMediaPlayerClient* client_; |
| 262 | 268 |
| 263 scoped_refptr<Proxy> proxy_; | 269 scoped_refptr<Proxy> proxy_; |
| 264 | 270 |
| 265 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerImpl); | 271 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerImpl); |
| 266 }; | 272 }; |
| 267 | 273 |
| 268 } // namespace webkit_glue | 274 } // namespace webkit_glue |
| 269 | 275 |
| 270 #endif // WEBKIT_GLUE_WEBMEDIAPLAYER_IMPL_H_ | 276 #endif // WEBKIT_GLUE_WEBMEDIAPLAYER_IMPL_H_ |
| OLD | NEW |