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