OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // 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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
104 // Methods for WebMediaPlayerImpl -> Filter communication. | 104 // Methods for WebMediaPlayerImpl -> Filter communication. |
105 void Paint(skia::PlatformCanvas* canvas, const gfx::Rect& dest_rect); | 105 void Paint(skia::PlatformCanvas* canvas, const gfx::Rect& dest_rect); |
106 void SetSize(const gfx::Rect& rect); | 106 void SetSize(const gfx::Rect& rect); |
107 void Detach(); | 107 void Detach(); |
108 void GetCurrentFrame(scoped_refptr<media::VideoFrame>* frame_out); | 108 void GetCurrentFrame(scoped_refptr<media::VideoFrame>* frame_out); |
109 void PutCurrentFrame(scoped_refptr<media::VideoFrame> frame); | 109 void PutCurrentFrame(scoped_refptr<media::VideoFrame> frame); |
110 bool HasSingleOrigin(); | 110 bool HasSingleOrigin(); |
111 void AbortDataSources(); | 111 void AbortDataSources(); |
112 | 112 |
113 // Methods for PipelineImpl -> WebMediaPlayerImpl communication. | 113 // Methods for PipelineImpl -> WebMediaPlayerImpl communication. |
114 void PipelineInitializationCallback(); | 114 void PipelineInitializationCallback(media::PipelineStatus status); |
115 void PipelineSeekCallback(); | 115 void PipelineSeekCallback(media::PipelineStatus status); |
116 void PipelineEndedCallback(); | 116 void PipelineEndedCallback(media::PipelineStatus status); |
117 void PipelineErrorCallback(); | 117 void PipelineStatusCallback(media::PipelineStatus status); |
acolwell GONE FROM CHROMIUM
2011/03/15 03:56:28
I think this should stay PipelineErrorCallback() s
Ami GONE FROM CHROMIUM
2011/03/15 17:37:18
Done.
| |
118 void NetworkEventCallback(); | 118 void NetworkEventCallback(media::PipelineStatus status); |
119 | 119 |
120 // Returns the message loop used by the proxy. | 120 // Returns the message loop used by the proxy. |
121 MessageLoop* message_loop() { return render_loop_; } | 121 MessageLoop* message_loop() { return render_loop_; } |
122 | 122 |
123 private: | 123 private: |
124 friend class base::RefCountedThreadSafe<Proxy>; | 124 friend class base::RefCountedThreadSafe<Proxy>; |
125 | 125 |
126 virtual ~Proxy(); | 126 virtual ~Proxy(); |
127 | 127 |
128 // Adds a data source to data_sources_. | 128 // Adds a data source to data_sources_. |
129 void AddDataSource(WebDataSource* data_source); | 129 void AddDataSource(WebDataSource* data_source); |
130 | 130 |
131 // Invoke |webmediaplayer_| to perform a repaint. | 131 // Invoke |webmediaplayer_| to perform a repaint. |
132 void RepaintTask(); | 132 void RepaintTask(); |
133 | 133 |
134 // Notify |webmediaplayer_| that initialization has finished. | 134 // Notify |webmediaplayer_| that initialization has finished. |
135 void PipelineInitializationTask(); | 135 void PipelineInitializationTask(media::PipelineStatus status); |
136 | 136 |
137 // Notify |webmediaplayer_| that a seek has finished. | 137 // Notify |webmediaplayer_| that a seek has finished. |
138 void PipelineSeekTask(); | 138 void PipelineSeekTask(media::PipelineStatus status); |
139 | 139 |
140 // Notify |webmediaplayer_| that the media has ended. | 140 // Notify |webmediaplayer_| that the media has ended. |
141 void PipelineEndedTask(); | 141 void PipelineEndedTask(media::PipelineStatus status); |
142 | 142 |
143 // Notify |webmediaplayer_| that a pipeline error has been set. | 143 // Notify |webmediaplayer_| that a pipeline error has been set. |
acolwell GONE FROM CHROMIUM
2011/03/15 03:56:28
Maybe change to something like, "Notify |webmediap
Ami GONE FROM CHROMIUM
2011/03/15 17:37:18
Done.
| |
144 void PipelineErrorTask(); | 144 void PipelineStatusTask(media::PipelineStatus status); |
acolwell GONE FROM CHROMIUM
2011/03/15 03:56:28
PipelineErrorTask() since it is only called on an
Ami GONE FROM CHROMIUM
2011/03/15 17:37:18
Done.
| |
145 | 145 |
146 // Notify |webmediaplayer_| that there's a network event. | 146 // Notify |webmediaplayer_| that there's a network event. |
147 void NetworkEventTask(); | 147 void NetworkEventTask(media::PipelineStatus status); |
148 | 148 |
149 // The render message loop where WebKit lives. | 149 // The render message loop where WebKit lives. |
150 MessageLoop* render_loop_; | 150 MessageLoop* render_loop_; |
151 WebMediaPlayerImpl* webmediaplayer_; | 151 WebMediaPlayerImpl* webmediaplayer_; |
152 | 152 |
153 base::Lock data_sources_lock_; | 153 base::Lock data_sources_lock_; |
154 typedef std::list<scoped_refptr<WebDataSource> > DataSourceList; | 154 typedef std::list<scoped_refptr<WebDataSource> > DataSourceList; |
155 DataSourceList data_sources_; | 155 DataSourceList data_sources_; |
156 scoped_ptr<WebDataSourceBuildObserverHack> build_observer_; | 156 scoped_ptr<WebDataSourceBuildObserverHack> build_observer_; |
157 | 157 |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
254 virtual void putCurrentFrame(WebKit::WebVideoFrame* web_video_frame); | 254 virtual void putCurrentFrame(WebKit::WebVideoFrame* web_video_frame); |
255 | 255 |
256 // As we are closing the tab or even the browser, |main_loop_| is destroyed | 256 // As we are closing the tab or even the browser, |main_loop_| is destroyed |
257 // even before this object gets destructed, so we need to know when | 257 // even before this object gets destructed, so we need to know when |
258 // |main_loop_| is being destroyed and we can stop posting repaint task | 258 // |main_loop_| is being destroyed and we can stop posting repaint task |
259 // to it. | 259 // to it. |
260 virtual void WillDestroyCurrentMessageLoop(); | 260 virtual void WillDestroyCurrentMessageLoop(); |
261 | 261 |
262 void Repaint(); | 262 void Repaint(); |
263 | 263 |
264 void OnPipelineInitialize(); | 264 void OnPipelineInitialize(media::PipelineStatus status); |
265 | 265 |
266 void OnPipelineSeek(); | 266 void OnPipelineSeek(media::PipelineStatus status); |
267 | 267 |
268 void OnPipelineEnded(); | 268 void OnPipelineEnded(media::PipelineStatus status); |
269 | 269 |
270 void OnPipelineError(); | 270 void OnPipelineStatus(media::PipelineStatus status); |
acolwell GONE FROM CHROMIUM
2011/03/15 03:56:28
Same comment as above.
Ami GONE FROM CHROMIUM
2011/03/15 17:37:18
Done, but note that the impl used to treat PIPELIN
| |
271 | 271 |
272 void OnNetworkEvent(); | 272 void OnNetworkEvent(media::PipelineStatus status); |
273 | 273 |
274 private: | 274 private: |
275 // Helpers that set the network/ready state and notifies the client if | 275 // Helpers that set the network/ready state and notifies the client if |
276 // they've changed. | 276 // they've changed. |
277 void SetNetworkState(WebKit::WebMediaPlayer::NetworkState state); | 277 void SetNetworkState(WebKit::WebMediaPlayer::NetworkState state); |
278 void SetReadyState(WebKit::WebMediaPlayer::ReadyState state); | 278 void SetReadyState(WebKit::WebMediaPlayer::ReadyState state); |
279 | 279 |
280 // Destroy resources held. | 280 // Destroy resources held. |
281 void Destroy(); | 281 void Destroy(); |
282 | 282 |
283 // Callback executed after |pipeline_| stops which signals Destroy() | 283 // Callback executed after |pipeline_| stops which signals Destroy() |
284 // to continue. | 284 // to continue. |
285 void PipelineStoppedCallback(); | 285 void PipelineStoppedCallback(media::PipelineStatus status); |
286 | 286 |
287 // Getter method to |client_|. | 287 // Getter method to |client_|. |
288 WebKit::WebMediaPlayerClient* GetClient(); | 288 WebKit::WebMediaPlayerClient* GetClient(); |
289 | 289 |
290 // TODO(hclam): get rid of these members and read from the pipeline directly. | 290 // TODO(hclam): get rid of these members and read from the pipeline directly. |
291 WebKit::WebMediaPlayer::NetworkState network_state_; | 291 WebKit::WebMediaPlayer::NetworkState network_state_; |
292 WebKit::WebMediaPlayer::ReadyState ready_state_; | 292 WebKit::WebMediaPlayer::ReadyState ready_state_; |
293 | 293 |
294 // Keep a list of buffered time ranges. | 294 // Keep a list of buffered time ranges. |
295 WebKit::WebTimeRanges buffered_; | 295 WebKit::WebTimeRanges buffered_; |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
333 #if WEBKIT_USING_CG | 333 #if WEBKIT_USING_CG |
334 scoped_ptr<skia::PlatformCanvas> skia_canvas_; | 334 scoped_ptr<skia::PlatformCanvas> skia_canvas_; |
335 #endif | 335 #endif |
336 | 336 |
337 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerImpl); | 337 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerImpl); |
338 }; | 338 }; |
339 | 339 |
340 } // namespace webkit_glue | 340 } // namespace webkit_glue |
341 | 341 |
342 #endif // WEBKIT_GLUE_WEBMEDIAPLAYER_IMPL_H_ | 342 #endif // WEBKIT_GLUE_WEBMEDIAPLAYER_IMPL_H_ |
OLD | NEW |