| 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 PipelineErrorCallback(); |
| 109 | 110 |
| 110 private: | 111 private: |
| 111 // Invoke |webmediaplayer_| to perform a repaint. | 112 // Invoke |webmediaplayer_| to perform a repaint. |
| 112 void RepaintTask(); | 113 void RepaintTask(); |
| 113 | 114 |
| 114 // Notify |webmediaplayer_| that initialization has finished. | 115 // Notify |webmediaplayer_| that initialization has finished. |
| 115 void PipelineInitializationTask(); | 116 void PipelineInitializationTask(); |
| 116 | 117 |
| 117 // Notify |webmediaplayer_| that a seek has finished. | 118 // Notify |webmediaplayer_| that a seek has finished. |
| 118 void PipelineSeekTask(); | 119 void PipelineSeekTask(); |
| 119 | 120 |
| 121 // Notify |webmediaplayer_| that a pipeline error has been set. |
| 122 void PipelineErrorTask(); |
| 123 |
| 120 // The render message loop where WebKit lives. | 124 // The render message loop where WebKit lives. |
| 121 MessageLoop* render_loop_; | 125 MessageLoop* render_loop_; |
| 122 WebMediaPlayerImpl* webmediaplayer_; | 126 WebMediaPlayerImpl* webmediaplayer_; |
| 123 scoped_refptr<VideoRendererImpl> video_renderer_; | 127 scoped_refptr<VideoRendererImpl> video_renderer_; |
| 124 | 128 |
| 125 Lock lock_; | 129 Lock lock_; |
| 126 int outstanding_repaints_; | 130 int outstanding_repaints_; |
| 127 }; | 131 }; |
| 128 | 132 |
| 129 // Construct a WebMediaPlayerImpl with reference to the client, and media | 133 // Construct a WebMediaPlayerImpl with reference to the client, and media |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 // |main_loop_| is being destroyed and we can stop posting repaint task | 213 // |main_loop_| is being destroyed and we can stop posting repaint task |
| 210 // to it. | 214 // to it. |
| 211 virtual void WillDestroyCurrentMessageLoop(); | 215 virtual void WillDestroyCurrentMessageLoop(); |
| 212 | 216 |
| 213 void Repaint(); | 217 void Repaint(); |
| 214 | 218 |
| 215 void OnPipelineInitialize(); | 219 void OnPipelineInitialize(); |
| 216 | 220 |
| 217 void OnPipelineSeek(); | 221 void OnPipelineSeek(); |
| 218 | 222 |
| 223 void OnPipelineError(); |
| 224 |
| 219 private: | 225 private: |
| 220 // Helpers that set the network/ready state and notifies the client if | 226 // Helpers that set the network/ready state and notifies the client if |
| 221 // they've changed. | 227 // they've changed. |
| 222 void SetNetworkState(WebKit::WebMediaPlayer::NetworkState state); | 228 void SetNetworkState(WebKit::WebMediaPlayer::NetworkState state); |
| 223 void SetReadyState(WebKit::WebMediaPlayer::ReadyState state); | 229 void SetReadyState(WebKit::WebMediaPlayer::ReadyState state); |
| 224 | 230 |
| 225 // Destroy resources held. | 231 // Destroy resources held. |
| 226 void Destroy(); | 232 void Destroy(); |
| 227 | 233 |
| 228 // Getter method to |client_|. | 234 // Getter method to |client_|. |
| (...skipping 26 matching lines...) Expand all Loading... |
| 255 WebKit::WebMediaPlayerClient* client_; | 261 WebKit::WebMediaPlayerClient* client_; |
| 256 | 262 |
| 257 scoped_refptr<Proxy> proxy_; | 263 scoped_refptr<Proxy> proxy_; |
| 258 | 264 |
| 259 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerImpl); | 265 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerImpl); |
| 260 }; | 266 }; |
| 261 | 267 |
| 262 } // namespace webkit_glue | 268 } // namespace webkit_glue |
| 263 | 269 |
| 264 #endif // WEBKIT_GLUE_WEBMEDIAPLAYER_IMPL_H_ | 270 #endif // WEBKIT_GLUE_WEBMEDIAPLAYER_IMPL_H_ |
| OLD | NEW |