| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef MEDIA_CDM_PPAPI_SUPPORTED_CDM_VERSIONS_H_ | 5 #ifndef MEDIA_CDM_PPAPI_SUPPORTED_CDM_VERSIONS_H_ |
| 6 #define MEDIA_CDM_PPAPI_SUPPORTED_CDM_VERSIONS_H_ | 6 #define MEDIA_CDM_PPAPI_SUPPORTED_CDM_VERSIONS_H_ |
| 7 | 7 |
| 8 #include "media/cdm/ppapi/api/content_decryption_module.h" | 8 #include "media/cdm/ppapi/api/content_decryption_module.h" |
| 9 | 9 |
| 10 namespace media { | 10 namespace media { |
| 11 | 11 |
| 12 bool IsSupportedCdmModuleVersion(int version) { | 12 bool IsSupportedCdmModuleVersion(int version) { |
| 13 switch(version) { | 13 switch(version) { |
| 14 // Latest. | 14 // Latest. |
| 15 case CDM_MODULE_VERSION: | 15 case CDM_MODULE_VERSION: |
| 16 return true; | 16 return true; |
| 17 default: | 17 default: |
| 18 return false; | 18 return false; |
| 19 } | 19 } |
| 20 } | 20 } |
| 21 | 21 |
| 22 bool IsSupportedCdmInterfaceVersion(int version) { | 22 bool IsSupportedCdmInterfaceVersion(int version) { |
| 23 COMPILE_ASSERT(cdm::ContentDecryptionModule::kVersion == | 23 COMPILE_ASSERT(cdm::ContentDecryptionModule::kVersion == |
| 24 cdm::ContentDecryptionModule_4::kVersion, | 24 cdm::ContentDecryptionModule_5::kVersion, |
| 25 update_code_below); | 25 update_code_below); |
| 26 switch(version) { | 26 switch(version) { |
| 27 // Supported versions in decreasing order. | 27 // Supported versions in decreasing order. |
| 28 case cdm::ContentDecryptionModule_5::kVersion: |
| 28 case cdm::ContentDecryptionModule_4::kVersion: | 29 case cdm::ContentDecryptionModule_4::kVersion: |
| 29 return true; | 30 return true; |
| 30 default: | 31 default: |
| 31 return false; | 32 return false; |
| 32 } | 33 } |
| 33 } | 34 } |
| 34 | 35 |
| 35 bool IsSupportedCdmHostVersion(int version) { | 36 bool IsSupportedCdmHostVersion(int version) { |
| 36 COMPILE_ASSERT(cdm::ContentDecryptionModule::Host::kVersion == | 37 COMPILE_ASSERT(cdm::ContentDecryptionModule::Host::kVersion == |
| 37 cdm::ContentDecryptionModule_4::Host::kVersion, | 38 cdm::ContentDecryptionModule_5::Host::kVersion, |
| 38 update_code_below); | 39 update_code_below); |
| 39 switch(version) { | 40 switch(version) { |
| 40 // Supported versions in decreasing order. | 41 // Supported versions in decreasing order. |
| 42 case cdm::Host_5::kVersion: |
| 41 case cdm::Host_4::kVersion: | 43 case cdm::Host_4::kVersion: |
| 42 return true; | 44 return true; |
| 43 default: | 45 default: |
| 44 return false; | 46 return false; |
| 45 } | 47 } |
| 46 } | 48 } |
| 47 | 49 |
| 48 } // namespace media | 50 } // namespace media |
| 49 | 51 |
| 50 #endif // MEDIA_CDM_PPAPI_SUPPORTED_CDM_VERSIONS_H_ | 52 #endif // MEDIA_CDM_PPAPI_SUPPORTED_CDM_VERSIONS_H_ |
| OLD | NEW |