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

Side by Side Diff: content/renderer/media/android/webmediaplayer_android.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 "content/renderer/media/android/webmediaplayer_android.h" 5 #include "content/renderer/media/android/webmediaplayer_android.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <limits> 9 #include <limits>
10 10
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 #include "media/blink/webmediaplayer_util.h" 50 #include "media/blink/webmediaplayer_util.h"
51 #include "net/base/mime_util.h" 51 #include "net/base/mime_util.h"
52 #include "skia/ext/texture_handle.h" 52 #include "skia/ext/texture_handle.h"
53 #include "third_party/WebKit/public/platform/Platform.h" 53 #include "third_party/WebKit/public/platform/Platform.h"
54 #include "third_party/WebKit/public/platform/URLConversion.h" 54 #include "third_party/WebKit/public/platform/URLConversion.h"
55 #include "third_party/WebKit/public/platform/WebContentDecryptionModuleResult.h" 55 #include "third_party/WebKit/public/platform/WebContentDecryptionModuleResult.h"
56 #include "third_party/WebKit/public/platform/WebEncryptedMediaTypes.h" 56 #include "third_party/WebKit/public/platform/WebEncryptedMediaTypes.h"
57 #include "third_party/WebKit/public/platform/WebGraphicsContext3DProvider.h" 57 #include "third_party/WebKit/public/platform/WebGraphicsContext3DProvider.h"
58 #include "third_party/WebKit/public/platform/WebMediaPlayerClient.h" 58 #include "third_party/WebKit/public/platform/WebMediaPlayerClient.h"
59 #include "third_party/WebKit/public/platform/WebMediaPlayerEncryptedMediaClient. h" 59 #include "third_party/WebKit/public/platform/WebMediaPlayerEncryptedMediaClient. h"
60 #include "third_party/WebKit/public/platform/WebMediaPlayerSource.h"
60 #include "third_party/WebKit/public/platform/WebSecurityOrigin.h" 61 #include "third_party/WebKit/public/platform/WebSecurityOrigin.h"
61 #include "third_party/WebKit/public/platform/WebString.h" 62 #include "third_party/WebKit/public/platform/WebString.h"
62 #include "third_party/WebKit/public/platform/WebURL.h" 63 #include "third_party/WebKit/public/platform/WebURL.h"
63 #include "third_party/WebKit/public/web/WebDocument.h" 64 #include "third_party/WebKit/public/web/WebDocument.h"
64 #include "third_party/WebKit/public/web/WebFrame.h" 65 #include "third_party/WebKit/public/web/WebFrame.h"
65 #include "third_party/WebKit/public/web/WebView.h" 66 #include "third_party/WebKit/public/web/WebView.h"
66 #include "third_party/skia/include/core/SkCanvas.h" 67 #include "third_party/skia/include/core/SkCanvas.h"
67 #include "third_party/skia/include/core/SkPaint.h" 68 #include "third_party/skia/include/core/SkPaint.h"
68 #include "third_party/skia/include/core/SkTypeface.h" 69 #include "third_party/skia/include/core/SkTypeface.h"
69 #include "third_party/skia/include/gpu/GrContext.h" 70 #include "third_party/skia/include/gpu/GrContext.h"
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 // Wait until |media_source_delegate_| is fully stopped before tearing 292 // Wait until |media_source_delegate_| is fully stopped before tearing
292 // down other objects. 293 // down other objects.
293 base::WaitableEvent waiter(false, false); 294 base::WaitableEvent waiter(false, false);
294 media_source_delegate_->Stop( 295 media_source_delegate_->Stop(
295 base::Bind(&base::WaitableEvent::Signal, base::Unretained(&waiter))); 296 base::Bind(&base::WaitableEvent::Signal, base::Unretained(&waiter)));
296 waiter.Wait(); 297 waiter.Wait();
297 } 298 }
298 } 299 }
299 300
300 void WebMediaPlayerAndroid::load(LoadType load_type, 301 void WebMediaPlayerAndroid::load(LoadType load_type,
301 const blink::WebURL& url, 302 const blink::WebMediaPlayerSource& source,
302 CORSMode cors_mode) { 303 CORSMode cors_mode) {
304 // Only URL or MSE blob URL is supported.
305 DCHECK(source.isURL());
306 blink::WebURL url = source.getAsURL();
303 if (!defer_load_cb_.is_null()) { 307 if (!defer_load_cb_.is_null()) {
304 defer_load_cb_.Run(base::Bind(&WebMediaPlayerAndroid::DoLoad, 308 defer_load_cb_.Run(base::Bind(&WebMediaPlayerAndroid::DoLoad,
305 weak_factory_.GetWeakPtr(), load_type, url, 309 weak_factory_.GetWeakPtr(), load_type, url,
306 cors_mode)); 310 cors_mode));
307 return; 311 return;
308 } 312 }
309 DoLoad(load_type, url, cors_mode); 313 DoLoad(load_type, url, cors_mode);
310 } 314 }
311 315
312 void WebMediaPlayerAndroid::DoLoad(LoadType load_type, 316 void WebMediaPlayerAndroid::DoLoad(LoadType load_type,
(...skipping 1362 matching lines...) Expand 10 before | Expand all | Expand 10 after
1675 result = PREDICTION_RESULT_PATH_BASED_WAS_BETTER; 1679 result = PREDICTION_RESULT_PATH_BASED_WAS_BETTER;
1676 } else if (is_hls_url == is_hls) { 1680 } else if (is_hls_url == is_hls) {
1677 result = PREDICTION_RESULT_URL_BASED_WAS_BETTER; 1681 result = PREDICTION_RESULT_URL_BASED_WAS_BETTER;
1678 } 1682 }
1679 UMA_HISTOGRAM_ENUMERATION( 1683 UMA_HISTOGRAM_ENUMERATION(
1680 "Media.Android.IsHttpLiveStreamingMediaPredictionResult", 1684 "Media.Android.IsHttpLiveStreamingMediaPredictionResult",
1681 result, PREDICTION_RESULT_MAX); 1685 result, PREDICTION_RESULT_MAX);
1682 } 1686 }
1683 1687
1684 } // namespace content 1688 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698