Commit 90d1a3f8 authored by watk's avatar watk Committed by Commit bot

media: Delete code checking for pre-JellyBean Android versions

API level < 16 is not supported by Chrome, so we don't need to handle it.

Review-Url: https://codereview.chromium.org/2379303003
Cr-Commit-Position: refs/heads/master@{#422554}
parent 478ac0e1
...@@ -99,17 +99,6 @@ enum class EncryptedContainer { ...@@ -99,17 +99,6 @@ enum class EncryptedContainer {
ENCRYPTED_MP4 ENCRYPTED_MP4
}; };
// MSE is available on all desktop platforms and on Android 4.1 and later.
static bool IsMSESupported() {
#if defined(OS_ANDROID)
if (base::android::BuildInfo::GetInstance()->sdk_int() < 16) {
DVLOG(0) << "MSE is only supported in Android 4.1 and later.";
return false;
}
#endif // defined(OS_ANDROID)
return true;
}
// Base class for encrypted media tests. // Base class for encrypted media tests.
class EncryptedMediaTestBase : public MediaBrowserTest { class EncryptedMediaTestBase : public MediaBrowserTest {
public: public:
...@@ -153,10 +142,6 @@ class EncryptedMediaTestBase : public MediaBrowserTest { ...@@ -153,10 +142,6 @@ class EncryptedMediaTestBase : public MediaBrowserTest {
bool force_invalid_response, bool force_invalid_response,
PlayTwice play_twice, PlayTwice play_twice,
const std::string& expected_title) { const std::string& expected_title) {
if (src_type == MSE && !IsMSESupported()) {
DVLOG(0) << "Skipping test - MSE not supported.";
return;
}
base::StringPairs query_params; base::StringPairs query_params;
query_params.push_back(std::make_pair("mediaFile", media_file)); query_params.push_back(std::make_pair("mediaFile", media_file));
query_params.push_back(std::make_pair("mediaType", media_type)); query_params.push_back(std::make_pair("mediaType", media_type));
...@@ -376,7 +361,6 @@ class EncryptedMediaTest : public EncryptedMediaTestBase, ...@@ -376,7 +361,6 @@ class EncryptedMediaTest : public EncryptedMediaTestBase,
} }
void TestConfigChange() { void TestConfigChange() {
DCHECK(IsMSESupported());
base::StringPairs query_params; base::StringPairs query_params;
query_params.push_back(std::make_pair("keySystem", CurrentKeySystem())); query_params.push_back(std::make_pair("keySystem", CurrentKeySystem()));
query_params.push_back(std::make_pair("runEncrypted", "1")); query_params.push_back(std::make_pair("runEncrypted", "1"));
...@@ -403,7 +387,6 @@ class EncryptedMediaTest : public EncryptedMediaTestBase, ...@@ -403,7 +387,6 @@ class EncryptedMediaTest : public EncryptedMediaTestBase,
void TestDifferentContainers(EncryptedContainer video_format, void TestDifferentContainers(EncryptedContainer video_format,
EncryptedContainer audio_format) { EncryptedContainer audio_format) {
DCHECK(IsMSESupported());
base::StringPairs query_params; base::StringPairs query_params;
query_params.push_back(std::make_pair("keySystem", CurrentKeySystem())); query_params.push_back(std::make_pair("keySystem", CurrentKeySystem()));
query_params.push_back(std::make_pair("runEncrypted", "1")); query_params.push_back(std::make_pair("runEncrypted", "1"));
...@@ -515,10 +498,6 @@ IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, InvalidResponseKeyError) { ...@@ -515,10 +498,6 @@ IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, InvalidResponseKeyError) {
} }
IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, ConfigChangeVideo) { IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, ConfigChangeVideo) {
if (CurrentSourceType() != MSE || !IsMSESupported()) {
DVLOG(0) << "Skipping test - ConfigChange test requires MSE.";
return;
}
if (!IsPlayBackPossible(CurrentKeySystem())) { if (!IsPlayBackPossible(CurrentKeySystem())) {
DVLOG(0) << "Skipping test - ConfigChange test requires video playback."; DVLOG(0) << "Skipping test - ConfigChange test requires video playback.";
return; return;
......
...@@ -53,17 +53,6 @@ enum SrcType { ...@@ -53,17 +53,6 @@ enum SrcType {
namespace content { namespace content {
// MSE is available on all desktop platforms and on Android 4.1 and later.
static bool IsMSESupported() {
#if defined(OS_ANDROID)
if (base::android::BuildInfo::GetInstance()->sdk_int() < 16) {
VLOG(0) << "MSE is only supported in Android 4.1 and later.";
return false;
}
#endif // defined(OS_ANDROID)
return true;
}
// Tests encrypted media playback with a combination of parameters: // Tests encrypted media playback with a combination of parameters:
// - char*: Key system name. // - char*: Key system name.
// - SrcType: The type of video src used to load media, MSE or SRC. // - SrcType: The type of video src used to load media, MSE or SRC.
...@@ -96,11 +85,6 @@ class EncryptedMediaTest : public content::MediaBrowserTest, ...@@ -96,11 +85,6 @@ class EncryptedMediaTest : public content::MediaBrowserTest,
} }
void TestConfigChange() { void TestConfigChange() {
if (CurrentSourceType() != MSE || !IsMSESupported()) {
VLOG(0) << "Skipping test - config change test requires MSE.";
return;
}
base::StringPairs query_params; base::StringPairs query_params;
query_params.push_back(std::make_pair("keySystem", CurrentKeySystem())); query_params.push_back(std::make_pair("keySystem", CurrentKeySystem()));
query_params.push_back(std::make_pair("runEncrypted", "1")); query_params.push_back(std::make_pair("runEncrypted", "1"));
...@@ -113,11 +97,6 @@ class EncryptedMediaTest : public content::MediaBrowserTest, ...@@ -113,11 +97,6 @@ class EncryptedMediaTest : public content::MediaBrowserTest,
const std::string& key_system, const std::string& key_system,
SrcType src_type, SrcType src_type,
const std::string& expectation) { const std::string& expectation) {
if (src_type == MSE && !IsMSESupported()) {
VLOG(0) << "Skipping test - MSE not supported.";
return;
}
base::StringPairs query_params; base::StringPairs query_params;
query_params.push_back(std::make_pair("mediaFile", media_file)); query_params.push_back(std::make_pair("mediaFile", media_file));
query_params.push_back(std::make_pair("mediaType", media_type)); query_params.push_back(std::make_pair("mediaType", media_type));
......
...@@ -30,27 +30,11 @@ const char kMp2tAudioVideo[] = "video/mp2t; codecs=\"mp4a.40.2, avc1.42E01E\""; ...@@ -30,27 +30,11 @@ const char kMp2tAudioVideo[] = "video/mp2t; codecs=\"mp4a.40.2, avc1.42E01E\"";
namespace content { namespace content {
// MSE is available on all desktop platforms and on Android 4.1 and later.
static bool IsMSESupported() {
#if defined(OS_ANDROID)
if (base::android::BuildInfo::GetInstance()->sdk_int() < 16) {
VLOG(0) << "MSE is only supported in Android 4.1 and later.";
return false;
}
#endif // defined(OS_ANDROID)
return true;
}
class MediaSourceTest : public content::MediaBrowserTest { class MediaSourceTest : public content::MediaBrowserTest {
public: public:
void TestSimplePlayback(const std::string& media_file, void TestSimplePlayback(const std::string& media_file,
const std::string& media_type, const std::string& media_type,
const std::string& expectation) { const std::string& expectation) {
if (!IsMSESupported()) {
VLOG(0) << "Skipping test - MSE not supported.";
return;
}
base::StringPairs query_params; base::StringPairs query_params;
query_params.push_back(std::make_pair("mediaFile", media_file)); query_params.push_back(std::make_pair("mediaFile", media_file));
query_params.push_back(std::make_pair("mediaType", media_type)); query_params.push_back(std::make_pair("mediaType", media_type));
...@@ -99,10 +83,6 @@ IN_PROC_BROWSER_TEST_F(MediaSourceTest, Playback_Type_Error) { ...@@ -99,10 +83,6 @@ IN_PROC_BROWSER_TEST_F(MediaSourceTest, Playback_Type_Error) {
// Flaky test crbug.com/246308 // Flaky test crbug.com/246308
// Test changed to skip checks resulting in flakiness. Proper fix still needed. // Test changed to skip checks resulting in flakiness. Proper fix still needed.
IN_PROC_BROWSER_TEST_F(MediaSourceTest, ConfigChangeVideo) { IN_PROC_BROWSER_TEST_F(MediaSourceTest, ConfigChangeVideo) {
if (!IsMSESupported()) {
VLOG(0) << "Skipping test - MSE not supported.";
return;
}
RunMediaTestPage("mse_config_change.html", base::StringPairs(), kEnded, true); RunMediaTestPage("mse_config_change.html", base::StringPairs(), kEnded, true);
} }
...@@ -111,10 +91,6 @@ IN_PROC_BROWSER_TEST_F(MediaSourceTest, ConfigChangeVideo) { ...@@ -111,10 +91,6 @@ IN_PROC_BROWSER_TEST_F(MediaSourceTest, ConfigChangeVideo) {
// TODO(chcunningham): Figure out why this is flaky on android. crbug/607841 // TODO(chcunningham): Figure out why this is flaky on android. crbug/607841
#if !defined(OS_ANDROID) #if !defined(OS_ANDROID)
IN_PROC_BROWSER_TEST_F(MediaSourceTest, Playback_Video_MP4_Audio_WEBM) { IN_PROC_BROWSER_TEST_F(MediaSourceTest, Playback_Video_MP4_Audio_WEBM) {
if (!IsMSESupported()) {
VLOG(0) << "Skipping test - MSE not supported.";
return;
}
base::StringPairs query_params; base::StringPairs query_params;
query_params.push_back(std::make_pair("videoFormat", "CLEAR_MP4")); query_params.push_back(std::make_pair("videoFormat", "CLEAR_MP4"));
query_params.push_back(std::make_pair("audioFormat", "CLEAR_WEBM")); query_params.push_back(std::make_pair("audioFormat", "CLEAR_WEBM"));
...@@ -123,10 +99,6 @@ IN_PROC_BROWSER_TEST_F(MediaSourceTest, Playback_Video_MP4_Audio_WEBM) { ...@@ -123,10 +99,6 @@ IN_PROC_BROWSER_TEST_F(MediaSourceTest, Playback_Video_MP4_Audio_WEBM) {
#endif // !defined(OS_ANDROID) #endif // !defined(OS_ANDROID)
IN_PROC_BROWSER_TEST_F(MediaSourceTest, Playback_Video_WEBM_Audio_MP4) { IN_PROC_BROWSER_TEST_F(MediaSourceTest, Playback_Video_WEBM_Audio_MP4) {
if (!IsMSESupported()) {
VLOG(0) << "Skipping test - MSE not supported.";
return;
}
base::StringPairs query_params; base::StringPairs query_params;
query_params.push_back(std::make_pair("videoFormat", "CLEAR_WEBM")); query_params.push_back(std::make_pair("videoFormat", "CLEAR_WEBM"));
query_params.push_back(std::make_pair("audioFormat", "CLEAR_MP4")); query_params.push_back(std::make_pair("audioFormat", "CLEAR_MP4"));
......
...@@ -585,16 +585,6 @@ class AudioAndroidOutputTest : public testing::Test { ...@@ -585,16 +585,6 @@ class AudioAndroidOutputTest : public testing::Test {
DISALLOW_COPY_AND_ASSIGN(AudioAndroidOutputTest); DISALLOW_COPY_AND_ASSIGN(AudioAndroidOutputTest);
}; };
// AudioRecordInputStream should only be created on Jelly Bean and higher. This
// ensures we only test against the AudioRecord path when that is satisfied.
std::vector<bool> RunAudioRecordInputPathTests() {
std::vector<bool> tests;
tests.push_back(false);
if (base::android::BuildInfo::GetInstance()->sdk_int() >= 16)
tests.push_back(true);
return tests;
}
// Test fixture class for tests which exercise the input path, or both input and // Test fixture class for tests which exercise the input path, or both input and
// output paths. It is value-parameterized to test against both the Java // output paths. It is value-parameterized to test against both the Java
// AudioRecord (when true) and native OpenSLES (when false) input paths. // AudioRecord (when true) and native OpenSLES (when false) input paths.
...@@ -612,8 +602,9 @@ class AudioAndroidInputTest : public AudioAndroidOutputTest, ...@@ -612,8 +602,9 @@ class AudioAndroidInputTest : public AudioAndroidOutputTest,
GetDefaultInputStreamParametersOnAudioThread(); GetDefaultInputStreamParametersOnAudioThread();
AudioParameters params = audio_input_parameters(); AudioParameters params = audio_input_parameters();
// Override the platform effects setting to use the AudioRecord or OpenSLES
// path as requested. // Only the AudioRecord path supports effects, so we can force it to be
// selected for the test by requesting one. OpenSLES is used otherwise.
params.set_effects(GetParam() ? AudioParameters::ECHO_CANCELLER params.set_effects(GetParam() ? AudioParameters::ECHO_CANCELLER
: AudioParameters::NO_EFFECTS); : AudioParameters::NO_EFFECTS);
return params; return params;
...@@ -976,7 +967,8 @@ TEST_P(AudioAndroidInputTest, ...@@ -976,7 +967,8 @@ TEST_P(AudioAndroidInputTest,
StopAndCloseAudioInputStreamOnAudioThread(); StopAndCloseAudioInputStreamOnAudioThread();
} }
INSTANTIATE_TEST_CASE_P(AudioAndroidInputTest, AudioAndroidInputTest, INSTANTIATE_TEST_CASE_P(AudioAndroidInputTest,
testing::ValuesIn(RunAudioRecordInputPathTests())); AudioAndroidInputTest,
testing::Bool());
} // namespace media } // namespace media
...@@ -263,12 +263,7 @@ AudioInputStream* AudioManagerAndroid::MakeLowLatencyInputStream( ...@@ -263,12 +263,7 @@ AudioInputStream* AudioManagerAndroid::MakeLowLatencyInputStream(
if (params.effects() != AudioParameters::NO_EFFECTS) { if (params.effects() != AudioParameters::NO_EFFECTS) {
// Platform effects can only be enabled through the AudioRecord path. // Platform effects can only be enabled through the AudioRecord path.
// An effect should only have been requested here if recommended by // An effect should only have been requested here if recommended by
// AudioManagerAndroid.shouldUse<Effect>. // AudioManagerAndroid#shouldUse...().
//
// Creating this class requires Jelly Bean, which is already guaranteed by
// shouldUse<Effect>. Only DCHECK on that condition to allow tests to use
// the effect settings as a way to select the input path.
DCHECK_GE(base::android::BuildInfo::GetInstance()->sdk_int(), 16);
DVLOG(1) << "Creating AudioRecordInputStream"; DVLOG(1) << "Creating AudioRecordInputStream";
return new AudioRecordInputStream(this, params); return new AudioRecordInputStream(this, params);
} }
......
...@@ -25,9 +25,6 @@ class AudioManagerAndroid; ...@@ -25,9 +25,6 @@ class AudioManagerAndroid;
// AudioRecordInput.java. This class is created and lives on the Audio Manager // AudioRecordInput.java. This class is created and lives on the Audio Manager
// thread but recorded audio buffers are delivered on a thread managed by // thread but recorded audio buffers are delivered on a thread managed by
// the Java class. // the Java class.
//
// The Java class makes use of AudioEffect features which are first available
// in Jelly Bean. It should not be instantiated running against earlier SDKs.
class MEDIA_EXPORT AudioRecordInputStream : public AudioInputStream { class MEDIA_EXPORT AudioRecordInputStream : public AudioInputStream {
public: public:
AudioRecordInputStream(AudioManagerAndroid* manager, AudioRecordInputStream(AudioManagerAndroid* manager,
......
...@@ -89,11 +89,7 @@ static bool IsDecoderSupportedByDevice(const std::string& android_mime_type) { ...@@ -89,11 +89,7 @@ static bool IsDecoderSupportedByDevice(const std::string& android_mime_type) {
// static // static
bool MediaCodecUtil::IsMediaCodecAvailable() { bool MediaCodecUtil::IsMediaCodecAvailable() {
// MediaCodec is only available on JB and greater. // Blacklist some devices on Jellybean as MediaCodec is buggy.
if (base::android::BuildInfo::GetInstance()->sdk_int() < 16)
return false;
// Blacklist some devices on Jellybean as for MediaCodec support is buggy.
// http://crbug.com/365494, http://crbug.com/615872 // http://crbug.com/365494, http://crbug.com/615872
if (base::android::BuildInfo::GetInstance()->sdk_int() <= 19) { if (base::android::BuildInfo::GetInstance()->sdk_int() <= 19) {
std::string model(base::android::BuildInfo::GetInstance()->model()); std::string model(base::android::BuildInfo::GetInstance()->model());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment