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/blink/web_layer_impl.h" |
14 #include "cc/layers/video_layer.h" | 14 #include "cc/layers/video_layer.h" |
15 #include "content/public/renderer/render_view.h" | 15 #include "content/public/renderer/render_view.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" | |
20 #include "content/renderer/media/webmediaplayer_util.h" | |
21 #include "content/renderer/render_frame_impl.h" | 19 #include "content/renderer/render_frame_impl.h" |
22 #include "media/base/media_log.h" | 20 #include "media/base/media_log.h" |
23 #include "media/base/video_frame.h" | 21 #include "media/base/video_frame.h" |
24 #include "media/base/video_rotation.h" | 22 #include "media/base/video_rotation.h" |
25 #include "media/base/video_util.h" | 23 #include "media/base/video_util.h" |
| 24 #include "media/blink/webmediaplayer_delegate.h" |
| 25 #include "media/blink/webmediaplayer_util.h" |
26 #include "third_party/WebKit/public/platform/WebMediaPlayerClient.h" | 26 #include "third_party/WebKit/public/platform/WebMediaPlayerClient.h" |
27 #include "third_party/WebKit/public/platform/WebRect.h" | 27 #include "third_party/WebKit/public/platform/WebRect.h" |
28 #include "third_party/WebKit/public/platform/WebSize.h" | 28 #include "third_party/WebKit/public/platform/WebSize.h" |
29 #include "third_party/WebKit/public/platform/WebURL.h" | 29 #include "third_party/WebKit/public/platform/WebURL.h" |
30 #include "third_party/WebKit/public/web/WebFrame.h" | 30 #include "third_party/WebKit/public/web/WebFrame.h" |
31 #include "third_party/WebKit/public/web/WebView.h" | 31 #include "third_party/WebKit/public/web/WebView.h" |
32 #include "third_party/skia/include/core/SkBitmap.h" | 32 #include "third_party/skia/include/core/SkBitmap.h" |
33 | 33 |
34 using blink::WebCanvas; | 34 using blink::WebCanvas; |
35 using blink::WebMediaPlayer; | 35 using blink::WebMediaPlayer; |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 return new_frame; | 74 return new_frame; |
75 } | 75 } |
76 | 76 |
77 } // anonymous namespace | 77 } // anonymous namespace |
78 | 78 |
79 namespace content { | 79 namespace content { |
80 | 80 |
81 WebMediaPlayerMS::WebMediaPlayerMS( | 81 WebMediaPlayerMS::WebMediaPlayerMS( |
82 blink::WebFrame* frame, | 82 blink::WebFrame* frame, |
83 blink::WebMediaPlayerClient* client, | 83 blink::WebMediaPlayerClient* client, |
84 base::WeakPtr<WebMediaPlayerDelegate> delegate, | 84 base::WeakPtr<media::WebMediaPlayerDelegate> delegate, |
85 media::MediaLog* media_log, | 85 media::MediaLog* media_log, |
86 scoped_ptr<MediaStreamRendererFactory> factory) | 86 scoped_ptr<MediaStreamRendererFactory> factory) |
87 : frame_(frame), | 87 : frame_(frame), |
88 network_state_(WebMediaPlayer::NetworkStateEmpty), | 88 network_state_(WebMediaPlayer::NetworkStateEmpty), |
89 ready_state_(WebMediaPlayer::ReadyStateHaveNothing), | 89 ready_state_(WebMediaPlayer::ReadyStateHaveNothing), |
90 buffered_(static_cast<size_t>(1)), | 90 buffered_(static_cast<size_t>(1)), |
91 volume_(1.0f), | 91 volume_(1.0f), |
92 client_(client), | 92 client_(client), |
93 delegate_(delegate), | 93 delegate_(delegate), |
94 paused_(true), | 94 paused_(true), |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
351 DCHECK(thread_checker_.CalledOnValidThread()); | 351 DCHECK(thread_checker_.CalledOnValidThread()); |
352 return true; | 352 return true; |
353 } | 353 } |
354 | 354 |
355 bool WebMediaPlayerMS::didPassCORSAccessCheck() const { | 355 bool WebMediaPlayerMS::didPassCORSAccessCheck() const { |
356 DCHECK(thread_checker_.CalledOnValidThread()); | 356 DCHECK(thread_checker_.CalledOnValidThread()); |
357 return true; | 357 return true; |
358 } | 358 } |
359 | 359 |
360 double WebMediaPlayerMS::mediaTimeForTimeValue(double timeValue) const { | 360 double WebMediaPlayerMS::mediaTimeForTimeValue(double timeValue) const { |
361 return ConvertSecondsToTimestamp(timeValue).InSecondsF(); | 361 return media::ConvertSecondsToTimestamp(timeValue).InSecondsF(); |
362 } | 362 } |
363 | 363 |
364 unsigned WebMediaPlayerMS::decodedFrameCount() const { | 364 unsigned WebMediaPlayerMS::decodedFrameCount() const { |
365 DCHECK(thread_checker_.CalledOnValidThread()); | 365 DCHECK(thread_checker_.CalledOnValidThread()); |
366 DVLOG(1) << "WebMediaPlayerMS::decodedFrameCount, " << total_frame_count_; | 366 DVLOG(1) << "WebMediaPlayerMS::decodedFrameCount, " << total_frame_count_; |
367 return total_frame_count_; | 367 return total_frame_count_; |
368 } | 368 } |
369 | 369 |
370 unsigned WebMediaPlayerMS::droppedFrameCount() const { | 370 unsigned WebMediaPlayerMS::droppedFrameCount() const { |
371 DCHECK(thread_checker_.CalledOnValidThread()); | 371 DCHECK(thread_checker_.CalledOnValidThread()); |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
485 GetClient()->readyStateChanged(); | 485 GetClient()->readyStateChanged(); |
486 } | 486 } |
487 | 487 |
488 blink::WebMediaPlayerClient* WebMediaPlayerMS::GetClient() { | 488 blink::WebMediaPlayerClient* WebMediaPlayerMS::GetClient() { |
489 DCHECK(thread_checker_.CalledOnValidThread()); | 489 DCHECK(thread_checker_.CalledOnValidThread()); |
490 DCHECK(client_); | 490 DCHECK(client_); |
491 return client_; | 491 return client_; |
492 } | 492 } |
493 | 493 |
494 } // namespace content | 494 } // namespace content |
OLD | NEW |