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/layers/video_layer.h" | 13 #include "cc/layers/video_layer.h" |
14 #include "content/public/renderer/render_view.h" | 14 #include "content/public/renderer/render_view.h" |
15 #include "content/renderer/compositor_bindings/web_layer_impl.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_util.h" | 25 #include "media/base/video_util.h" |
25 #include "third_party/WebKit/public/platform/WebMediaPlayerClient.h" | 26 #include "third_party/WebKit/public/platform/WebMediaPlayerClient.h" |
26 #include "third_party/WebKit/public/platform/WebRect.h" | 27 #include "third_party/WebKit/public/platform/WebRect.h" |
27 #include "third_party/WebKit/public/platform/WebSize.h" | 28 #include "third_party/WebKit/public/platform/WebSize.h" |
28 #include "third_party/WebKit/public/platform/WebURL.h" | 29 #include "third_party/WebKit/public/platform/WebURL.h" |
29 #include "third_party/WebKit/public/web/WebFrame.h" | 30 #include "third_party/WebKit/public/web/WebFrame.h" |
30 #include "third_party/WebKit/public/web/WebView.h" | 31 #include "third_party/WebKit/public/web/WebView.h" |
31 #include "third_party/skia/include/core/SkBitmap.h" | 32 #include "third_party/skia/include/core/SkBitmap.h" |
32 | 33 |
33 using blink::WebCanvas; | 34 using blink::WebCanvas; |
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
407 { | 408 { |
408 base::AutoLock auto_lock(current_frame_lock_); | 409 base::AutoLock auto_lock(current_frame_lock_); |
409 DCHECK(!current_frame_used_); | 410 DCHECK(!current_frame_used_); |
410 current_frame_ = frame; | 411 current_frame_ = frame; |
411 } | 412 } |
412 SetReadyState(WebMediaPlayer::ReadyStateHaveMetadata); | 413 SetReadyState(WebMediaPlayer::ReadyStateHaveMetadata); |
413 SetReadyState(WebMediaPlayer::ReadyStateHaveEnoughData); | 414 SetReadyState(WebMediaPlayer::ReadyStateHaveEnoughData); |
414 GetClient()->sizeChanged(); | 415 GetClient()->sizeChanged(); |
415 | 416 |
416 if (video_frame_provider_) { | 417 if (video_frame_provider_) { |
417 video_weblayer_.reset(new WebLayerImpl(cc::VideoLayer::Create(this))); | 418 video_weblayer_.reset(new WebLayerImpl( |
| 419 cc::VideoLayer::Create(this, media::VIDEO_ROTATION_0))); |
418 video_weblayer_->setOpaque(true); | 420 video_weblayer_->setOpaque(true); |
419 GetClient()->setWebLayer(video_weblayer_.get()); | 421 GetClient()->setWebLayer(video_weblayer_.get()); |
420 } | 422 } |
421 } | 423 } |
422 | 424 |
423 // Do not update |current_frame_| when paused. | 425 // Do not update |current_frame_| when paused. |
424 if (paused_) | 426 if (paused_) |
425 return; | 427 return; |
426 | 428 |
427 bool size_changed = !current_frame_.get() || | 429 bool size_changed = !current_frame_.get() || |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
469 GetClient()->readyStateChanged(); | 471 GetClient()->readyStateChanged(); |
470 } | 472 } |
471 | 473 |
472 blink::WebMediaPlayerClient* WebMediaPlayerMS::GetClient() { | 474 blink::WebMediaPlayerClient* WebMediaPlayerMS::GetClient() { |
473 DCHECK(thread_checker_.CalledOnValidThread()); | 475 DCHECK(thread_checker_.CalledOnValidThread()); |
474 DCHECK(client_); | 476 DCHECK(client_); |
475 return client_; | 477 return client_; |
476 } | 478 } |
477 | 479 |
478 } // namespace content | 480 } // namespace content |
OLD | NEW |