HLS media playlist EXT-X-KEY format changes
[ Merged of http://go/wvgerrit/16576 ] The WV EXT-X-KEY attribute list earlier expected a cenc PSSH box in the URI field, in a hexadecimal sequence format. To ease the burden on content providers, the URI field will now contain init data in a json format and base64 encoded. The platform will assume responsibility to parse this data and create a widevine init data protobuf that can be included in the license request. b/20630275 Change-Id: I49e270bedbe96791fc9b282214a9a358d95d163e
This commit is contained in:
@@ -25,7 +25,8 @@ class InitializationData {
|
||||
|
||||
const std::string& type() const { return type_; }
|
||||
const CdmInitData& data() const { return data_; }
|
||||
const CdmHlsData& hls_data() const { return hls_data_; }
|
||||
std::vector<uint8_t> hls_iv() const { return hls_iv_; }
|
||||
CdmHlsMethod hls_method() const { return hls_method_; }
|
||||
|
||||
private:
|
||||
// Parse a blob of multiple concatenated PSSH atoms to extract the first
|
||||
@@ -34,7 +35,9 @@ class InitializationData {
|
||||
|
||||
bool ExtractHlsAttributes(const std::string& attribute_list,
|
||||
CdmHlsMethod* method, std::vector<uint8_t>* iv,
|
||||
std::string* uri, CdmInitData* init_data);
|
||||
std::string* uri);
|
||||
static bool ConstructWidevineInitData(const std::string& uri,
|
||||
CdmInitData* output);
|
||||
|
||||
static bool ExtractQuotedAttribute(const std::string& attribute_list,
|
||||
const std::string& key,
|
||||
@@ -44,22 +47,31 @@ class InitializationData {
|
||||
std::vector<uint8_t>* value);
|
||||
static bool ExtractAttribute(const std::string& attribute_list,
|
||||
const std::string& key, std::string* value);
|
||||
static bool ExtractJsonValue(const std::string& json,
|
||||
const std::string& key, std::string* value);
|
||||
|
||||
static std::vector<std::string> ExtractKeyFormatVersions(
|
||||
const std::string& key_format_versions);
|
||||
|
||||
// For testing only:
|
||||
#if defined(UNIT_TEST)
|
||||
FRIEND_TEST(HlsAttributeExtractionTest, ExtractAttribute);
|
||||
FRIEND_TEST(HlsParseTest, Parse);
|
||||
FRIEND_TEST(HlsTest, ExtractHlsAttributes);
|
||||
FRIEND_TEST(HlsConstructionTest, InitData);
|
||||
FRIEND_TEST(HlsHexAttributeExtractionTest, ExtractHexAttribute);
|
||||
FRIEND_TEST(HlsKeyFormatVersionsExtractionTest, ExtractKeyFormatVersions);
|
||||
FRIEND_TEST(HlsParseTest, Parse);
|
||||
FRIEND_TEST(HlsQuotedAttributeExtractionTest, ExtractQuotedAttribute);
|
||||
FRIEND_TEST(HlsTest, ExtractHlsAttributes);
|
||||
#endif
|
||||
|
||||
std::string type_;
|
||||
CdmInitData data_;
|
||||
CdmHlsData hls_data_;
|
||||
bool is_cenc_;
|
||||
bool is_hls_;
|
||||
bool is_webm_;
|
||||
|
||||
std::vector<uint8_t> hls_iv_;
|
||||
CdmHlsMethod hls_method_;
|
||||
};
|
||||
|
||||
} // namespace wvcdm
|
||||
|
||||
Reference in New Issue
Block a user