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 // Delegate calls from WebCore::MediaPlayerPrivate to Chrome's video player. | 5 // Delegate calls from WebCore::MediaPlayerPrivate to Chrome's video player. |
6 // It contains Pipeline which is the actual media player pipeline, it glues | 6 // It contains Pipeline 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 // Pipeline would creates multiple threads and access some public methods | 8 // Pipeline 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 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 // Gets the duration value reported by the pipeline. | 265 // Gets the duration value reported by the pipeline. |
266 double GetPipelineDuration() const; | 266 double GetPipelineDuration() const; |
267 | 267 |
268 // Notifies WebKit of the duration change. | 268 // Notifies WebKit of the duration change. |
269 void OnDurationChange(); | 269 void OnDurationChange(); |
270 | 270 |
271 // Called by VideoRendererBase on its internal thread with the new frame to be | 271 // Called by VideoRendererBase on its internal thread with the new frame to be |
272 // painted. | 272 // painted. |
273 void FrameReady(const scoped_refptr<media::VideoFrame>& frame); | 273 void FrameReady(const scoped_refptr<media::VideoFrame>& frame); |
274 | 274 |
275 // Builds a FilterCollection based on the current configuration of | |
276 // WebMediaPlayerImpl. | |
277 scoped_ptr<media::FilterCollection> BuildFilterCollection(); | |
278 | |
279 WebKit::WebFrame* frame_; | 275 WebKit::WebFrame* frame_; |
280 | 276 |
281 // TODO(hclam): get rid of these members and read from the pipeline directly. | 277 // TODO(hclam): get rid of these members and read from the pipeline directly. |
282 WebKit::WebMediaPlayer::NetworkState network_state_; | 278 WebKit::WebMediaPlayer::NetworkState network_state_; |
283 WebKit::WebMediaPlayer::ReadyState ready_state_; | 279 WebKit::WebMediaPlayer::ReadyState ready_state_; |
284 | 280 |
285 // Keep a list of buffered time ranges. | 281 // Keep a list of buffered time ranges. |
286 WebKit::WebTimeRanges buffered_; | 282 WebKit::WebTimeRanges buffered_; |
287 | 283 |
288 // Message loops for posting tasks on Chrome's main thread. Also used | 284 // Message loops for posting tasks on Chrome's main thread. Also used |
289 // for DCHECKs so methods calls won't execute in the wrong thread. | 285 // for DCHECKs so methods calls won't execute in the wrong thread. |
290 const scoped_refptr<base::MessageLoopProxy> main_loop_; | 286 const scoped_refptr<base::MessageLoopProxy> main_loop_; |
291 | 287 |
| 288 scoped_ptr<media::FilterCollection> filter_collection_; |
292 scoped_refptr<media::Pipeline> pipeline_; | 289 scoped_refptr<media::Pipeline> pipeline_; |
293 base::Thread media_thread_; | 290 base::Thread media_thread_; |
294 | 291 |
295 // The currently selected key system. Empty string means that no key system | 292 // The currently selected key system. Empty string means that no key system |
296 // has been selected. | 293 // has been selected. |
297 WebKit::WebString current_key_system_; | 294 WebKit::WebString current_key_system_; |
298 | 295 |
299 // Playback state. | 296 // Playback state. |
300 // | 297 // |
301 // TODO(scherkus): we have these because Pipeline favours the simplicity of a | 298 // TODO(scherkus): we have these because Pipeline favours the simplicity of a |
(...skipping 23 matching lines...) Expand all Loading... |
325 MediaStreamClient* media_stream_client_; | 322 MediaStreamClient* media_stream_client_; |
326 | 323 |
327 scoped_refptr<media::MediaLog> media_log_; | 324 scoped_refptr<media::MediaLog> media_log_; |
328 | 325 |
329 // Since accelerated compositing status is only known after the first layout, | 326 // Since accelerated compositing status is only known after the first layout, |
330 // we delay reporting it to UMA until that time. | 327 // we delay reporting it to UMA until that time. |
331 bool accelerated_compositing_reported_; | 328 bool accelerated_compositing_reported_; |
332 | 329 |
333 bool incremented_externally_allocated_memory_; | 330 bool incremented_externally_allocated_memory_; |
334 | 331 |
335 // Factories for supporting GpuVideoDecoder. May be null. | |
336 scoped_refptr<media::GpuVideoDecoder::Factories> gpu_factories_; | |
337 | |
338 // Routes audio playback to either AudioRendererSink or WebAudio. | 332 // Routes audio playback to either AudioRendererSink or WebAudio. |
339 scoped_refptr<WebAudioSourceProviderImpl> audio_source_provider_; | 333 scoped_refptr<WebAudioSourceProviderImpl> audio_source_provider_; |
340 | 334 |
341 bool is_local_source_; | 335 bool is_local_source_; |
342 bool supports_save_; | 336 bool supports_save_; |
343 | 337 |
344 // The decryptor that manages decryption keys and decrypts encrypted frames. | 338 // The decryptor that manages decryption keys and decrypts encrypted frames. |
345 scoped_ptr<ProxyDecryptor> decryptor_; | 339 scoped_ptr<ProxyDecryptor> decryptor_; |
346 | 340 |
347 bool starting_; | 341 bool starting_; |
(...skipping 19 matching lines...) Expand all Loading... |
367 bool pending_repaint_; | 361 bool pending_repaint_; |
368 | 362 |
369 // The compositor layer for displaying the video content when using composited | 363 // The compositor layer for displaying the video content when using composited |
370 // playback. | 364 // playback. |
371 scoped_ptr<webkit::WebLayerImpl> video_weblayer_; | 365 scoped_ptr<webkit::WebLayerImpl> video_weblayer_; |
372 | 366 |
373 // A pointer back to the compositor to inform it about state changes. This is | 367 // A pointer back to the compositor to inform it about state changes. This is |
374 // not NULL while the compositor is actively using this webmediaplayer. | 368 // not NULL while the compositor is actively using this webmediaplayer. |
375 cc::VideoFrameProvider::Client* video_frame_provider_client_; | 369 cc::VideoFrameProvider::Client* video_frame_provider_client_; |
376 | 370 |
| 371 scoped_refptr<media::GpuVideoDecoder::Factories> gpu_factories_; |
| 372 |
377 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerImpl); | 373 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerImpl); |
378 }; | 374 }; |
379 | 375 |
380 } // namespace webkit_media | 376 } // namespace webkit_media |
381 | 377 |
382 #endif // WEBKIT_MEDIA_WEBMEDIAPLAYER_IMPL_H_ | 378 #endif // WEBKIT_MEDIA_WEBMEDIAPLAYER_IMPL_H_ |
OLD | NEW |