(1) Move the CryptoMode enum definition to media_cas_packager_sdk partners can use it when calling libraries in the SDK.
(2) Add a new enum value for kDvbCsa. (3) Allow caller to specify CTR, CBC, as well as CSA when using the ecm genertor from the SDK. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=219707788
This commit is contained in:
@@ -48,6 +48,6 @@ cc_binary(
|
||||
deps = [
|
||||
"@abseil_repo//absl/base:core_headers",
|
||||
"//media_cas_packager_sdk/public:wv_cas_ecm",
|
||||
"//media_cas_packager_sdk/public:wv_cas_status",
|
||||
"//media_cas_packager_sdk/public:wv_cas_types",
|
||||
],
|
||||
)
|
||||
|
||||
@@ -12,11 +12,10 @@
|
||||
#include <string>
|
||||
|
||||
#include "media_cas_packager_sdk/public/wv_cas_ecm.h"
|
||||
#include "media_cas_packager_sdk/public/wv_cas_status.h"
|
||||
#include "media_cas_packager_sdk/public/wv_cas_types.h"
|
||||
|
||||
const int kContentIvSize = 16;
|
||||
const bool kKeyRotationEnabled = true;
|
||||
const int kCryptoMode = 1; // CTR
|
||||
const char kEvenKey[] = "even_content_key"; // 16 bytes
|
||||
const char kEvenContentIv8Bytes[] = "evencont"; // 8 bytes
|
||||
const char kEvenContentIv16Bytes[] = "evencontevencont"; // 16 bytes
|
||||
@@ -29,7 +28,8 @@ const char kEntitlementKey[] = "entitlement_key................."; // 32 bytes
|
||||
int main(int argc, char **argv) {
|
||||
widevine::cas::WvCasEcm wv_cas_ecm;
|
||||
widevine::cas::WvCasStatus status =
|
||||
wv_cas_ecm.Initialize(kContentIvSize, kKeyRotationEnabled, kCryptoMode);
|
||||
wv_cas_ecm.Initialize(kContentIvSize, kKeyRotationEnabled,
|
||||
widevine::cas::CryptoMode::kDvbCsa);
|
||||
if (status != widevine::cas::OK) {
|
||||
std::cerr << "Failed to initialize WV CAS ECM, error: "
|
||||
<< widevine::cas::GetWvCasStatusMessage(status)
|
||||
|
||||
Reference in New Issue
Block a user