diff options
author | pkotwicz <pkotwicz@chromium.org> | 2016-03-11 13:14:54 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-03-11 21:16:34 +0000 |
commit | 2ceccae6337cab6b6d5be02413c2b56ebaebca1b (patch) | |
tree | 88f8e562d58bd94f61eae94025d02f9debd08c51 | |
parent | ec5d9a515fbff8e2898c26f4356ca1339d9eb987 (diff) | |
download | chromium_src-2ceccae6337cab6b6d5be02413c2b56ebaebca1b.zip chromium_src-2ceccae6337cab6b6d5be02413c2b56ebaebca1b.tar.gz chromium_src-2ceccae6337cab6b6d5be02413c2b56ebaebca1b.tar.bz2 |
Revert of Flip proprietary codecs to false for Android chromium builds. (patchset #11 id:220001 of https://codereview.chromium.org/1577433004/ )
Reason for revert:
Broke AndroidWebViewTest. See https://build.chromium.org/p/chromium.linux/builders/Android%20GN
Original issue's description:
> Flip proprietary codecs to false for Android chromium builds.
>
> Official builds still using branding=Chrome so they will continue
> to support codecs and containers like h264, mp3, aac, and mp4.
>
> Adds support for video/webm videos using vp8,vorbis to the webview
> tests so they will continue to work w/o proprietary codecs.
>
> We have approval to do this now. Summary will be posted to the
> src= launch bug: http://crbug.com/533190#c17
>
> This will require some changes to the build flags for the official
> WebView AOSP builders, which I'll land shortly after this.
>
> BUG=570762
> TEST=webview tests pass.
>
> Committed: https://crrev.com/43631fe1435e3c79467550b2cf797383d4cba8e6
> Cr-Commit-Position: refs/heads/master@{#380649}
TBR=boliu@chromium.org,ddorwin@chromium.org,dpranke@chromium.org,nyquist@chromium.org,dalecurtis@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=570762
Review URL: https://codereview.chromium.org/1785173005
Cr-Commit-Position: refs/heads/master@{#380731}
22 files changed, 48 insertions, 62 deletions
diff --git a/android_webview/android_webview_tests.gypi b/android_webview/android_webview_tests.gypi index c87b792..ab92ffc 100644 --- a/android_webview/android_webview_tests.gypi +++ b/android_webview/android_webview_tests.gypi @@ -34,7 +34,7 @@ '<(asset_location)/full_screen_video_test.html', '<(asset_location)/full_screen_video_inside_div_test.html', '<(asset_location)/multiple_videos_test.html', - '<(asset_location)/video.webm', + '<(asset_location)/video.mp4', '<(asset_location)/visual_state_during_fullscreen_test.html', '<(asset_location)/visual_state_waits_for_js_test.html', '<(asset_location)/visual_state_waits_for_js_detached_test.html', @@ -62,7 +62,7 @@ '<(java_in_dir)/assets/full_screen_video_test.html', '<(java_in_dir)/assets/full_screen_video_inside_div_test.html', '<(java_in_dir)/assets/multiple_videos_test.html', - '<(java_in_dir)/assets/video.webm', + '<(java_in_dir)/assets/video.mp4', '<(java_in_dir)/assets/visual_state_during_fullscreen_test.html', '<(java_in_dir)/assets/visual_state_waits_for_js_test.html', '<(java_in_dir)/assets/visual_state_waits_for_js_detached_test.html', diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/KeySystemTest.java b/android_webview/javatests/src/org/chromium/android_webview/test/KeySystemTest.java index ff9e489..32ee9aa 100644 --- a/android_webview/javatests/src/org/chromium/android_webview/test/KeySystemTest.java +++ b/android_webview/javatests/src/org/chromium/android_webview/test/KeySystemTest.java @@ -4,7 +4,6 @@ package org.chromium.android_webview.test; -import android.os.Build; import android.test.suitebuilder.annotation.SmallTest; import org.chromium.android_webview.AwContents; @@ -67,16 +66,12 @@ public class KeySystemTest extends AwTestBase { + " navigator.requestMediaKeySystemAccess(keySystem, [{}]).then(" + " success, failure);" + "}" - + "function areProprietaryCodecsSupported() {" - + " var video = document.createElement('video');" - + " return video.canPlayType('video/mp4; codecs=\"avc1\"');" - + "}" + "</script> </html>"; } private String isKeySystemSupported(String keySystem) throws Exception { - executeJavaScriptAndWaitForResult( - mAwContents, mContentsClient, "isKeySystemSupported('" + keySystem + "')"); + executeJavaScriptAndWaitForResult(mAwContents, mContentsClient, + "isKeySystemSupported('" + keySystem + "')"); poll(new Callable<Boolean>() { @Override @@ -88,12 +83,6 @@ public class KeySystemTest extends AwTestBase { return getResultFromJS(); } - private boolean areProprietaryCodecsSupported() throws Exception { - String result = executeJavaScriptAndWaitForResult( - mAwContents, mContentsClient, "areProprietaryCodecsSupported()"); - return !result.isEmpty(); - } - private String getResultFromJS() { String result = "null"; try { @@ -105,18 +94,6 @@ public class KeySystemTest extends AwTestBase { return result; } - private String getPlatformKeySystemExpectations() throws Exception { - // Android key systems only support non-proprietary codecs on Lollipop+. - // When neither is true isKeySystemSupported() will return an error for - // all key systems except ClearKey (which is handled by Chrome itself). - if (!areProprietaryCodecsSupported() - && Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) { - return "\"NotSupportedError\""; - } - - return "\"supported\""; - } - @Feature({"AndroidWebView"}) @SmallTest public void testSupportClearKeySystem() throws Throwable { @@ -126,8 +103,7 @@ public class KeySystemTest extends AwTestBase { @Feature({"AndroidWebView"}) @SmallTest public void testSupportWidevineKeySystem() throws Throwable { - assertEquals( - getPlatformKeySystemExpectations(), isKeySystemSupported("com.widevine.alpha")); + assertEquals("\"supported\"", isKeySystemSupported("com.widevine.alpha")); } @Feature({"AndroidWebView"}) @@ -139,8 +115,7 @@ public class KeySystemTest extends AwTestBase { @Feature({"AndroidWebView"}) @SmallTest public void testSupportPlatformKeySystem() throws Throwable { - assertEquals(getPlatformKeySystemExpectations(), - isKeySystemSupported("x-com.oem.test-keysystem")); + assertEquals("\"supported\"", isKeySystemSupported("x-com.oem.test-keysystem")); } @Feature({"AndroidWebView"}) diff --git a/android_webview/test/BUILD.gn b/android_webview/test/BUILD.gn index 68b71d4..92b46fa 100644 --- a/android_webview/test/BUILD.gn +++ b/android_webview/test/BUILD.gn @@ -65,7 +65,7 @@ android_assets("android_webview_apk_assets") { "shell/assets/full_screen_video_inside_div_test.html", "shell/assets/full_screen_video_test.html", "shell/assets/multiple_videos_test.html", - "shell/assets/video.webm", + "shell/assets/video.mp4", "shell/assets/visual_state_during_fullscreen_test.html", "shell/assets/visual_state_on_page_commit_visible_test.html", "shell/assets/visual_state_waits_for_js_detached_test.html", diff --git a/android_webview/test/shell/assets/full_screen_video_inside_div_test.html b/android_webview/test/shell/assets/full_screen_video_inside_div_test.html index f76d981..7a8f4f2 100644 --- a/android_webview/test/shell/assets/full_screen_video_inside_div_test.html +++ b/android_webview/test/shell/assets/full_screen_video_inside_div_test.html @@ -9,7 +9,7 @@ <div id='div'> <button id="playControl" style='padding:10px 10px;' onclick="playVideo(); return false">Play</button> <video style = 'width: 300px; height: 300px;' id='video'> - <source src="video.webm" type="video/webm"> + <source src="video.mp4" type="video/mp4"> </video> </div> </body> diff --git a/android_webview/test/shell/assets/full_screen_video_test.html b/android_webview/test/shell/assets/full_screen_video_test.html index 6d1979d..c046e70 100644 --- a/android_webview/test/shell/assets/full_screen_video_test.html +++ b/android_webview/test/shell/assets/full_screen_video_test.html @@ -9,7 +9,7 @@ <button id="fullscreenControl" autofocus style ='padding:10px 10px;' onclick="goFullscreen('video'); return false">Go fullscreen</button> <button id="playControl" style='padding:10px 10px;' onclick="playVideo(); return false">Play</button> <video style = 'width: 10px; height: 10px;' id='video' controls> - <source src="video.webm" type="video/webm"> + <source src="video.mp4" type="video/mp4"> </video> </body> </html> diff --git a/android_webview/test/shell/assets/multiple_videos_test.html b/android_webview/test/shell/assets/multiple_videos_test.html index 70c3945..12ded88 100644 --- a/android_webview/test/shell/assets/multiple_videos_test.html +++ b/android_webview/test/shell/assets/multiple_videos_test.html @@ -18,11 +18,11 @@ function playSecondVideo() { <button id="playSecondButton" style='padding:10px 10px;' onclick="playSecondVideo(); return false">Play second</button> <video style='width: 10px; height: 10px;' id='firstVideo' controls> - <source src="video.webm" type="video/webm"> + <source src="video.mp4" type="video/mp4"> </video> <video style='width: 10px; height: 10px;' id='secondVideo' controls> - <source src="video.webm" type="video/webm"> + <source src="video.mp4" type="video/mp4"> </video> </body> diff --git a/android_webview/test/shell/assets/video.mp4 b/android_webview/test/shell/assets/video.mp4 Binary files differnew file mode 100644 index 0000000..3763b59 --- /dev/null +++ b/android_webview/test/shell/assets/video.mp4 diff --git a/android_webview/test/shell/assets/video.webm b/android_webview/test/shell/assets/video.webm Binary files differdeleted file mode 100644 index 7bfc552..0000000 --- a/android_webview/test/shell/assets/video.webm +++ /dev/null diff --git a/build/common.gypi b/build/common.gypi index 32daaf2..a73eb1b 100644 --- a/build/common.gypi +++ b/build/common.gypi @@ -833,9 +833,10 @@ 'use_browser_spellchecker%': 1, }], - # Enables proprietary codecs and demuxers; e.g. H264, AAC, MP3, and MP4. - # We always build Google Chrome and Chromecast with proprietary codecs. - ['branding=="Chrome" or chromecast==1', { + # Android OS includes support for proprietary codecs regardless of + # building Chromium or Google Chrome. We also ship Google Chrome and + # Chromecast with proprietary codecs. + ['OS=="android" or branding=="Chrome" or chromecast==1', { 'proprietary_codecs%': 1, }, { 'proprietary_codecs%': 0, diff --git a/build/config/features.gni b/build/config/features.gni index c965844..8efa7cf 100644 --- a/build/config/features.gni +++ b/build/config/features.gni @@ -46,9 +46,11 @@ declare_args() { # Enables the Media Router. enable_media_router = !is_ios - # Enables proprietary codecs and demuxers; e.g. H264, AAC, MP3, and MP4. - # We always build Google Chrome and Chromecast with proprietary codecs. - proprietary_codecs = is_chrome_branded || is_chromecast + # Enables proprietary codecs and demuxers; e.g. H264, MOV, AAC, and MP3. + # Android OS includes support for proprietary codecs regardless of building + # Chromium or Google Chrome. We also ship Google Chrome and Chromecast with + # proprietary codecs. + proprietary_codecs = is_android || is_chrome_branded || is_chromecast enable_configuration_policy = !is_ios diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/contextmenu/ContextMenuTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/contextmenu/ContextMenuTest.java index fcfa41e..e004173 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/contextmenu/ContextMenuTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/contextmenu/ContextMenuTest.java @@ -234,7 +234,7 @@ public class ContextMenuTest extends DownloadTestBase { throws InterruptedException, TimeoutException, SecurityException, IOException { // Click the video to enable playback DOMUtils.clickNode(this, getActivity().getCurrentContentViewCore(), "videoDOMElement"); - saveMediaFromContextMenu("videoDOMElement", R.id.contextmenu_save_video, "test.webm"); + saveMediaFromContextMenu("videoDOMElement", R.id.contextmenu_save_video, "test.mp4"); } /** diff --git a/chrome/test/data/android/contextmenu/context_menu_test.html b/chrome/test/data/android/contextmenu/context_menu_test.html index ab9418d..3c88f46 100644 --- a/chrome/test/data/android/contextmenu/context_menu_test.html +++ b/chrome/test/data/android/contextmenu/context_menu_test.html @@ -31,7 +31,7 @@ V0aCcGCmTIHEIUEqjgaORCMxIC6e0CcguWw6aFjsVMkkIr7g77ZKPJjPZqIyd7sJAgVGoEGv2xsBxqNg width="16" height="14" alt="embedded folder icon" id="dataUrlIcon"><br /> <video id="videoDOMElement" controls> - <source src="../media/test.webm" type="video/webm"> + <source src="../media/test.mp4" type="video/mp4"> </video><br /> </body> diff --git a/chrome/test/data/android/media/test.webm b/chrome/test/data/android/media/test.webm Binary files differdeleted file mode 100644 index f1a92fc..0000000 --- a/chrome/test/data/android/media/test.webm +++ /dev/null diff --git a/components/cdm/browser/widevine_drm_delegate_android.cc b/components/cdm/browser/widevine_drm_delegate_android.cc index d4133ee..ba09143 100644 --- a/components/cdm/browser/widevine_drm_delegate_android.cc +++ b/components/cdm/browser/widevine_drm_delegate_android.cc @@ -36,13 +36,9 @@ bool WidevineDrmDelegateAndroid::OnCreateSession( if (init_data_type != media::EmeInitDataType::CENC) return true; -#if defined(PROPRIETARY_CODECS) // Widevine MediaDrm plugin only accepts the "data" part of the PSSH box as // the init data when using MP4 container. return media::GetPsshData(init_data, GetUUID(), init_data_out); -#else - return false; -#endif } } // namespace cdm diff --git a/components/dom_distiller/content/browser/distiller_page_web_contents_browsertest.cc b/components/dom_distiller/content/browser/distiller_page_web_contents_browsertest.cc index bc52b01..78ba075 100644 --- a/components/dom_distiller/content/browser/distiller_page_web_contents_browsertest.cc +++ b/components/dom_distiller/content/browser/distiller_page_web_contents_browsertest.cc @@ -250,7 +250,7 @@ IN_PROC_BROWSER_TEST_F(DistillerPageWebContentsTest, HandlesRelativeVideos) { // A relative source/track should've been updated. EXPECT_THAT(distiller_result_->distilled_content().html(), - ContainsRegex("src=\"http://127.0.0.1:.*/relative_video.webm\"")); + ContainsRegex("src=\"http://127.0.0.1:.*/relative_video.mp4\"")); EXPECT_THAT( distiller_result_->distilled_content().html(), ContainsRegex("src=\"http://127.0.0.1:.*/relative_track_en.vtt\"")); diff --git a/components/test/data/dom_distiller/video_article.html b/components/test/data/dom_distiller/video_article.html index 1ca2ce9..7fac7ae 100644 --- a/components/test/data/dom_distiller/video_article.html +++ b/components/test/data/dom_distiller/video_article.html @@ -7,7 +7,7 @@ <p>Lorem ipsum dolor sit amet, at alia aliquip vel. Quas inani labore an vel. Sed an nemore minimum accusata. Sint inermis tacimates est ex, ad movet iracundia mei, delicata iracundia laboramus ei eos. Illud principes complectitur te nec, ius alienum insolens ea, cu quo oratio omnesque. <video width="500" height="400" controls> - <source src="relative_video.webm" type="video/webm"> + <source src="relative_video.mp4" type="video/mp4"> <source src="http://www.google.com/absolute_video.ogg" type="video/ogg"> <track src="relative_track_en.vtt" kind="chapters" srclang="en" label="English"> <track src="http://www.google.com/absolute_track_fr.vtt" kind="chapters" srclang="fr" label="French"> diff --git a/content/browser/media/media_canplaytype_browsertest.cc b/content/browser/media/media_canplaytype_browsertest.cc index 1a3af5a..0b70f41 100644 --- a/content/browser/media/media_canplaytype_browsertest.cc +++ b/content/browser/media/media_canplaytype_browsertest.cc @@ -42,8 +42,8 @@ const char* kOggVideoMaybe = kNot; const char* kTheoraProbably = kNot; const char* kOggOpusProbably = kNot; const char* kMpeg2AacProbably = kNot; // https://crbug.com/544268. -const char* kHlsProbably = kPropProbably; -const char* kHlsMaybe = kPropMaybe; +const char* kHlsProbably = kProbably; +const char* kHlsMaybe = kMaybe; #endif // !OS_ANDROID #if BUILDFLAG(ENABLE_HEVC_DEMUXING) diff --git a/media/BUILD.gn b/media/BUILD.gn index b0750196..34f6759 100644 --- a/media/BUILD.gn +++ b/media/BUILD.gn @@ -642,15 +642,19 @@ test("media_unittests") { sources += [ "ffmpeg/ffmpeg_common_unittest.cc", "filters/audio_decoder_unittest.cc", - "filters/audio_file_reader_unittest.cc", "filters/blocking_url_protocol_unittest.cc", - "filters/ffmpeg_demuxer_unittest.cc", "filters/ffmpeg_glue_unittest.cc", "filters/in_memory_url_protocol_unittest.cc", ] if (!is_android) { sources += [ + # These tests are confused by Android always having proprietary + # codecs enabled, but ffmpeg_branding=Chromium. These should be + # fixed, http://crbug.com/570762. + "filters/audio_file_reader_unittest.cc", + "filters/ffmpeg_demuxer_unittest.cc", + # FFmpeg on Android does not include video decoders. "filters/ffmpeg_video_decoder_unittest.cc", ] diff --git a/media/base/android/BUILD.gn b/media/base/android/BUILD.gn index b9db10a..7ac7d97 100644 --- a/media/base/android/BUILD.gn +++ b/media/base/android/BUILD.gn @@ -83,6 +83,7 @@ source_set("unittests") { sources = [ "access_unit_queue_unittest.cc", "media_codec_decoder_unittest.cc", + "media_codec_player_unittest.cc", "media_drm_bridge_unittest.cc", "media_player_bridge_unittest.cc", "media_source_player_unittest.cc", @@ -91,11 +92,6 @@ source_set("unittests") { "test_data_factory.h", "test_statistics.h", ] - - if (proprietary_codecs) { - sources += [ "media_codec_player_unittest.cc" ] - } - deps = [ ":android", "//media/base:test_support", diff --git a/media/base/mime_util_unittest.cc b/media/base/mime_util_unittest.cc index 0690f85..da9877d 100644 --- a/media/base/mime_util_unittest.cc +++ b/media/base/mime_util_unittest.cc @@ -131,7 +131,7 @@ TEST(MimeUtilTest, CommonMediaMimeType) { EXPECT_TRUE(IsSupportedMediaMimeType("video/ogg")); #endif // OS_ANDROID -#if defined(OS_ANDROID) && defined(USE_PROPRIETARY_CODECS) +#if defined(OS_ANDROID) // HLS is supported on Android API level 14 and higher and Chrome supports // API levels 15 and higher, so these are expected to be supported. bool kHlsSupported = true; diff --git a/media/filters/audio_decoder_unittest.cc b/media/filters/audio_decoder_unittest.cc index b0a7c73..72881b7 100644 --- a/media/filters/audio_decoder_unittest.cc +++ b/media/filters/audio_decoder_unittest.cc @@ -493,6 +493,7 @@ INSTANTIATE_TEST_CASE_P(OpusAudioDecoderBehavioralTest, testing::ValuesIn(kOpusBehavioralTest)); #if defined(OS_ANDROID) + const DecoderTestData kMediaCodecTests[] = { {MEDIA_CODEC, kCodecOpus, "bear-opus.ogg", kBearOpusExpectations, 24, 48000, CHANNEL_LAYOUT_STEREO}, @@ -501,7 +502,10 @@ const DecoderTestData kMediaCodecTests[] = { INSTANTIATE_TEST_CASE_P(MediaCodecAudioDecoderTest, AudioDecoderTest, testing::ValuesIn(kMediaCodecTests)); -#endif // defined(OS_ANDROID) + +#else // !defined(OS_ANDROID) + +// Disable all FFmpeg decoder tests on Android. http://crbug.com/570762. #if defined(USE_PROPRIETARY_CODECS) const DecodedBufferExpectations kSfxMp3Expectations[] = { @@ -584,4 +588,6 @@ INSTANTIATE_TEST_CASE_P(FFmpegAudioDecoderBehavioralTest, FFmpegAudioDecoderBehavioralTest, testing::ValuesIn(kFFmpegBehavioralTest)); +#endif // !defined(OS_ANDROID) + } // namespace media diff --git a/media/media.gyp b/media/media.gyp index b8dae1a..0863c02 100644 --- a/media/media.gyp +++ b/media/media.gyp @@ -1162,6 +1162,7 @@ '<@(capture_unittests_sources)', 'base/android/access_unit_queue_unittest.cc', 'base/android/media_codec_decoder_unittest.cc', + 'base/android/media_codec_player_unittest.cc', 'base/android/media_drm_bridge_unittest.cc', 'base/android/media_player_bridge_unittest.cc', 'base/android/media_source_player_unittest.cc', @@ -1332,6 +1333,12 @@ 'filters/ffmpeg_video_decoder_unittest.cc', 'test/pipeline_integration_test.cc', 'test/pipeline_integration_test_base.cc', + + # These tests are confused by Android always having proprietary + # codecs enabled, but ffmpeg_branding=Chromium. These should be + # fixed, see http://crbug.com/570762. + 'filters/audio_file_reader_unittest.cc', + 'filters/ffmpeg_demuxer_unittest.cc', ], }], ['OS=="android"', { @@ -1365,7 +1372,6 @@ }], ['proprietary_codecs==1', { 'sources': [ - 'base/android/media_codec_player_unittest.cc', 'cdm/cenc_utils_unittest.cc', 'filters/ffmpeg_aac_bitstream_converter_unittest.cc', 'filters/ffmpeg_h264_to_annex_b_bitstream_converter_unittest.cc', |