Bug 1322650 - Don't use AndroidBridge to get API version in media stack r=jolin
AndroidBridge is not available in child processes.
MozReview-Commit-ID: KlBs8F1Bu1O
--- a/dom/media/MediaPrefs.h
+++ b/dom/media/MediaPrefs.h
@@ -2,17 +2,17 @@
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef MEDIA_PREFS_H
#define MEDIA_PREFS_H
#ifdef MOZ_WIDGET_ANDROID
-#include "AndroidBridge.h"
+#include "GeneratedJNIWrappers.h"
#endif
#include "mozilla/Atomics.h"
// First time MediaPrefs::GetSingleton() needs to be called on the main thread,
// before any of the methods accessing the values are used, but after
// the Preferences system has been initialized.
@@ -194,18 +194,17 @@ public:
private:
template<class T> friend class StaticAutoPtr;
static StaticAutoPtr<MediaPrefs> sInstance;
// Default value functions
static int32_t MediaDecoderLimitDefault()
{
#ifdef MOZ_WIDGET_ANDROID
- if (AndroidBridge::Bridge() &&
- AndroidBridge::Bridge()->GetAPIVersion() < 18) {
+ if (jni::GetAPIVersion() < 18) {
// Older Android versions have broken support for multiple simultaneous
// decoders, see bug 1278574.
return 1;
}
#endif
// Otherwise, set no decoder limit.
return -1;
}
--- a/dom/media/platforms/android/AndroidDecoderModule.cpp
+++ b/dom/media/platforms/android/AndroidDecoderModule.cpp
@@ -1,14 +1,13 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-#include "AndroidDecoderModule.h"
-#include "AndroidBridge.h"
+#include "GeneratedJNIWrappers.h"
#include "MediaInfo.h"
#include "MediaPrefs.h"
#include "OpusDecoder.h"
#include "RemoteDataDecoder.h"
#include "VPXDecoder.h"
#include "VorbisDecoder.h"
#include "nsIGfxInfo.h"
@@ -123,18 +122,17 @@ AndroidDecoderModule::AndroidDecoderModu
mProxy = static_cast<MediaDrmCDMProxy*>(aProxy);
}
bool
AndroidDecoderModule::SupportsMimeType(
const nsACString& aMimeType,
DecoderDoctorDiagnostics* aDiagnostics) const
{
- if (!AndroidBridge::Bridge() ||
- AndroidBridge::Bridge()->GetAPIVersion() < 16) {
+ if (jni::GetAPIVersion() < 16) {
return false;
}
if (aMimeType.EqualsLiteral("video/mp4") ||
aMimeType.EqualsLiteral("video/avc")) {
return true;
}