Fix external build issue

This commit is contained in:
Lu Chen
2020-02-14 14:08:15 -08:00
parent 77b2fcc678
commit 688dd62dae
7 changed files with 28 additions and 43 deletions

View File

@@ -91,11 +91,15 @@ cc_library(
name = "status", name = "status",
srcs = ["status.cc"], srcs = ["status.cc"],
hdrs = ["status.h"], hdrs = ["status.h"],
copts = ["-fvisibility=default"],
deps = [ deps = [
"@abseil_repo//absl/base:core_headers", "@abseil_repo//absl/base:core_headers",
"@abseil_repo//absl/strings", "@abseil_repo//absl/strings",
"//util:error_space", "//util:error_space",
], ],
# Make sure SDKs links in symbols defined in this
# target.
alwayslink = 1,
) )
cc_test( cc_test(

View File

@@ -17,6 +17,7 @@ filegroup(
name = "binary_release_files", name = "binary_release_files",
srcs = [ srcs = [
"test_ecmg_messages.h", "test_ecmg_messages.h",
"test_emmg_messages.h",
"wv_cas_ecm_example.cc", "wv_cas_ecm_example.cc",
"wv_cas_key_fetcher_example.cc", "wv_cas_key_fetcher_example.cc",
"wv_cas_types_example.cc", "wv_cas_types_example.cc",

View File

@@ -42,10 +42,10 @@ constexpr char kTestEcmgChannelSetupWithPrivateParameters[] = {
'\x80', '\x01', // parameter_type - CRYPTO_MODE '\x80', '\x01', // parameter_type - CRYPTO_MODE
'\x00', '\x07', // parameter_length '\x00', '\x07', // parameter_length
'A', 'e', 's', 'S', 'c', 't', 'e', // parameter_value 'A', 'e', 's', 'S', 'c', 't', 'e', // parameter_value
'\x80', '\x04', // parameter_type - TRACK_TYPES '\x80', '\x02', // parameter_type - TRACK_TYPES
'\x00', '\x02', // parameter_length '\x00', '\x02', // parameter_length
'S', 'D', // parameter_value 'S', 'D', // parameter_value
'\x80', '\x07', // parameter_type - ENTITLEMENT_ID_KEY_COMBINATION '\x80', '\x05', // parameter_type - ENTITLEMENT_ID_KEY_COMBINATION
'\x00', '\x30', // parameter_length '\x00', '\x30', // parameter_length
// parameter_value - ENTITLEMENT_ID (16 bytes) // parameter_value - ENTITLEMENT_ID (16 bytes)
'\x30', '\x31', '\x32', '\x33', '\x34', '\x35', '\x36', '\x37', // '\x30', '\x31', '\x32', '\x33', '\x34', '\x35', '\x36', '\x37', //
@@ -55,7 +55,7 @@ constexpr char kTestEcmgChannelSetupWithPrivateParameters[] = {
'\x30', '\x31', '\x32', '\x33', '\x34', '\x35', '\x36', '\x37', // '\x30', '\x31', '\x32', '\x33', '\x34', '\x35', '\x36', '\x37', //
'\x30', '\x31', '\x32', '\x33', '\x34', '\x35', '\x36', '\x37', // '\x30', '\x31', '\x32', '\x33', '\x34', '\x35', '\x36', '\x37', //
'\x30', '\x31', '\x32', '\x33', '\x34', '\x35', '\x36', '\x37', // '\x30', '\x31', '\x32', '\x33', '\x34', '\x35', '\x36', '\x37', //
'\x80', '\x07', // parameter_type - ENTITLEMENT_ID_KEY_COMBINATION '\x80', '\x05', // parameter_type - ENTITLEMENT_ID_KEY_COMBINATION
'\x00', '\x30', // parameter_length '\x00', '\x30', // parameter_length
// parameter_value - ENTITLEMENT_ID (16 bytes) // parameter_value - ENTITLEMENT_ID (16 bytes)
'\x61', '\x62', '\x63', '\x64', '\x65', '\x66', '\x67', '\x68', // '\x61', '\x62', '\x63', '\x64', '\x65', '\x66', '\x67', '\x68', //
@@ -139,14 +139,14 @@ constexpr char kTestEcmgStreamSetupWithPrivateParameters[] = {
'\x00', '\x10', // parameter_type - nominal_CP_duration '\x00', '\x10', // parameter_type - nominal_CP_duration
'\x00', '\x02', // parameter_length '\x00', '\x02', // parameter_length
'\x00', '\x64', // parameter_value '\x00', '\x64', // parameter_value
'\x80', '\x05', // parameter_type - STREAM_TRACK_TYPE '\x80', '\x03', // parameter_type - STREAM_TRACK_TYPE
'\x00', '\x02', // parameter_length '\x00', '\x02', // parameter_length
'S', 'D', // parameter_value 'S', 'D', // parameter_value
'\x80', '\x06', // parameter_type - CONTENT_IV '\x80', '\x04', // parameter_type - CONTENT_IV
'\x00', '\x10', // parameter_length '\x00', '\x10', // parameter_length
'\x00', '\x01', '\x02', '\x03', '\x04', '\x05', '\x06', '\x07', '\x00', '\x01', '\x02', '\x03', '\x04', '\x05', '\x06', '\x07',
'\x08', '\x09', '\x0a', '\x0b', '\x0c', '\x0d', '\x0e', '\x0f', '\x08', '\x09', '\x0a', '\x0b', '\x0c', '\x0d', '\x0e', '\x0f',
'\x80', '\x06', // parameter_type - CONTENT_IV '\x80', '\x04', // parameter_type - CONTENT_IV
'\x00', '\x10', // parameter_length '\x00', '\x10', // parameter_length
'\x10', '\x11', '\x12', '\x13', '\x14', '\x15', '\x16', '\x17', '\x10', '\x11', '\x12', '\x13', '\x14', '\x15', '\x16', '\x17',
'\x18', '\x19', '\x1a', '\x1b', '\x1c', '\x1d', '\x1e', '\x1f'}; '\x18', '\x19', '\x1a', '\x1b', '\x1c', '\x1d', '\x1e', '\x1f'};
@@ -278,21 +278,21 @@ constexpr char kTestEcmgCwProvisionWithAccessCriteria[] = {
'\x80', '\x01', // access_criteria parameter_type - CRYPTO_MODE '\x80', '\x01', // access_criteria parameter_type - CRYPTO_MODE
'\x00', '\x07', // parameter_length '\x00', '\x07', // parameter_length
'A', 'e', 's', 'S', 'c', 't', 'e', // parameter_value 'A', 'e', 's', 'S', 'c', 't', 'e', // parameter_value
'\x80', '\x04', // access_criteria parameter_type - TRACK_TYPES '\x80', '\x02', // access_criteria parameter_type - TRACK_TYPES
'\x00', '\x02', // parameter_length '\x00', '\x02', // parameter_length
'S', 'D', // parameter_value 'S', 'D', // parameter_value
'\x80', '\x05', // access_criteria parameter_type - STREAM_TRACK_TYPE '\x80', '\x03', // access_criteria parameter_type - STREAM_TRACK_TYPE
'\x00', '\x02', // parameter_length '\x00', '\x02', // parameter_length
'S', 'D', // parameter_value 'S', 'D', // parameter_value
'\x80', '\x06', // access_criteria parameter_type - CONTENT_IV '\x80', '\x04', // access_criteria parameter_type - CONTENT_IV
'\x00', '\x10', // parameter_length '\x00', '\x10', // parameter_length
'\x00', '\x01', '\x02', '\x03', '\x04', '\x05', '\x06', '\x07', // '\x00', '\x01', '\x02', '\x03', '\x04', '\x05', '\x06', '\x07', //
'\x08', '\x09', '\x0a', '\x0b', '\x0c', '\x0d', '\x0e', '\x0f', // '\x08', '\x09', '\x0a', '\x0b', '\x0c', '\x0d', '\x0e', '\x0f', //
'\x80', '\x06', // access_criteria parameter_type - CONTENT_IV '\x80', '\x04', // access_criteria parameter_type - CONTENT_IV
'\x00', '\x10', // parameter_length '\x00', '\x10', // parameter_length
'\x10', '\x11', '\x12', '\x13', '\x14', '\x15', '\x16', '\x17', // '\x10', '\x11', '\x12', '\x13', '\x14', '\x15', '\x16', '\x17', //
'\x18', '\x19', '\x1a', '\x1b', '\x1c', '\x1d', '\x1e', '\x1f', // '\x18', '\x19', '\x1a', '\x1b', '\x1c', '\x1d', '\x1e', '\x1f', //
'\x80', '\x07', // parameter_type - ENTITLEMENT_ID_KEY_COMBINATION '\x80', '\x05', // parameter_type - ENTITLEMENT_ID_KEY_COMBINATION
'\x00', '\x30', // parameter_length '\x00', '\x30', // parameter_length
// parameter_value - ENTITLEMENT_ID (16 bytes) // parameter_value - ENTITLEMENT_ID (16 bytes)
'\x30', '\x31', '\x32', '\x33', '\x34', '\x35', '\x36', '\x37', // '\x30', '\x31', '\x32', '\x33', '\x34', '\x35', '\x36', '\x37', //
@@ -302,7 +302,7 @@ constexpr char kTestEcmgCwProvisionWithAccessCriteria[] = {
'\x30', '\x31', '\x32', '\x33', '\x34', '\x35', '\x36', '\x37', // '\x30', '\x31', '\x32', '\x33', '\x34', '\x35', '\x36', '\x37', //
'\x30', '\x31', '\x32', '\x33', '\x34', '\x35', '\x36', '\x37', // '\x30', '\x31', '\x32', '\x33', '\x34', '\x35', '\x36', '\x37', //
'\x30', '\x31', '\x32', '\x33', '\x34', '\x35', '\x36', '\x37', // '\x30', '\x31', '\x32', '\x33', '\x34', '\x35', '\x36', '\x37', //
'\x80', '\x07', // parameter_type - ENTITLEMENT_ID_KEY_COMBINATION '\x80', '\x05', // parameter_type - ENTITLEMENT_ID_KEY_COMBINATION
'\x00', '\x30', // parameter_length '\x00', '\x30', // parameter_length
// parameter_value - ENTITLEMENT_ID (16 bytes) // parameter_value - ENTITLEMENT_ID (16 bytes)
'\x61', '\x62', '\x63', '\x64', '\x65', '\x66', '\x67', '\x68', // '\x61', '\x62', '\x63', '\x64', '\x65', '\x66', '\x67', '\x68', //

View File

@@ -63,14 +63,6 @@ Status ProcessPrivateParameters(const char* const request, uint16_t param_type,
params->stream_track_type = std::string(request + *offset, param_length); params->stream_track_type = std::string(request + *offset, param_length);
*offset += param_length; *offset += param_length;
break; break;
case CONTENT_ID:
params->content_id = std::string(request + *offset, param_length);
*offset += param_length;
break;
case CONTENT_PROVIDER:
params->content_provider = std::string(request + *offset, param_length);
*offset += param_length;
break;
case CONTENT_IV: case CONTENT_IV:
if (params->content_ivs.size() >= 2) { if (params->content_ivs.size() >= 2) {
return Status(error::INVALID_ARGUMENT, return Status(error::INVALID_ARGUMENT,
@@ -769,12 +761,6 @@ Status EcmgClientHandler::UpdateCommonPrivateParameters(
if (!params.track_types.empty()) { if (!params.track_types.empty()) {
track_types_.assign(params.track_types.begin(), params.track_types.end()); track_types_.assign(params.track_types.begin(), params.track_types.end());
} }
if (!params.content_id.empty()) {
content_id_ = params.content_id;
}
if (!params.content_provider.empty()) {
content_provider_ = params.content_provider;
}
if (!params.content_ivs.empty()) { if (!params.content_ivs.empty()) {
if (params.content_ivs.size() < ecmg_config_->number_of_content_keys) { if (params.content_ivs.size() < ecmg_config_->number_of_content_keys) {
return {error::INVALID_ARGUMENT, return {error::INVALID_ARGUMENT,

View File

@@ -66,8 +66,6 @@ struct EcmgParameters {
// Used to request entitlement keys. // Used to request entitlement keys.
std::vector<std::string> track_types; std::vector<std::string> track_types;
std::string stream_track_type; std::string stream_track_type;
std::string content_id;
std::string content_provider;
std::vector<std::string> content_ivs; // 8 or 16 bytes, one for each key. std::vector<std::string> content_ivs; // 8 or 16 bytes, one for each key.
std::vector<EntitlementIdKeyComb> entitlement_comb; std::vector<EntitlementIdKeyComb> entitlement_comb;
}; };
@@ -139,8 +137,6 @@ class EcmgClientHandler {
uint8_t age_restriction_ = 0; uint8_t age_restriction_ = 0;
std::vector<std::string> track_types_; std::vector<std::string> track_types_;
std::vector<EntitlementIdKeyComb> entitlement_comb_; std::vector<EntitlementIdKeyComb> entitlement_comb_;
std::string content_id_;
std::string content_provider_;
std::vector<std::string> content_ivs_; std::vector<std::string> content_ivs_;
// Map from ECM_stream_id to EcmgStreamInfo. // Map from ECM_stream_id to EcmgStreamInfo.

View File

@@ -63,12 +63,10 @@
// User defined ECMG parameter type values - 0x8000 to 0xFFFF. // User defined ECMG parameter type values - 0x8000 to 0xFFFF.
#define AGE_RESTRICTION (0x8000) #define AGE_RESTRICTION (0x8000)
#define CRYPTO_MODE (0x8001) #define CRYPTO_MODE (0x8001)
#define CONTENT_ID (0x8002) #define TRACK_TYPES (0x8002)
#define CONTENT_PROVIDER (0x8003) #define STREAM_TRACK_TYPE (0x8003)
#define TRACK_TYPES (0x8004) #define CONTENT_IV (0x8004)
#define STREAM_TRACK_TYPE (0x8005) #define ENTITLEMENT_ID_KEY_COMBINATION (0x8005)
#define CONTENT_IV (0x8006)
#define ENTITLEMENT_ID_KEY_COMBINATION (0x8007)
// ECMG protocol error values. // ECMG protocol error values.
#define INVALID_MESSAGE (0x0001) #define INVALID_MESSAGE (0x0001)

View File

@@ -22,6 +22,7 @@ filegroup(
name = "binary_release_files", name = "binary_release_files",
srcs = glob(["*.h"]) + [ srcs = glob(["*.h"]) + [
":wv_ecmg", ":wv_ecmg",
":wv_emmg",
"wv_cas_curl_key_fetcher.cc", "wv_cas_curl_key_fetcher.cc",
"wv_cas_types.cc", "wv_cas_types.cc",
], ],
@@ -46,7 +47,6 @@ cc_library(
"//base", "//base",
"@abseil_repo//absl/base:core_headers", "@abseil_repo//absl/base:core_headers",
"//common:status", "//common:status",
"//media_cas_packager_sdk/internal:ecm",
"//protos/public:media_cas_cc_proto", "//protos/public:media_cas_cc_proto",
"//protos/public:media_cas_encryption_cc_proto", "//protos/public:media_cas_encryption_cc_proto",
], ],
@@ -116,12 +116,9 @@ cc_test(
cc_library( cc_library(
name = "wv_cas_key_fetcher", name = "wv_cas_key_fetcher",
srcs = [ srcs = ["wv_cas_key_fetcher.cc"],
"wv_cas_key_fetcher.cc", hdrs = ["wv_cas_key_fetcher.h"],
], copts = PUBLIC_COPTS,
hdrs = [
"wv_cas_key_fetcher.h",
],
deps = [ deps = [
":wv_cas_types", ":wv_cas_types",
"//base", "//base",
@@ -131,6 +128,9 @@ cc_library(
"//common:status", "//common:status",
"//protos/public:media_cas_encryption_cc_proto", "//protos/public:media_cas_encryption_cc_proto",
], ],
# Make sure libmedia_cas_packager_sdk links in symbols defined in this
# target.
alwayslink = 1,
) )
cc_test( cc_test(