OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include "content/renderer/media/webmediaplayer_ms.h" | 5 #include "content/renderer/media/webmediaplayer_ms.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
11 #include "base/message_loop/message_loop.h" | 11 #include "base/message_loop/message_loop.h" |
12 #include "base/metrics/histogram.h" | 12 #include "base/metrics/histogram.h" |
| 13 #include "cc/blink/web_layer_impl.h" |
13 #include "cc/layers/video_layer.h" | 14 #include "cc/layers/video_layer.h" |
14 #include "content/public/renderer/render_view.h" | 15 #include "content/public/renderer/render_view.h" |
15 #include "content/renderer/compositor_bindings/web_layer_impl.h" | |
16 #include "content/renderer/media/media_stream_audio_renderer.h" | 16 #include "content/renderer/media/media_stream_audio_renderer.h" |
17 #include "content/renderer/media/media_stream_renderer_factory.h" | 17 #include "content/renderer/media/media_stream_renderer_factory.h" |
18 #include "content/renderer/media/video_frame_provider.h" | 18 #include "content/renderer/media/video_frame_provider.h" |
19 #include "content/renderer/media/webmediaplayer_delegate.h" | 19 #include "content/renderer/media/webmediaplayer_delegate.h" |
20 #include "content/renderer/media/webmediaplayer_util.h" | 20 #include "content/renderer/media/webmediaplayer_util.h" |
21 #include "content/renderer/render_frame_impl.h" | 21 #include "content/renderer/render_frame_impl.h" |
22 #include "media/base/media_log.h" | 22 #include "media/base/media_log.h" |
23 #include "media/base/video_frame.h" | 23 #include "media/base/video_frame.h" |
24 #include "media/base/video_rotation.h" | 24 #include "media/base/video_rotation.h" |
25 #include "media/base/video_util.h" | 25 #include "media/base/video_util.h" |
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
411 { | 411 { |
412 base::AutoLock auto_lock(current_frame_lock_); | 412 base::AutoLock auto_lock(current_frame_lock_); |
413 DCHECK(!current_frame_used_); | 413 DCHECK(!current_frame_used_); |
414 current_frame_ = frame; | 414 current_frame_ = frame; |
415 } | 415 } |
416 SetReadyState(WebMediaPlayer::ReadyStateHaveMetadata); | 416 SetReadyState(WebMediaPlayer::ReadyStateHaveMetadata); |
417 SetReadyState(WebMediaPlayer::ReadyStateHaveEnoughData); | 417 SetReadyState(WebMediaPlayer::ReadyStateHaveEnoughData); |
418 GetClient()->sizeChanged(); | 418 GetClient()->sizeChanged(); |
419 | 419 |
420 if (video_frame_provider_) { | 420 if (video_frame_provider_) { |
421 video_weblayer_.reset(new WebLayerImpl( | 421 video_weblayer_.reset(new cc_blink::WebLayerImpl( |
422 cc::VideoLayer::Create(this, media::VIDEO_ROTATION_0))); | 422 cc::VideoLayer::Create(this, media::VIDEO_ROTATION_0))); |
423 video_weblayer_->setOpaque(true); | 423 video_weblayer_->setOpaque(true); |
424 GetClient()->setWebLayer(video_weblayer_.get()); | 424 GetClient()->setWebLayer(video_weblayer_.get()); |
425 } | 425 } |
426 } | 426 } |
427 | 427 |
428 // Do not update |current_frame_| when paused. | 428 // Do not update |current_frame_| when paused. |
429 if (paused_) | 429 if (paused_) |
430 return; | 430 return; |
431 | 431 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
474 GetClient()->readyStateChanged(); | 474 GetClient()->readyStateChanged(); |
475 } | 475 } |
476 | 476 |
477 blink::WebMediaPlayerClient* WebMediaPlayerMS::GetClient() { | 477 blink::WebMediaPlayerClient* WebMediaPlayerMS::GetClient() { |
478 DCHECK(thread_checker_.CalledOnValidThread()); | 478 DCHECK(thread_checker_.CalledOnValidThread()); |
479 DCHECK(client_); | 479 DCHECK(client_); |
480 return client_; | 480 return client_; |
481 } | 481 } |
482 | 482 |
483 } // namespace content | 483 } // namespace content |
OLD | NEW |