diff options
Diffstat (limited to 'dom/media')
-rw-r--r-- | dom/media/DecoderDoctorDiagnostics.cpp | 13 | ||||
-rw-r--r-- | dom/media/MediaManager.cpp | 36 | ||||
-rw-r--r-- | dom/media/eme/MediaKeySystemAccess.cpp | 14 | ||||
-rw-r--r-- | dom/media/fmp4/MP4Decoder.cpp | 8 | ||||
-rw-r--r-- | dom/media/gtest/TestGMPCrossOrigin.cpp | 5 | ||||
-rw-r--r-- | dom/media/platforms/PDMFactory.cpp | 15 | ||||
-rw-r--r-- | dom/media/platforms/wmf/WMF.h | 18 | ||||
-rw-r--r-- | dom/media/platforms/wmf/WMFUtils.cpp | 16 | ||||
-rw-r--r-- | dom/media/webrtc/MediaEngineWebRTC.cpp | 4 |
9 files changed, 19 insertions, 110 deletions
diff --git a/dom/media/DecoderDoctorDiagnostics.cpp b/dom/media/DecoderDoctorDiagnostics.cpp index 91c2d8dfb..778e8c4c5 100644 --- a/dom/media/DecoderDoctorDiagnostics.cpp +++ b/dom/media/DecoderDoctorDiagnostics.cpp @@ -576,16 +576,9 @@ DecoderDoctorDocumentWatcher::SynthesizeAnalysis() // going through expected decoders from most to least desirable. #if defined(XP_WIN) if (!formatsRequiringWMF.IsEmpty()) { - if (IsVistaOrLater()) { - DD_INFO("DecoderDoctorDocumentWatcher[%p, doc=%p]::SynthesizeAnalysis() - unplayable formats: %s -> Cannot play media because WMF was not found", - this, mDocument, NS_ConvertUTF16toUTF8(formatsRequiringWMF).get()); - ReportAnalysis(mDocument, sMediaWMFNeeded, false, formatsRequiringWMF); - } else { - DD_INFO("DecoderDoctorDocumentWatcher[%p, doc=%p]::SynthesizeAnalysis() - unplayable formats: %s -> Cannot play media before Windows Vista", - this, mDocument, NS_ConvertUTF16toUTF8(formatsRequiringWMF).get()); - ReportAnalysis(mDocument, sMediaUnsupportedBeforeWindowsVista, - false, formatsRequiringWMF); - } + DD_INFO("DecoderDoctorDocumentWatcher[%p, doc=%p]::SynthesizeAnalysis() - unplayable formats: %s -> Cannot play media because WMF was not found", + this, mDocument, NS_ConvertUTF16toUTF8(formatsRequiringWMF).get()); + ReportAnalysis(mDocument, sMediaWMFNeeded, false, formatsRequiringWMF); return; } #endif diff --git a/dom/media/MediaManager.cpp b/dom/media/MediaManager.cpp index 96e2c23e0..97a6855d9 100644 --- a/dom/media/MediaManager.cpp +++ b/dom/media/MediaManager.cpp @@ -1853,20 +1853,18 @@ MediaManager::GetNonE10sParent() MediaManager::StartupInit() { #ifdef WIN32 - if (IsVistaOrLater() && !IsWin8OrLater()) { - // Bug 1107702 - Older Windows fail in GetAdaptersInfo (and others) if the - // first(?) call occurs after the process size is over 2GB (kb/2588507). - // Attempt to 'prime' the pump by making a call at startup. - unsigned long out_buf_len = sizeof(IP_ADAPTER_INFO); - PIP_ADAPTER_INFO pAdapterInfo = (IP_ADAPTER_INFO *) moz_xmalloc(out_buf_len); - if (GetAdaptersInfo(pAdapterInfo, &out_buf_len) == ERROR_BUFFER_OVERFLOW) { - free(pAdapterInfo); - pAdapterInfo = (IP_ADAPTER_INFO *) moz_xmalloc(out_buf_len); - GetAdaptersInfo(pAdapterInfo, &out_buf_len); - } - if (pAdapterInfo) { - free(pAdapterInfo); - } + // Bug 1107702 - Some Windows versions fail in GetAdaptersInfo (and others) + // if the first(?) call occurs after the process size is over 2GB (kb/2588507). + // Attempt to 'prime' the pump by making a call at startup. + unsigned long out_buf_len = sizeof(IP_ADAPTER_INFO); + PIP_ADAPTER_INFO pAdapterInfo = (IP_ADAPTER_INFO *) moz_xmalloc(out_buf_len); + if (GetAdaptersInfo(pAdapterInfo, &out_buf_len) == ERROR_BUFFER_OVERFLOW) { + free(pAdapterInfo); + pAdapterInfo = (IP_ADAPTER_INFO *) moz_xmalloc(out_buf_len); + GetAdaptersInfo(pAdapterInfo, &out_buf_len); + } + if (pAdapterInfo) { + free(pAdapterInfo); } #endif } @@ -2130,19 +2128,11 @@ if (privileged) { case MediaSourceEnum::Application: case MediaSourceEnum::Window: // Deny screensharing request if support is disabled, or - // the requesting document is not from a host on the whitelist, or - // we're on WinXP until proved that it works + // the requesting document is not from a host on the whitelist if (!Preferences::GetBool(((videoType == MediaSourceEnum::Browser)? "media.getusermedia.browser.enabled" : "media.getusermedia.screensharing.enabled"), false) || -#if defined(XP_WIN) - ( - // Allow tab sharing for all platforms including XP - (videoType != MediaSourceEnum::Browser) && - !Preferences::GetBool("media.getusermedia.screensharing.allow_on_old_platforms", - false) && !IsVistaOrLater()) || -#endif (!privileged && !HostIsHttps(*docURI))) { RefPtr<MediaStreamError> error = new MediaStreamError(aWindow, diff --git a/dom/media/eme/MediaKeySystemAccess.cpp b/dom/media/eme/MediaKeySystemAccess.cpp index 7007d3a03..4cff464e7 100644 --- a/dom/media/eme/MediaKeySystemAccess.cpp +++ b/dom/media/eme/MediaKeySystemAccess.cpp @@ -140,26 +140,12 @@ MediaKeySystemAccess::GetKeySystemStatus(const nsAString& aKeySystem, aOutMessage = NS_LITERAL_CSTRING("Adobe EME disabled"); return MediaKeySystemStatus::Cdm_disabled; } -#ifdef XP_WIN - // Win Vista and later only. - if (!IsVistaOrLater()) { - aOutMessage = NS_LITERAL_CSTRING("Minimum Windows version (Vista) not met for Adobe EME"); - return MediaKeySystemStatus::Cdm_not_supported; - } -#endif return EnsureCDMInstalled(aKeySystem, aOutMessage); } } if (IsWidevineKeySystem(aKeySystem)) { if (Preferences::GetBool("media.gmp-widevinecdm.visible", false)) { -#ifdef XP_WIN - // Win Vista and later only. - if (!IsVistaOrLater()) { - aOutMessage = NS_LITERAL_CSTRING("Minimum Windows version (Vista) not met for Widevine EME"); - return MediaKeySystemStatus::Cdm_not_supported; - } -#endif if (!Preferences::GetBool("media.gmp-widevinecdm.enabled", false)) { aOutMessage = NS_LITERAL_CSTRING("Widevine EME disabled"); return MediaKeySystemStatus::Cdm_disabled; diff --git a/dom/media/fmp4/MP4Decoder.cpp b/dom/media/fmp4/MP4Decoder.cpp index 4cf07ddbd..fdd6f2c7e 100644 --- a/dom/media/fmp4/MP4Decoder.cpp +++ b/dom/media/fmp4/MP4Decoder.cpp @@ -52,14 +52,6 @@ IsWhitelistedH264Codec(const nsAString& aCodec) return false; } -#ifdef XP_WIN - // Disable 4k video on windows vista since it performs poorly. - if (!IsWin7OrLater() && - level >= H264_LEVEL_5) { - return false; - } -#endif - // Just assume what we can play on all platforms the codecs/formats that // WMF can play, since we don't have documentation about what other // platforms can play... According to the WMF documentation: diff --git a/dom/media/gtest/TestGMPCrossOrigin.cpp b/dom/media/gtest/TestGMPCrossOrigin.cpp index 036282153..33ac98388 100644 --- a/dom/media/gtest/TestGMPCrossOrigin.cpp +++ b/dom/media/gtest/TestGMPCrossOrigin.cpp @@ -1521,11 +1521,6 @@ TEST(GeckoMediaPlugins, GMPPluginVoucher) { #if defined(XP_WIN) TEST(GeckoMediaPlugins, GMPOutputProtection) { - // Output Protection is not available pre-Vista. - if (!IsVistaOrLater()) { - return; - } - RefPtr<GMPStorageTest> runner = new GMPStorageTest(); runner->DoTest(&GMPStorageTest::TestOutputProtection); } diff --git a/dom/media/platforms/PDMFactory.cpp b/dom/media/platforms/PDMFactory.cpp index a72d910f5..c1e58fdc2 100644 --- a/dom/media/platforms/PDMFactory.cpp +++ b/dom/media/platforms/PDMFactory.cpp @@ -47,10 +47,6 @@ #include "MP4Decoder.h" #include "mozilla/dom/RemoteVideoDecoder.h" -#ifdef XP_WIN -#include "mozilla/WindowsVersion.h" -#endif - #include "mp4_demuxer/H264.h" namespace mozilla { @@ -367,16 +363,7 @@ PDMFactory::CreatePDMs() } #endif #ifdef XP_WIN - if (MediaPrefs::PDMWMFEnabled() && IsVistaOrLater() && !IsWin7AndPre2000Compatible()) { - // *Only* use WMF on Vista and later, as if Firefox is run in Windows 95 - // compatibility mode on Windows 7 (it does happen!) we may crash trying - // to startup WMF. So we need to detect the OS version here, as in - // compatibility mode IsVistaOrLater() and friends behave as if we're on - // the emulated version of Windows. See bug 1279171. - // Additionally, we don't want to start the RemoteDecoderModule if we - // expect it's not going to work (i.e. on Windows older than Vista). - // IsWin7AndPre2000Compatible() uses GetVersionEx as the user specified OS version can - // be reflected when compatibility mode is in effect. + if (MediaPrefs::PDMWMFEnabled()) { m = new WMFDecoderModule(); RefPtr<PlatformDecoderModule> remote = new dom::RemoteDecoderModule(m); StartupPDM(remote); diff --git a/dom/media/platforms/wmf/WMF.h b/dom/media/platforms/wmf/WMF.h index 5ede0d361..6988ef083 100644 --- a/dom/media/platforms/wmf/WMF.h +++ b/dom/media/platforms/wmf/WMF.h @@ -7,18 +7,6 @@ #ifndef WMF_H_ #define WMF_H_ -#if WINVER < _WIN32_WINNT_WIN7 -#error \ -You must include WMF.h before including mozilla headers, \ -otherwise mozconfig.h will be included \ -and that sets WINVER to WinXP, \ -which makes Windows Media Foundation unavailable. -#endif - -#pragma push_macro("WINVER") -#undef WINVER -#define WINVER _WIN32_WINNT_WIN7 - #include <windows.h> #include <mfapi.h> #include <mfidl.h> @@ -35,7 +23,7 @@ which makes Windows Media Foundation unavailable. #include <codecapi.h> // The Windows headers helpfully declare min and max macros, which don't -// compile in the prescence of std::min and std::max and unified builds. +// compile in the presence of std::min and std::max and unified builds. // So undef them here. #ifdef min #undef min @@ -97,8 +85,4 @@ HRESULT MFCreateDXGISurfaceBuffer(REFIID riid, } // end namespace wmf } // end namespace mozilla - - -#pragma pop_macro("WINVER") - #endif diff --git a/dom/media/platforms/wmf/WMFUtils.cpp b/dom/media/platforms/wmf/WMFUtils.cpp index 8aec8a8af..055012d0f 100644 --- a/dom/media/platforms/wmf/WMFUtils.cpp +++ b/dom/media/platforms/wmf/WMFUtils.cpp @@ -205,31 +205,17 @@ LoadDLLs() HRESULT MFStartup() { - if (!IsVistaOrLater() || IsWin7AndPre2000Compatible()) { - // *Only* use WMF on Vista and later, as if Firefox is run in Windows 95 - // compatibility mode on Windows 7 (it does happen!) we may crash trying - // to startup WMF. So we need to detect the OS version here, as in - // compatibility mode IsVistaOrLater() and friends behave as if we're on - // the emulated version of Windows. See bug 1279171. - // Using GetVersionEx API which takes compatibility mode into account. - return E_FAIL; - } - HRESULT hr = LoadDLLs(); if (FAILED(hr)) { return hr; } - const int MF_VISTA_VERSION = (0x0001 << 16 | MF_API_VERSION); const int MF_WIN7_VERSION = (0x0002 << 16 | MF_API_VERSION); // decltype is unusable for functions having default parameters DECL_FUNCTION_PTR(MFStartup, ULONG, DWORD); ENSURE_FUNCTION_PTR_(MFStartup, Mfplat.dll) - if (!IsWin7OrLater()) - return MFStartupPtr(MF_VISTA_VERSION, MFSTARTUP_FULL); - else - return MFStartupPtr(MF_WIN7_VERSION, MFSTARTUP_FULL); + return MFStartupPtr(MF_WIN7_VERSION, MFSTARTUP_FULL); } HRESULT diff --git a/dom/media/webrtc/MediaEngineWebRTC.cpp b/dom/media/webrtc/MediaEngineWebRTC.cpp index 522f23f61..1a2dc9a04 100644 --- a/dom/media/webrtc/MediaEngineWebRTC.cpp +++ b/dom/media/webrtc/MediaEngineWebRTC.cpp @@ -268,11 +268,7 @@ MediaEngineWebRTC::EnumerateVideoDevices(dom::MediaSourceEnum aMediaSource, bool MediaEngineWebRTC::SupportsDuplex() { -#ifndef XP_WIN return mFullDuplex; -#else - return IsVistaOrLater() && mFullDuplex; -#endif } void |