49 lines
1.2 KiB
C++
49 lines
1.2 KiB
C++
// Copyright 2014 Google Inc. All Rights Reserved.
|
|
|
|
#include <assert.h>
|
|
|
|
#include "wv_content_decryption_module_1.h"
|
|
#include "wv_content_decryption_module_4.h"
|
|
|
|
#include "wv_cdm_version.h"
|
|
|
|
void InitializeCdmModule() {}
|
|
|
|
void DeinitializeCdmModule() {}
|
|
|
|
void* CreateCdmInstance(int cdm_interface_version, const char* key_system,
|
|
uint32_t key_system_size,
|
|
GetCdmHostFunc get_cdm_host_func, void* user_data) {
|
|
void *host = NULL;
|
|
|
|
switch (cdm_interface_version) {
|
|
case cdm::ContentDecryptionModule_1::kVersion:
|
|
host = get_cdm_host_func(cdm::Host_1::kVersion, user_data);
|
|
break;
|
|
|
|
case cdm::ContentDecryptionModule_4::kVersion:
|
|
host = get_cdm_host_func(cdm::Host_4::kVersion, user_data);
|
|
break;
|
|
}
|
|
|
|
if (!host)
|
|
return NULL;
|
|
|
|
switch (cdm_interface_version) {
|
|
case cdm::ContentDecryptionModule_1::kVersion:
|
|
return new wvcdm::WvContentDecryptionModule_1(
|
|
static_cast<cdm::Host_1*>(host));
|
|
|
|
case cdm::ContentDecryptionModule_4::kVersion:
|
|
return new wvcdm::WvContentDecryptionModule_4(
|
|
static_cast<cdm::Host_4*>(host));
|
|
}
|
|
|
|
assert(false); // NOT REACHED
|
|
return NULL;
|
|
}
|
|
|
|
const char* GetCdmVersion() {
|
|
return WV_CDM_VERSION;
|
|
}
|