Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(142)

Side by Side Diff: media/blink/webmediaplayer_impl.cc

Issue 1815033003: Add srcObject attribute of type MediaStream to HTMLMediaElement. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: philipj's comments Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
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/WebMediaPlayerClient.h" 51 #include "third_party/WebKit/public/platform/WebMediaPlayerClient.h"
52 #include "third_party/WebKit/public/platform/WebMediaPlayerEncryptedMediaClient. h" 52 #include "third_party/WebKit/public/platform/WebMediaPlayerEncryptedMediaClient. h"
53 #include "third_party/WebKit/public/platform/WebMediaPlayerSource.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/WebFrame.h" 60 #include "third_party/WebKit/public/web/WebFrame.h"
60 #include "third_party/WebKit/public/web/WebLocalFrame.h" 61 #include "third_party/WebKit/public/web/WebLocalFrame.h"
61 #include "third_party/WebKit/public/web/WebView.h" 62 #include "third_party/WebKit/public/web/WebView.h"
62 63
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 264
264 if (last_reported_memory_usage_) 265 if (last_reported_memory_usage_)
265 adjust_allocated_memory_cb_.Run(-last_reported_memory_usage_); 266 adjust_allocated_memory_cb_.Run(-last_reported_memory_usage_);
266 267
267 compositor_task_runner_->DeleteSoon(FROM_HERE, compositor_); 268 compositor_task_runner_->DeleteSoon(FROM_HERE, compositor_);
268 269
269 media_log_->AddEvent( 270 media_log_->AddEvent(
270 media_log_->CreateEvent(MediaLogEvent::WEBMEDIAPLAYER_DESTROYED)); 271 media_log_->CreateEvent(MediaLogEvent::WEBMEDIAPLAYER_DESTROYED));
271 } 272 }
272 273
273 void WebMediaPlayerImpl::load(LoadType load_type, const blink::WebURL& url, 274 void WebMediaPlayerImpl::load(LoadType load_type,
275 const blink::WebMediaPlayerSource& source,
274 CORSMode cors_mode) { 276 CORSMode cors_mode) {
277 // Only URL or MSE blob URL is supported.
278 DCHECK(source.isURL());
279 blink::WebURL url = source.getAsURL();
275 DVLOG(1) << __FUNCTION__ << "(" << load_type << ", " << url << ", " 280 DVLOG(1) << __FUNCTION__ << "(" << load_type << ", " << url << ", "
276 << cors_mode << ")"; 281 << cors_mode << ")";
277 if (!defer_load_cb_.is_null()) { 282 if (!defer_load_cb_.is_null()) {
278 defer_load_cb_.Run(base::Bind( 283 defer_load_cb_.Run(base::Bind(
279 &WebMediaPlayerImpl::DoLoad, AsWeakPtr(), load_type, url, cors_mode)); 284 &WebMediaPlayerImpl::DoLoad, AsWeakPtr(), load_type, url, cors_mode));
280 return; 285 return;
281 } 286 }
282 DoLoad(load_type, url, cors_mode); 287 DoLoad(load_type, url, cors_mode);
283 } 288 }
284 289
(...skipping 1284 matching lines...) Expand 10 before | Expand all | Expand 10 after
1569 << ", Video: " << stats.video_memory_usage << ", DataSource: " 1574 << ", Video: " << stats.video_memory_usage << ", DataSource: "
1570 << (data_source_ ? data_source_->GetMemoryUsage() : 0) 1575 << (data_source_ ? data_source_->GetMemoryUsage() : 0)
1571 << ", Demuxer: " << demuxer_memory_usage; 1576 << ", Demuxer: " << demuxer_memory_usage;
1572 1577
1573 const int64_t delta = current_memory_usage - last_reported_memory_usage_; 1578 const int64_t delta = current_memory_usage - last_reported_memory_usage_;
1574 last_reported_memory_usage_ = current_memory_usage; 1579 last_reported_memory_usage_ = current_memory_usage;
1575 adjust_allocated_memory_cb_.Run(delta); 1580 adjust_allocated_memory_cb_.Run(delta);
1576 } 1581 }
1577 1582
1578 } // namespace media 1583 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698