summaryrefslogtreecommitdiff
path: root/dom/media
diff options
context:
space:
mode:
Diffstat (limited to 'dom/media')
-rw-r--r--dom/media/Benchmark.cpp7
-rw-r--r--dom/media/CubebUtils.cpp2
-rw-r--r--dom/media/MediaPrefs.h19
-rw-r--r--dom/media/eme/MediaKeySystemAccess.cpp58
-rw-r--r--dom/media/eme/MediaKeys.cpp11
-rw-r--r--dom/media/fmp4/MP4Decoder.cpp3
-rw-r--r--dom/media/mediasource/MediaSource.cpp9
-rw-r--r--dom/media/platforms/PDMFactory.cpp16
-rw-r--r--dom/media/webrtc/MediaEngineDefault.cpp9
-rw-r--r--dom/media/webrtc/MediaEngineWebRTC.cpp34
10 files changed, 1 insertions, 167 deletions
diff --git a/dom/media/Benchmark.cpp b/dom/media/Benchmark.cpp
index e2b4abe7bb..27a6740a2b 100644
--- a/dom/media/Benchmark.cpp
+++ b/dom/media/Benchmark.cpp
@@ -14,10 +14,7 @@
#include "mozilla/SharedThreadPool.h"
#include "mozilla/dom/ContentChild.h"
-#ifndef MOZ_WIDGET_ANDROID
#include "WebMSample.h"
-#endif
-
namespace mozilla {
// Update this version number to force re-running the benchmark. Such as when
@@ -34,9 +31,6 @@ VP9Benchmark::IsVP9DecodeFast()
{
MOZ_ASSERT(NS_IsMainThread());
-#ifdef MOZ_WIDGET_ANDROID
- return false;
-#else
bool hasPref = Preferences::HasUserValue(sBenchmarkFpsPref);
uint32_t hadRecentUpdate = Preferences::GetUint(sBenchmarkFpsVersionCheck, 0U);
@@ -81,7 +75,6 @@ VP9Benchmark::IsVP9DecodeFast()
Preferences::GetUint("media.benchmark.vp9.threshold", 150);
return decodeFps >= threshold;
-#endif
}
Benchmark::Benchmark(MediaDataDemuxer* aDemuxer, const Parameters& aParameters)
diff --git a/dom/media/CubebUtils.cpp b/dom/media/CubebUtils.cpp
index 7f203ce629..aa611973db 100644
--- a/dom/media/CubebUtils.cpp
+++ b/dom/media/CubebUtils.cpp
@@ -276,9 +276,7 @@ void InitLibrary()
PrefChanged(PREF_CUBEB_LATENCY_MSG, nullptr);
Preferences::RegisterCallback(PrefChanged, PREF_CUBEB_LATENCY_PLAYBACK);
Preferences::RegisterCallback(PrefChanged, PREF_CUBEB_LATENCY_MSG);
-#ifndef MOZ_WIDGET_ANDROID
NS_DispatchToMainThread(NS_NewRunnableFunction(&InitBrandName));
-#endif
}
void ShutdownLibrary()
diff --git a/dom/media/MediaPrefs.h b/dom/media/MediaPrefs.h
index c67a899896..c1e66a3cee 100644
--- a/dom/media/MediaPrefs.h
+++ b/dom/media/MediaPrefs.h
@@ -6,10 +6,6 @@
#ifndef MEDIA_PREFS_H
#define MEDIA_PREFS_H
-#ifdef MOZ_WIDGET_ANDROID
-#include "AndroidBridge.h"
-#endif
-
#include "mozilla/Atomics.h"
// First time MediaPrefs::GetSingleton() needs to be called on the main thread,
@@ -105,11 +101,6 @@ private:
DECL_MEDIA_PREF("media.eme.enabled", EMEEnabled, bool, false);
DECL_MEDIA_PREF("media.use-blank-decoder", PDMUseBlankDecoder, bool, false);
DECL_MEDIA_PREF("media.gpu-process-decoder", PDMUseGPUDecoder, bool, false);
-#ifdef MOZ_WIDGET_ANDROID
- DECL_MEDIA_PREF("media.android-media-codec.enabled", PDMAndroidMediaCodecEnabled, bool, false);
- DECL_MEDIA_PREF("media.android-media-codec.preferred", PDMAndroidMediaCodecPreferred, bool, false);
- DECL_MEDIA_PREF("media.android-remote-codec.enabled", PDMAndroidRemoteCodecEnabled, bool, false);
-#endif
#ifdef MOZ_FFMPEG
DECL_MEDIA_PREF("media.ffmpeg.enabled", PDMFFmpegEnabled, bool, true);
DECL_MEDIA_PREF("media.libavcodec.allow-obsolete", LibavcodecAllowObsolete, bool, false);
@@ -168,15 +159,7 @@ private:
// Default value functions
static int32_t MediaDecoderLimitDefault()
{
-#ifdef MOZ_WIDGET_ANDROID
- if (AndroidBridge::Bridge() &&
- AndroidBridge::Bridge()->GetAPIVersion() < 18) {
- // Older Android versions have broken support for multiple simultaneous
- // decoders, see bug 1278574.
- return 1;
- }
-#endif
- // Otherwise, set no decoder limit.
+ // Setting a decoder limit was only necessary for Android; set no decoder limit.
return -1;
}
diff --git a/dom/media/eme/MediaKeySystemAccess.cpp b/dom/media/eme/MediaKeySystemAccess.cpp
index e4e86f4c5b..c65c57ed0f 100644
--- a/dom/media/eme/MediaKeySystemAccess.cpp
+++ b/dom/media/eme/MediaKeySystemAccess.cpp
@@ -37,9 +37,6 @@
#include "nsUnicharUtils.h"
#include "mozilla/dom/MediaSource.h"
#include "DecoderTraits.h"
-#ifdef MOZ_WIDGET_ANDROID
-#include "FennecJNIWrappers.h"
-#endif
namespace mozilla {
namespace dom {
@@ -104,12 +101,6 @@ HavePluginForKeySystem(const nsCString& aKeySystem)
{
bool havePlugin = HaveGMPFor(NS_LITERAL_CSTRING(GMP_API_DECRYPTOR),
{ aKeySystem });
-#ifdef MOZ_WIDGET_ANDROID
- // Check if we can use MediaDrm for this keysystem.
- if (!havePlugin) {
- havePlugin = mozilla::java::MediaDrmProxy::IsSchemeSupported(aKeySystem);
- }
-#endif
return havePlugin;
}
@@ -143,16 +134,6 @@ MediaKeySystemAccess::GetKeySystemStatus(const nsAString& aKeySystem,
return MediaKeySystemStatus::Cdm_disabled;
}
return EnsureCDMInstalled(aKeySystem, aOutMessage);
-#ifdef MOZ_WIDGET_ANDROID
- } else if (Preferences::GetBool("media.mediadrm-widevinecdm.visible", false)) {
- nsCString keySystem = NS_ConvertUTF16toUTF8(aKeySystem);
- bool supported = mozilla::java::MediaDrmProxy::IsSchemeSupported(keySystem);
- if (!supported) {
- aOutMessage = NS_LITERAL_CSTRING("Widevine CDM is not available");
- return MediaKeySystemStatus::Cdm_not_installed;
- }
- return MediaKeySystemStatus::Available;
-#endif
}
}
@@ -308,9 +289,6 @@ GetSupportedKeySystems()
widevine.mPersistentState = KeySystemFeatureSupport::Requestable;
widevine.mDistinctiveIdentifier = KeySystemFeatureSupport::Prohibited;
widevine.mSessionTypes.AppendElement(MediaKeySessionType::Temporary);
-#ifdef MOZ_WIDGET_ANDROID
- widevine.mSessionTypes.AppendElement(MediaKeySessionType::Persistent_license);
-#endif
widevine.mAudioRobustness.AppendElement(NS_LITERAL_STRING("SW_SECURE_CRYPTO"));
widevine.mVideoRobustness.AppendElement(NS_LITERAL_STRING("SW_SECURE_DECODE"));
#if defined(XP_WIN)
@@ -322,49 +300,13 @@ GetSupportedKeySystems()
if (WMFDecoderModule::HasAAC()) {
widevine.mMP4.SetCanDecrypt(EME_CODEC_AAC);
}
-#elif !defined(MOZ_WIDGET_ANDROID)
- widevine.mMP4.SetCanDecrypt(EME_CODEC_AAC);
#endif
-#if defined(MOZ_WIDGET_ANDROID)
- using namespace mozilla::java;
- // MediaDrm.isCryptoSchemeSupported only allows passing
- // "video/mp4" or "video/webm" for mimetype string.
- // See https://developer.android.com/reference/android/media/MediaDrm.html#isCryptoSchemeSupported(java.util.UUID, java.lang.String)
- // for more detail.
- typedef struct {
- const nsCString& mMimeType;
- const nsCString& mEMECodecType;
- const char16_t* mCodecType;
- KeySystemContainerSupport* mSupportType;
- } DataForValidation;
-
- DataForValidation validationList[] = {
- { nsCString("video/mp4"), EME_CODEC_H264, MediaDrmProxy::AVC, &widevine.mMP4 },
- { nsCString("audio/mp4"), EME_CODEC_AAC, MediaDrmProxy::AAC, &widevine.mMP4 },
- { nsCString("video/webm"), EME_CODEC_VP8, MediaDrmProxy::VP8, &widevine.mWebM },
- { nsCString("video/webm"), EME_CODEC_VP9, MediaDrmProxy::VP9, &widevine.mWebM},
- { nsCString("audio/webm"), EME_CODEC_VORBIS, MediaDrmProxy::VORBIS, &widevine.mWebM},
- { nsCString("audio/webm"), EME_CODEC_OPUS, MediaDrmProxy::OPUS, &widevine.mWebM},
- };
-
- for (const auto& data: validationList) {
- if (MediaDrmProxy::IsCryptoSchemeSupported(kEMEKeySystemWidevine,
- data.mMimeType)) {
- if (MediaDrmProxy::CanDecode(data.mCodecType)) {
- data.mSupportType->SetCanDecryptAndDecode(data.mEMECodecType);
- } else {
- data.mSupportType->SetCanDecrypt(data.mEMECodecType);
- }
- }
- }
-#else
widevine.mMP4.SetCanDecryptAndDecode(EME_CODEC_H264);
widevine.mWebM.SetCanDecrypt(EME_CODEC_VORBIS);
widevine.mWebM.SetCanDecrypt(EME_CODEC_OPUS);
widevine.mWebM.SetCanDecryptAndDecode(EME_CODEC_VP8);
widevine.mWebM.SetCanDecryptAndDecode(EME_CODEC_VP9);
-#endif
keySystemConfigs.AppendElement(Move(widevine));
}
}
diff --git a/dom/media/eme/MediaKeys.cpp b/dom/media/eme/MediaKeys.cpp
index a1d22fdd5e..8621007579 100644
--- a/dom/media/eme/MediaKeys.cpp
+++ b/dom/media/eme/MediaKeys.cpp
@@ -13,9 +13,6 @@
#include "mozilla/dom/DOMException.h"
#include "mozilla/dom/UnionTypes.h"
#include "GMPCDMProxy.h"
-#ifdef MOZ_WIDGET_ANDROID
-#include "mozilla/MediaDrmCDMProxy.h"
-#endif
#include "mozilla/EMEUtils.h"
#include "nsContentUtils.h"
#include "nsIScriptObjectPrincipal.h"
@@ -330,14 +327,6 @@ already_AddRefed<CDMProxy>
MediaKeys::CreateCDMProxy()
{
RefPtr<CDMProxy> proxy;
-#ifdef MOZ_WIDGET_ANDROID
- if (IsWidevineKeySystem(mKeySystem)) {
- proxy = new MediaDrmCDMProxy(this,
- mKeySystem,
- mConfig.mDistinctiveIdentifier == MediaKeysRequirement::Required,
- mConfig.mPersistentState == MediaKeysRequirement::Required);
- } else
-#endif
{
proxy = new GMPCDMProxy(this,
mKeySystem,
diff --git a/dom/media/fmp4/MP4Decoder.cpp b/dom/media/fmp4/MP4Decoder.cpp
index bf937241c3..7a340d8297 100644
--- a/dom/media/fmp4/MP4Decoder.cpp
+++ b/dom/media/fmp4/MP4Decoder.cpp
@@ -21,9 +21,6 @@
#ifdef XP_WIN
#include "mozilla/WindowsVersion.h"
#endif
-#ifdef MOZ_WIDGET_ANDROID
-#include "nsIGfxInfo.h"
-#endif
#include "mozilla/layers/LayersTypes.h"
#include "PDMFactory.h"
diff --git a/dom/media/mediasource/MediaSource.cpp b/dom/media/mediasource/MediaSource.cpp
index 7d22d50a31..3ae640fbcc 100644
--- a/dom/media/mediasource/MediaSource.cpp
+++ b/dom/media/mediasource/MediaSource.cpp
@@ -32,10 +32,6 @@
#include "mozilla/gfx/gfxVars.h"
#include "mozilla/Sprintf.h"
-#ifdef MOZ_WIDGET_ANDROID
-#include "AndroidBridge.h"
-#endif
-
struct JSContext;
class JSObject;
@@ -72,12 +68,7 @@ IsWebMForced(DecoderDoctorDiagnostics* aDiagnostics)
DecoderTraits::IsMP4TypeAndEnabled(NS_LITERAL_CSTRING("video/mp4"),
aDiagnostics);
bool hwsupported = gfx::gfxVars::CanUseHardwareVideoDecoding();
-#ifdef MOZ_WIDGET_ANDROID
- return !mp4supported || !hwsupported || VP9Benchmark::IsVP9DecodeFast() ||
- java::HardwareCodecCapabilityUtils::HasHWVP9();
-#else
return !mp4supported || !hwsupported || VP9Benchmark::IsVP9DecodeFast();
-#endif
}
namespace dom {
diff --git a/dom/media/platforms/PDMFactory.cpp b/dom/media/platforms/PDMFactory.cpp
index 6e7241c462..6304a5b8b1 100644
--- a/dom/media/platforms/PDMFactory.cpp
+++ b/dom/media/platforms/PDMFactory.cpp
@@ -19,9 +19,6 @@
#ifdef MOZ_APPLEMEDIA
#include "AppleDecoderModule.h"
#endif
-#ifdef MOZ_WIDGET_ANDROID
-#include "AndroidDecoderModule.h"
-#endif
#include "GMPDecoderModule.h"
#include "mozilla/ClearOnShutdown.h"
@@ -355,13 +352,6 @@ PDMFactory::CreatePDMs()
return;
}
-#ifdef MOZ_WIDGET_ANDROID
- if(MediaPrefs::PDMAndroidMediaCodecPreferred() &&
- MediaPrefs::PDMAndroidMediaCodecEnabled()) {
- m = new AndroidDecoderModule();
- StartupPDM(m);
- }
-#endif
#ifdef XP_WIN
if (MediaPrefs::PDMWMFEnabled()) {
m = new WMFDecoderModule();
@@ -390,12 +380,6 @@ PDMFactory::CreatePDMs()
m = new AppleDecoderModule();
StartupPDM(m);
#endif
-#ifdef MOZ_WIDGET_ANDROID
- if(MediaPrefs::PDMAndroidMediaCodecEnabled()){
- m = new AndroidDecoderModule();
- StartupPDM(m);
- }
-#endif
m = new AgnosticDecoderModule();
StartupPDM(m);
diff --git a/dom/media/webrtc/MediaEngineDefault.cpp b/dom/media/webrtc/MediaEngineDefault.cpp
index eb0ac2b6fc..5af7b9d40c 100644
--- a/dom/media/webrtc/MediaEngineDefault.cpp
+++ b/dom/media/webrtc/MediaEngineDefault.cpp
@@ -19,10 +19,6 @@
#include "nsIPrefService.h"
#include "nsIPrefBranch.h"
-#ifdef MOZ_WIDGET_ANDROID
-#include "nsISupportsUtils.h"
-#endif
-
#ifdef MOZ_WEBRTC
#include "YuvStamper.h"
#endif
@@ -192,12 +188,7 @@ MediaEngineDefaultVideoSource::Start(SourceMediaStream* aStream, TrackID aID,
mTrackID = aID;
// Start timer for subsequent frames
-#if defined(MOZ_WIDGET_ANDROID) && defined(DEBUG)
-// emulator debug is very, very slow and has problems dealing with realtime audio inputs
- mTimer->InitWithCallback(this, (1000 / mOpts.mFPS)*10, nsITimer::TYPE_REPEATING_SLACK);
-#else
mTimer->InitWithCallback(this, 1000 / mOpts.mFPS, nsITimer::TYPE_REPEATING_SLACK);
-#endif
mState = kStarted;
return NS_OK;
diff --git a/dom/media/webrtc/MediaEngineWebRTC.cpp b/dom/media/webrtc/MediaEngineWebRTC.cpp
index 6697ca56a1..3e978571f6 100644
--- a/dom/media/webrtc/MediaEngineWebRTC.cpp
+++ b/dom/media/webrtc/MediaEngineWebRTC.cpp
@@ -25,11 +25,6 @@ static mozilla::LazyLogModule sGetUserMediaLog("GetUserMedia");
#include "nsITabSource.h"
#include "MediaTrackConstraints.h"
-#ifdef MOZ_WIDGET_ANDROID
-#include "AndroidJNIWrapper.h"
-#include "AndroidBridge.h"
-#endif
-
#undef LOG
#define LOG(args) MOZ_LOG(sGetUserMediaLog, mozilla::LogLevel::Debug, args)
@@ -146,17 +141,6 @@ MediaEngineWebRTC::EnumerateVideoDevices(dom::MediaSourceEnum aMediaSource,
mozilla::camera::CaptureEngine capEngine = mozilla::camera::InvalidEngine;
-#ifdef MOZ_WIDGET_ANDROID
- // get the JVM
- JavaVM* jvm;
- JNIEnv* const env = jni::GetEnvForThread();
- MOZ_ALWAYS_TRUE(!env->GetJavaVM(&jvm));
-
- if (webrtc::VideoEngine::SetAndroidObjects(jvm) != 0) {
- LOG(("VieCapture:SetAndroidObjects Failed"));
- return;
- }
-#endif
bool scaryKind = false; // flag sources with cross-origin exploit potential
switch (aMediaSource) {
@@ -285,20 +269,6 @@ MediaEngineWebRTC::EnumerateAudioDevices(dom::MediaSourceEnum aMediaSource,
return;
}
-#ifdef MOZ_WIDGET_ANDROID
- jobject context = mozilla::AndroidBridge::Bridge()->GetGlobalContextRef();
-
- // get the JVM
- JavaVM* jvm;
- JNIEnv* const env = jni::GetEnvForThread();
- MOZ_ALWAYS_TRUE(!env->GetJavaVM(&jvm));
-
- if (webrtc::VoiceEngine::SetAndroidObjects(jvm, (void*)context) != 0) {
- LOG(("VoiceEngine:SetAndroidObjects Failed"));
- return;
- }
-#endif
-
if (!mVoiceEngine) {
mConfig.Set<webrtc::ExtendedFilter>(new webrtc::ExtendedFilter(mExtendedFilter));
mConfig.Set<webrtc::DelayAgnostic>(new webrtc::DelayAgnostic(mDelayAgnostic));
@@ -334,12 +304,8 @@ MediaEngineWebRTC::EnumerateAudioDevices(dom::MediaSourceEnum aMediaSource,
int nDevices = 0;
mAudioInput->GetNumOfRecordingDevices(nDevices);
int i;
-#if defined(MOZ_WIDGET_ANDROID)
- i = 0; // Bug 1037025 - let the OS handle defaulting for now on android/b2g
-#else
// -1 is "default communications device" depending on OS in webrtc.org code
i = -1;
-#endif
for (; i < nDevices; i++) {
// We use constants here because GetRecordingDeviceName takes char[128].
char deviceName[128];