Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "base/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "content/browser/media/media_browsertest.h" | 6 #include "content/browser/media/media_browsertest.h" |
| 7 #include "content/public/common/content_switches.h" | 7 #include "content/public/common/content_switches.h" |
| 8 #include "media/media_features.h" | |
| 8 #if defined(OS_ANDROID) | 9 #if defined(OS_ANDROID) |
| 9 #include "base/android/build_info.h" | 10 #include "base/android/build_info.h" |
| 10 #endif | 11 #endif |
| 11 | 12 |
| 12 // Common media types. | 13 // Common media types. |
| 13 #if defined(USE_PROPRIETARY_CODECS) && !defined(OS_ANDROID) | 14 #if defined(USE_PROPRIETARY_CODECS) && !defined(OS_ANDROID) |
| 14 const char kAAC_ADTS_AudioOnly[] = "audio/aac"; | 15 const char kAAC_ADTS_AudioOnly[] = "audio/aac"; |
| 15 #endif | 16 #endif |
| 16 const char kWebMAudioOnly[] = "audio/webm; codecs=\"vorbis\""; | 17 const char kWebMAudioOnly[] = "audio/webm; codecs=\"vorbis\""; |
| 17 #if !defined(OS_ANDROID) | 18 #if !defined(OS_ANDROID) |
| 18 const char kWebMOpusAudioOnly[] = "audio/webm; codecs=\"opus\""; | 19 const char kWebMOpusAudioOnly[] = "audio/webm; codecs=\"opus\""; |
| 19 #endif | 20 #endif |
| 20 const char kWebMVideoOnly[] = "video/webm; codecs=\"vp8\""; | 21 const char kWebMVideoOnly[] = "video/webm; codecs=\"vp8\""; |
| 21 const char kWebMAudioVideo[] = "video/webm; codecs=\"vorbis, vp8\""; | 22 const char kWebMAudioVideo[] = "video/webm; codecs=\"vorbis, vp8\""; |
| 22 | 23 |
| 23 #if defined(USE_PROPRIETARY_CODECS) && defined(ENABLE_MPEG2TS_STREAM_PARSER) | 24 #if defined(USE_PROPRIETARY_CODECS) |
|
ddorwin
2016/01/04 22:19:45
Should we convert all such media-related checks in
servolk
2016/01/05 00:18:09
Yes, I guess in the future we'll convert all the l
| |
| 25 #if BUILDFLAG(ENABLE_MSE_MPEG2TS_STREAM_PARSER) | |
| 24 const char kMp2tAudioVideo[] = "video/mp2t; codecs=\"mp4a.40.2, avc1.42E01E\""; | 26 const char kMp2tAudioVideo[] = "video/mp2t; codecs=\"mp4a.40.2, avc1.42E01E\""; |
| 25 #endif | 27 #endif |
| 28 #endif | |
| 26 | 29 |
| 27 namespace content { | 30 namespace content { |
| 28 | 31 |
| 29 // MSE is available on all desktop platforms and on Android 4.1 and later. | 32 // MSE is available on all desktop platforms and on Android 4.1 and later. |
| 30 static bool IsMSESupported() { | 33 static bool IsMSESupported() { |
| 31 #if defined(OS_ANDROID) | 34 #if defined(OS_ANDROID) |
| 32 if (base::android::BuildInfo::GetInstance()->sdk_int() < 16) { | 35 if (base::android::BuildInfo::GetInstance()->sdk_int() < 16) { |
| 33 VLOG(0) << "MSE is only supported in Android 4.1 and later."; | 36 VLOG(0) << "MSE is only supported in Android 4.1 and later."; |
| 34 return false; | 37 return false; |
| 35 } | 38 } |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 119 VLOG(0) << "Skipping test - MSE not supported."; | 122 VLOG(0) << "Skipping test - MSE not supported."; |
| 120 return; | 123 return; |
| 121 } | 124 } |
| 122 base::StringPairs query_params; | 125 base::StringPairs query_params; |
| 123 query_params.push_back(std::make_pair("videoFormat", "CLEAR_WEBM")); | 126 query_params.push_back(std::make_pair("videoFormat", "CLEAR_WEBM")); |
| 124 query_params.push_back(std::make_pair("audioFormat", "CLEAR_MP4")); | 127 query_params.push_back(std::make_pair("audioFormat", "CLEAR_MP4")); |
| 125 RunMediaTestPage("mse_different_containers.html", query_params, kEnded, true); | 128 RunMediaTestPage("mse_different_containers.html", query_params, kEnded, true); |
| 126 } | 129 } |
| 127 #endif | 130 #endif |
| 128 | 131 |
| 129 #if defined(USE_PROPRIETARY_CODECS) && defined(ENABLE_MPEG2TS_STREAM_PARSER) | 132 #if defined(USE_PROPRIETARY_CODECS) |
| 133 #if BUILDFLAG(ENABLE_MSE_MPEG2TS_STREAM_PARSER) | |
| 130 IN_PROC_BROWSER_TEST_F(MediaSourceTest, Playback_AudioVideo_Mp2t) { | 134 IN_PROC_BROWSER_TEST_F(MediaSourceTest, Playback_AudioVideo_Mp2t) { |
| 131 TestSimplePlayback("bear-1280x720.ts", kMp2tAudioVideo, kEnded); | 135 TestSimplePlayback("bear-1280x720.ts", kMp2tAudioVideo, kEnded); |
| 132 } | 136 } |
| 133 #endif | 137 #endif |
| 138 #endif | |
| 134 } // namespace content | 139 } // namespace content |
| OLD | NEW |