Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(345)

Side by Side Diff: webkit/glue/webmediaplayer_impl.h

Issue 159373: Pipeline will execute a callback whenever an run-time error has happened.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « media/base/pipeline_impl_unittest.cc ('k') | webkit/glue/webmediaplayer_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 // |main_loop_| is being destroyed and we can stop posting repaint task 210 // |main_loop_| is being destroyed and we can stop posting repaint task
207 // to it. 211 // to it.
208 virtual void WillDestroyCurrentMessageLoop(); 212 virtual void WillDestroyCurrentMessageLoop();
209 213
210 void Repaint(); 214 void Repaint();
211 215
212 void OnPipelineInitialize(); 216 void OnPipelineInitialize();
213 217
214 void OnPipelineSeek(); 218 void OnPipelineSeek();
215 219
220 void OnPipelineError();
221
216 private: 222 private:
217 // Helpers that set the network/ready state and notifies the client if 223 // Helpers that set the network/ready state and notifies the client if
218 // they've changed. 224 // they've changed.
219 void SetNetworkState(WebKit::WebMediaPlayer::NetworkState state); 225 void SetNetworkState(WebKit::WebMediaPlayer::NetworkState state);
220 void SetReadyState(WebKit::WebMediaPlayer::ReadyState state); 226 void SetReadyState(WebKit::WebMediaPlayer::ReadyState state);
221 227
222 // Destroy resources held. 228 // Destroy resources held.
223 void Destroy(); 229 void Destroy();
224 230
225 // Getter method to |client_|. 231 // Getter method to |client_|.
(...skipping 26 matching lines...) Expand all
252 WebKit::WebMediaPlayerClient* client_; 258 WebKit::WebMediaPlayerClient* client_;
253 259
254 scoped_refptr<Proxy> proxy_; 260 scoped_refptr<Proxy> proxy_;
255 261
256 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerImpl); 262 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerImpl);
257 }; 263 };
258 264
259 } // namespace webkit_glue 265 } // namespace webkit_glue
260 266
261 #endif // WEBKIT_GLUE_WEBMEDIAPLAYER_IMPL_H_ 267 #endif // WEBKIT_GLUE_WEBMEDIAPLAYER_IMPL_H_
OLDNEW
« no previous file with comments | « media/base/pipeline_impl_unittest.cc ('k') | webkit/glue/webmediaplayer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698