summaryrefslogtreecommitdiff
path: root/chromium/media/base/win/mf_feature_checks.cc
blob: 7189f440f68133c5dbdcaa4cb2b7d4d921104c7e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// Copyright 2021 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "media/base/win/mf_feature_checks.h"

#include "base/win/windows_version.h"
#include "media/base/media_switches.h"

namespace media {

bool SupportMediaFoundationPlayback() {
  return SupportMediaFoundationClearPlayback() ||
         SupportMediaFoundationEncryptedPlayback();
}

bool SupportMediaFoundationClearPlayback() {
  return base::win::GetVersion() >= base::win::Version::WIN10_RS3 &&
         base::FeatureList::IsEnabled(kMediaFoundationClearPlayback);
}

bool SupportMediaFoundationEncryptedPlayback() {
  // TODO(xhwang): Also check whether software secure decryption is enabled and
  // supported by MediaFoundationCdm in the future.
  return base::win::GetVersion() >= base::win::Version::WIN10_20H1 &&
         IsHardwareSecureDecryptionEnabled();
}

}  // namespace media