summaryrefslogtreecommitdiffstats
path: root/media/cdm/supported_cdm_versions.cc
blob: 6a8f8962ea3f44de77899760a10d5bc3708e187c (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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// Copyright 2015 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/cdm/supported_cdm_versions.h"

#include "base/basictypes.h"
#include "media/cdm/api/content_decryption_module.h"

namespace media {

bool IsSupportedCdmModuleVersion(int version) {
  switch (version) {
    // Latest.
    case CDM_MODULE_VERSION:
      return true;
    default:
      return false;
  }
}

bool IsSupportedCdmInterfaceVersion(int version) {
  static_assert(cdm::ContentDecryptionModule::kVersion ==
                    cdm::ContentDecryptionModule_8::kVersion,
                "update the code below");
  switch (version) {
    // Supported versions in decreasing order.
    case cdm::ContentDecryptionModule_8::kVersion:
    case cdm::ContentDecryptionModule_7::kVersion:
      return true;
    default:
      return false;
  }
}

bool IsSupportedCdmHostVersion(int version) {
  static_assert(cdm::ContentDecryptionModule::Host::kVersion ==
                    cdm::ContentDecryptionModule_8::Host::kVersion,
                "update the code below");
  switch (version) {
    // Supported versions in decreasing order.
    case cdm::Host_8::kVersion:
    case cdm::Host_7::kVersion:
      return true;
    default:
      return false;
  }
}

}  // namespace media