Commit bd57c3e8 authored by jrummell's avatar jrummell Committed by Commit bot

Implement support for "keyids" Initialization Data format

As Clear Key now handles this format, add it to the key system
registry.

BUG=442982
TEST=new tests pass

Review URL: https://codereview.chromium.org/1014733002

Cr-Commit-Position: refs/heads/master@{#321176}
parent 2840ec3b
......@@ -76,7 +76,8 @@ static void AddExternalClearKey(
info.key_system = kExternalClearKeyKeySystem;
info.supported_codecs = media::EME_CODEC_WEBM_ALL;
info.supported_init_data_types = media::EME_INIT_DATA_TYPE_WEBM;
info.supported_init_data_types =
media::EME_INIT_DATA_TYPE_WEBM | media::EME_INIT_DATA_TYPE_KEYIDS;
#if defined(USE_PROPRIETARY_CODECS)
info.supported_codecs |= media::EME_CODEC_MP4_ALL;
info.supported_init_data_types |= media::EME_INIT_DATA_TYPE_CENC;
......
......@@ -18,6 +18,7 @@ enum EmeInitDataType {
#if defined(USE_PROPRIETARY_CODECS)
EME_INIT_DATA_TYPE_CENC = 1 << 1,
#endif // defined(USE_PROPRIETARY_CODECS)
EME_INIT_DATA_TYPE_KEYIDS = 1 << 2,
};
// Defines bitmask values that specify codecs used in Encrypted Media Extension
......
......@@ -39,8 +39,9 @@ struct NamedInitDataType {
static NamedInitDataType kInitDataTypeNames[] = {
{"webm", EME_INIT_DATA_TYPE_WEBM},
#if defined(USE_PROPRIETARY_CODECS)
{"cenc", EME_INIT_DATA_TYPE_CENC}
{"cenc", EME_INIT_DATA_TYPE_CENC},
#endif // defined(USE_PROPRIETARY_CODECS)
{"keyids", EME_INIT_DATA_TYPE_KEYIDS},
};
struct NamedCodec {
......@@ -83,7 +84,8 @@ static void AddClearKey(std::vector<KeySystemInfo>* concrete_key_systems) {
// http://developer.android.com/guide/appendix/media-formats.html
// VP9 support is device dependent.
info.supported_init_data_types = EME_INIT_DATA_TYPE_WEBM;
info.supported_init_data_types =
EME_INIT_DATA_TYPE_WEBM | EME_INIT_DATA_TYPE_KEYIDS;
info.supported_codecs = EME_CODEC_WEBM_ALL;
#if defined(OS_ANDROID)
......
......@@ -354,6 +354,15 @@ TEST_F(KeySystemsTest, ClearKey) {
EXPECT_EQ("Unknown", GetKeySystemNameForUMA(kPrefixedClearKey));
}
TEST_F(KeySystemsTest, ClearKeyWithInitDataType) {
EXPECT_TRUE(IsSupportedKeySystem(kClearKey));
EXPECT_TRUE(IsSupportedKeySystemWithInitDataType(kClearKey, "webm"));
EXPECT_TRUE(IsSupportedKeySystemWithInitDataType(kClearKey, "keyids"));
// All other InitDataTypes are not supported.
EXPECT_FALSE(IsSupportedKeySystemWithInitDataType(kClearKey, "unknown"));
}
// The key system is not registered and therefore is unrecognized.
TEST_F(KeySystemsTest, Basic_UnrecognizedKeySystem) {
static const char* const kUnrecognized = "x-org.example.unrecognized";
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment