Chromium Code Reviews| 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 "media/blink/webmediaplayer_impl.h" | 5 #include "media/blink/webmediaplayer_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 #include <limits> | 9 #include <limits> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 41 #include "media/blink/texttrack_impl.h" | 41 #include "media/blink/texttrack_impl.h" |
| 42 #include "media/blink/webaudiosourceprovider_impl.h" | 42 #include "media/blink/webaudiosourceprovider_impl.h" |
| 43 #include "media/blink/webcontentdecryptionmodule_impl.h" | 43 #include "media/blink/webcontentdecryptionmodule_impl.h" |
| 44 #include "media/blink/webinbandtexttrack_impl.h" | 44 #include "media/blink/webinbandtexttrack_impl.h" |
| 45 #include "media/blink/webmediaplayer_delegate.h" | 45 #include "media/blink/webmediaplayer_delegate.h" |
| 46 #include "media/blink/webmediaplayer_util.h" | 46 #include "media/blink/webmediaplayer_util.h" |
| 47 #include "media/blink/webmediasource_impl.h" | 47 #include "media/blink/webmediasource_impl.h" |
| 48 #include "media/filters/chunk_demuxer.h" | 48 #include "media/filters/chunk_demuxer.h" |
| 49 #include "media/filters/ffmpeg_demuxer.h" | 49 #include "media/filters/ffmpeg_demuxer.h" |
| 50 #include "third_party/WebKit/public/platform/WebEncryptedMediaTypes.h" | 50 #include "third_party/WebKit/public/platform/WebEncryptedMediaTypes.h" |
| 51 #include "third_party/WebKit/public/platform/WebMediaElementSource.h" | |
| 51 #include "third_party/WebKit/public/platform/WebMediaPlayerClient.h" | 52 #include "third_party/WebKit/public/platform/WebMediaPlayerClient.h" |
| 52 #include "third_party/WebKit/public/platform/WebMediaPlayerEncryptedMediaClient. h" | 53 #include "third_party/WebKit/public/platform/WebMediaPlayerEncryptedMediaClient. h" |
| 53 #include "third_party/WebKit/public/platform/WebMediaSource.h" | 54 #include "third_party/WebKit/public/platform/WebMediaSource.h" |
| 54 #include "third_party/WebKit/public/platform/WebRect.h" | 55 #include "third_party/WebKit/public/platform/WebRect.h" |
| 55 #include "third_party/WebKit/public/platform/WebSecurityOrigin.h" | 56 #include "third_party/WebKit/public/platform/WebSecurityOrigin.h" |
| 56 #include "third_party/WebKit/public/platform/WebSize.h" | 57 #include "third_party/WebKit/public/platform/WebSize.h" |
| 57 #include "third_party/WebKit/public/platform/WebString.h" | 58 #include "third_party/WebKit/public/platform/WebString.h" |
| 58 #include "third_party/WebKit/public/platform/WebURL.h" | 59 #include "third_party/WebKit/public/platform/WebURL.h" |
| 59 #include "third_party/WebKit/public/web/WebDocument.h" | 60 #include "third_party/WebKit/public/web/WebDocument.h" |
| 60 #include "third_party/WebKit/public/web/WebFrame.h" | 61 #include "third_party/WebKit/public/web/WebFrame.h" |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 257 | 258 |
| 258 if (last_reported_memory_usage_) | 259 if (last_reported_memory_usage_) |
| 259 adjust_allocated_memory_cb_.Run(-last_reported_memory_usage_); | 260 adjust_allocated_memory_cb_.Run(-last_reported_memory_usage_); |
| 260 | 261 |
| 261 compositor_task_runner_->DeleteSoon(FROM_HERE, compositor_); | 262 compositor_task_runner_->DeleteSoon(FROM_HERE, compositor_); |
| 262 | 263 |
| 263 media_log_->AddEvent( | 264 media_log_->AddEvent( |
| 264 media_log_->CreateEvent(MediaLogEvent::WEBMEDIAPLAYER_DESTROYED)); | 265 media_log_->CreateEvent(MediaLogEvent::WEBMEDIAPLAYER_DESTROYED)); |
| 265 } | 266 } |
| 266 | 267 |
| 267 void WebMediaPlayerImpl::load(LoadType load_type, const blink::WebURL& url, | 268 void WebMediaPlayerImpl::load(LoadType load_type, |
| 269 const blink::WebMediaElementSource& source, | |
| 268 CORSMode cors_mode) { | 270 CORSMode cors_mode) { |
| 271 // Only URL is supported. | |
|
wolenetz
2016/03/31 19:35:27
nit: please s/is supported/or MSE blob URL are sup
Guido Urdaneta
2016/04/01 12:14:57
Done.
| |
| 272 DCHECK(source.isURL()); | |
| 273 blink::WebURL url = source.getAsURL(); | |
| 269 DVLOG(1) << __FUNCTION__ << "(" << load_type << ", " << url << ", " | 274 DVLOG(1) << __FUNCTION__ << "(" << load_type << ", " << url << ", " |
| 270 << cors_mode << ")"; | 275 << cors_mode << ")"; |
| 271 if (!defer_load_cb_.is_null()) { | 276 if (!defer_load_cb_.is_null()) { |
| 272 defer_load_cb_.Run(base::Bind( | 277 defer_load_cb_.Run(base::Bind( |
| 273 &WebMediaPlayerImpl::DoLoad, AsWeakPtr(), load_type, url, cors_mode)); | 278 &WebMediaPlayerImpl::DoLoad, AsWeakPtr(), load_type, url, cors_mode)); |
| 274 return; | 279 return; |
| 275 } | 280 } |
| 276 DoLoad(load_type, url, cors_mode); | 281 DoLoad(load_type, url, cors_mode); |
| 277 } | 282 } |
| 278 | 283 |
| (...skipping 1254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1533 bool WebMediaPlayerImpl::IsAutomaticResumeAllowed() { | 1538 bool WebMediaPlayerImpl::IsAutomaticResumeAllowed() { |
| 1534 #if defined(OS_ANDROID) | 1539 #if defined(OS_ANDROID) |
| 1535 return !hasVideo() || (delegate_ && !delegate_->IsHidden()); | 1540 return !hasVideo() || (delegate_ && !delegate_->IsHidden()); |
| 1536 #else | 1541 #else |
| 1537 // On non-Android platforms Resume() is always allowed. | 1542 // On non-Android platforms Resume() is always allowed. |
| 1538 return true; | 1543 return true; |
| 1539 #endif | 1544 #endif |
| 1540 } | 1545 } |
| 1541 | 1546 |
| 1542 } // namespace media | 1547 } // namespace media |
| OLD | NEW |