diff options
Diffstat (limited to 'media')
-rw-r--r-- | media/cdm/ppapi/ppapi_cdm_adapter.gni | 1 | ||||
-rw-r--r-- | media/cdm/supported_cdm_versions.cc | 50 | ||||
-rw-r--r-- | media/cdm/supported_cdm_versions.h | 52 | ||||
-rw-r--r-- | media/media.gyp | 2 | ||||
-rw-r--r-- | media/media_cdm_adapter.gyp | 1 |
5 files changed, 68 insertions, 38 deletions
diff --git a/media/cdm/ppapi/ppapi_cdm_adapter.gni b/media/cdm/ppapi/ppapi_cdm_adapter.gni index cf9327c..e7cf90f 100644 --- a/media/cdm/ppapi/ppapi_cdm_adapter.gni +++ b/media/cdm/ppapi/ppapi_cdm_adapter.gni @@ -30,6 +30,7 @@ template("ppapi_cdm_adapter") { "//media/cdm/ppapi/linked_ptr.h", "//media/cdm/ppapi/ppapi_cdm_adapter.cc", "//media/cdm/ppapi/ppapi_cdm_adapter.h", + "//media/cdm/supported_cdm_versions.cc", "//media/cdm/supported_cdm_versions.h", ] if (is_mac) { diff --git a/media/cdm/supported_cdm_versions.cc b/media/cdm/supported_cdm_versions.cc new file mode 100644 index 0000000..6a8f896 --- /dev/null +++ b/media/cdm/supported_cdm_versions.cc @@ -0,0 +1,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 diff --git a/media/cdm/supported_cdm_versions.h b/media/cdm/supported_cdm_versions.h index 6609196..ffd91a5 100644 --- a/media/cdm/supported_cdm_versions.h +++ b/media/cdm/supported_cdm_versions.h @@ -5,48 +5,24 @@ #ifndef MEDIA_CDM_SUPPORTED_CDM_VERSIONS_H_ #define MEDIA_CDM_SUPPORTED_CDM_VERSIONS_H_ -#include "media/cdm/api/content_decryption_module.h" +#ifdef USE_PPAPI_CDM_ADAPTER +// When building the adapter these functions need to be local. +#define FUNCTION_EXPORT +#else +#include "media/base/media_export.h" +#define FUNCTION_EXPORT MEDIA_EXPORT +#endif 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; - } -} +FUNCTION_EXPORT bool IsSupportedCdmModuleVersion(int version); + +FUNCTION_EXPORT bool IsSupportedCdmInterfaceVersion(int version); + +FUNCTION_EXPORT bool IsSupportedCdmHostVersion(int version); } // namespace media +#undef FUNCTION_EXPORT + #endif // MEDIA_CDM_SUPPORTED_CDM_VERSIONS_H_ diff --git a/media/media.gyp b/media/media.gyp index 661e8e7..8a2d35d 100644 --- a/media/media.gyp +++ b/media/media.gyp @@ -498,6 +498,8 @@ 'cdm/player_tracker_impl.h', 'cdm/proxy_decryptor.cc', 'cdm/proxy_decryptor.h', + 'cdm/supported_cdm_versions.cc', + 'cdm/supported_cdm_versions.h', 'ffmpeg/ffmpeg_common.cc', 'ffmpeg/ffmpeg_common.h', 'ffmpeg/ffmpeg_deleters.h', diff --git a/media/media_cdm_adapter.gyp b/media/media_cdm_adapter.gyp index 8c81df1..876f884 100644 --- a/media/media_cdm_adapter.gyp +++ b/media/media_cdm_adapter.gyp @@ -36,6 +36,7 @@ 'cdm/ppapi/cdm_logging.cc', 'cdm/ppapi/cdm_logging.h', 'cdm/ppapi/linked_ptr.h', + 'cdm/supported_cdm_versions.cc', 'cdm/supported_cdm_versions.h', ], 'conditions': [ |