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 #include "media/cdm/ppapi/ppapi_cdm_adapter.h" | 5 #include "media/cdm/ppapi/ppapi_cdm_adapter.h" |
6 | 6 |
7 #include <string.h> | 7 #include <string.h> |
8 | 8 |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
(...skipping 1250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1261 // Always update this DCHECK when updating this function. | 1261 // Always update this DCHECK when updating this function. |
1262 // If this check fails, update this function and DCHECK or update | 1262 // If this check fails, update this function and DCHECK or update |
1263 // IsSupportedCdmHostVersion. | 1263 // IsSupportedCdmHostVersion. |
1264 | 1264 |
1265 PP_DCHECK( | 1265 PP_DCHECK( |
1266 // Future version is not supported. | 1266 // Future version is not supported. |
1267 !IsSupportedCdmHostVersion(cdm::Host_8::kVersion + 1) && | 1267 !IsSupportedCdmHostVersion(cdm::Host_8::kVersion + 1) && |
1268 // Current version is supported. | 1268 // Current version is supported. |
1269 IsSupportedCdmHostVersion(cdm::Host_8::kVersion) && | 1269 IsSupportedCdmHostVersion(cdm::Host_8::kVersion) && |
1270 // Include all previous supported versions (if any) here. | 1270 // Include all previous supported versions (if any) here. |
1271 IsSupportedCdmHostVersion(cdm::Host_7::kVersion) && | |
1272 // One older than the oldest supported version is not supported. | 1271 // One older than the oldest supported version is not supported. |
1273 !IsSupportedCdmHostVersion(cdm::Host_7::kVersion - 1)); | 1272 !IsSupportedCdmHostVersion(cdm::Host_8::kVersion - 1)); |
1274 PP_DCHECK(IsSupportedCdmHostVersion(host_interface_version)); | 1273 PP_DCHECK(IsSupportedCdmHostVersion(host_interface_version)); |
1275 | 1274 |
1276 PpapiCdmAdapter* cdm_adapter = static_cast<PpapiCdmAdapter*>(user_data); | 1275 PpapiCdmAdapter* cdm_adapter = static_cast<PpapiCdmAdapter*>(user_data); |
1277 CDM_DLOG() << "Create CDM Host with version " << host_interface_version; | 1276 CDM_DLOG() << "Create CDM Host with version " << host_interface_version; |
1278 switch (host_interface_version) { | 1277 switch (host_interface_version) { |
1279 case cdm::Host_8::kVersion: | 1278 case cdm::Host_8::kVersion: |
1280 return static_cast<cdm::Host_8*>(cdm_adapter); | 1279 return static_cast<cdm::Host_8*>(cdm_adapter); |
1281 case cdm::Host_7::kVersion: | |
1282 return static_cast<cdm::Host_7*>(cdm_adapter); | |
1283 default: | 1280 default: |
1284 PP_NOTREACHED(); | 1281 PP_NOTREACHED(); |
1285 return NULL; | 1282 return NULL; |
1286 } | 1283 } |
1287 } | 1284 } |
1288 | 1285 |
1289 // This object is the global object representing this plugin library as long | 1286 // This object is the global object representing this plugin library as long |
1290 // as it is loaded. | 1287 // as it is loaded. |
1291 class PpapiCdmAdapterModule : public pp::Module { | 1288 class PpapiCdmAdapterModule : public pp::Module { |
1292 public: | 1289 public: |
(...skipping 15 matching lines...) Expand all Loading... |
1308 } // namespace media | 1305 } // namespace media |
1309 | 1306 |
1310 namespace pp { | 1307 namespace pp { |
1311 | 1308 |
1312 // Factory function for your specialization of the Module object. | 1309 // Factory function for your specialization of the Module object. |
1313 Module* CreateModule() { | 1310 Module* CreateModule() { |
1314 return new media::PpapiCdmAdapterModule(); | 1311 return new media::PpapiCdmAdapterModule(); |
1315 } | 1312 } |
1316 | 1313 |
1317 } // namespace pp | 1314 } // namespace pp |
OLD | NEW |