diff options
author | sandersd <sandersd@chromium.org> | 2016-01-15 11:28:48 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-01-15 19:30:17 +0000 |
commit | d249de66c8f9829d29528e3b557a8a9b692699cb (patch) | |
tree | bed7941d9ee1bf5d7067399f36b38450ebd07fc4 | |
parent | 35336de9cf087aaa33e77f90c1f6f7dfb3842ddd (diff) | |
download | chromium_src-d249de66c8f9829d29528e3b557a8a9b692699cb.zip chromium_src-d249de66c8f9829d29528e3b557a8a9b692699cb.tar.gz chromium_src-d249de66c8f9829d29528e3b557a8a9b692699cb.tar.bz2 |
Add fallback from WMPI to WMPA for blob URLs.
As MSE support is not yet complete in Spitzer, this change adds
a fallback to WMPA (by blocking all blob URLs).
Use --enable-unified-media-pipeline to force the Spitzer path.
BUG=516765
Review URL: https://codereview.chromium.org/1584533003
Cr-Commit-Position: refs/heads/master@{#369811}
-rw-r--r-- | content/renderer/render_frame_impl.cc | 41 |
1 files changed, 35 insertions, 6 deletions
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc index 12fdd07..dc9d220 100644 --- a/content/renderer/render_frame_impl.cc +++ b/content/renderer/render_frame_impl.cc @@ -666,6 +666,40 @@ bool IsContentWithCertificateErrorsRelevantToUI( ssl_status.connection_status); } +#if defined(OS_ANDROID) +// Returns true if WMPI is enabled and is expected to be able to play the URL, +// false if WMPA should be used instead. +// +// Note that HLS and WebM detection are pre-redirect and path-based. It is +// possible to load such a URL and find different content, in which case +// playback may fail. +bool CanUseWebMediaPlayerImpl(const GURL& url) { + // WMPI does not support HLS. + if (media::MediaCodecUtil::IsHLSPath(url)) + return false; + + // If --enable-unified-media-pipeline was passed, always use WMPI. (This + // allows for testing the new path.) + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kEnableUnifiedMediaPipeline)) { + return true; + } + + // Don't use WMPI for blob URLs (MSE in particular) yet. + if (url.SchemeIsBlob()) + return false; + + // WMPI can play VPX even without AVDA. + if (base::EndsWith(url.path(), ".webm", base::CompareCase::INSENSITIVE_ASCII)) + return true; + + // Only use WMPI if AVDA is available. + return (media::MediaCodecUtil::IsMediaCodecAvailable() && + !base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kDisableAcceleratedVideoDecode)); +} +#endif // defined(OS_ANDROID) + } // namespace // static @@ -2375,12 +2409,7 @@ blink::WebMediaPlayer* RenderFrameImpl::createMediaPlayer( GetMediaPermission(), initial_cdm); #if defined(OS_ANDROID) - // We must use WMPA in when accelerated video decode is disabled becuase WMPI - // is unlikely to have a fallback decoder. - if (base::CommandLine::ForCurrentProcess()->HasSwitch( - switches::kDisableAcceleratedVideoDecode) || - !media::MediaCodecUtil::IsMediaCodecAvailable() || - media::MediaCodecUtil::IsHLSPath(url)) { + if (!CanUseWebMediaPlayerImpl(url)) { return CreateAndroidWebMediaPlayer(client, encrypted_client, params); } else { // TODO(dalecurtis): This experiment is temporary and should be removed once |