Commit ed579a7f authored by Masatoshi Kimura's avatar Masatoshi Kimura
Browse files

Bug 925599 - Replace WinUtils::GetWindowsVersion() and GetWindowsServicePackVersion(). r=jimm

parent ad49423e
Loading
Loading
Loading
Loading
+3 −5
Original line number Diff line number Diff line
@@ -8,9 +8,7 @@
#include "DirectShowReader.h"
#include "MediaDecoderStateMachine.h"
#include "mozilla/Preferences.h"
#include "WinUtils.h"

using namespace mozilla::widget;
#include "mozilla/WindowsVersion.h"

namespace mozilla {

@@ -47,7 +45,7 @@ DirectShowDecoder::GetSupportedCodecs(const nsACString& aType,
bool
DirectShowDecoder::IsEnabled()
{
  return (WinUtils::GetWindowsVersion() < WinUtils::VISTA_VERSION) &&
  return !IsVistaOrLater() &&
         Preferences::GetBool("media.directshow.enabled");
}

+2 −3
Original line number Diff line number Diff line
@@ -10,8 +10,7 @@
#include "mozilla/Preferences.h"

#ifdef XP_WIN
#include "WinUtils.h"
using namespace mozilla::widget;
#include "mozilla/WindowsVersion.h"
#endif

namespace mozilla {
@@ -72,7 +71,7 @@ HavePlatformMPEGDecoders()
    Preferences::GetBool("media.fragmented-mp4.use-blank-decoder") ||
#ifdef XP_WIN
    // We have H.264/AAC platform decoders on Windows Vista and up.
    WinUtils::GetWindowsVersion() >= WinUtils::VISTA_VERSION ||
    IsVistaOrLater() ||
#endif
    // TODO: Other platforms...
    false;
+0 −2
Original line number Diff line number Diff line
@@ -11,7 +11,6 @@
#include "VideoUtils.h"
#include "DXVA2Manager.h"
#include "nsThreadUtils.h"
#include "WinUtils.h"
#include "Layers.h"
#include "mozilla/layers/LayersTypes.h"
#include "prlog.h"
@@ -35,7 +34,6 @@ WMFVideoDecoder::WMFVideoDecoder(bool aDXVAEnabled)
    mVideoHeight(0),
    mLastStreamOffset(0),
    mDXVAEnabled(aDXVAEnabled),
    mIsRunningOnVista(widget::WinUtils::GetWindowsVersion() == widget::WinUtils::WIN7_VERSION),
    mUseHwAccel(false)
{
  NS_ASSERTION(!NS_IsMainThread(), "Must be on main thread.");
+0 −1
Original line number Diff line number Diff line
@@ -68,7 +68,6 @@ private:
  nsAutoPtr<DXVA2Manager> mDXVA2Manager;

  const bool mDXVAEnabled;
  const bool mIsRunningOnVista;
  bool mUseHwAccel;
};

+6 −14
Original line number Diff line number Diff line
@@ -10,15 +10,13 @@
#include "WMFUtils.h"
#include "MediaDecoderStateMachine.h"
#include "mozilla/Preferences.h"
#include "WinUtils.h"
#include "mozilla/WindowsVersion.h"
#include "nsCharSeparatedTokenizer.h"

#ifdef MOZ_DIRECTSHOW
#include "DirectShowDecoder.h"
#endif

using namespace mozilla::widget;

namespace mozilla {

MediaDecoderStateMachine* WMFDecoder::CreateStateMachine()
@@ -41,18 +39,12 @@ WMFDecoder::IsMP3Supported()
  if (!MediaDecoder::IsWMFEnabled()) {
    return false;
  }
  if (WinUtils::GetWindowsVersion() != WinUtils::WIN7_VERSION) {
  if (!IsWin7OrLater()) {
    return true;
  }
  // We're on Windows 7. MP3 support is disabled if no service pack
  // MP3 support is disabled if we're on Windows 7 and no service pack
  // is installed, as it's crashy on Win7 SP0.
  UINT spMajorVer = 0, spMinorVer = 0;
  if (!WinUtils::GetWindowsServicePackVersion(spMajorVer, spMinorVer)) {
    // Um... We can't determine the service pack version... Just block
    // MP3 as a precaution...
    return false;
  }
  return spMajorVer != 0;
  return IsWin7SP1OrLater();
}

static bool
@@ -163,7 +155,7 @@ bool
WMFDecoder::IsEnabled()
{
  // We only use WMF on Windows Vista and up
  return WinUtils::GetWindowsVersion() >= WinUtils::VISTA_VERSION &&
  return IsVistaOrLater() &&
         Preferences::GetBool("media.windows-media-foundation.enabled");
}

Loading