Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1904)

Unified Diff: media/cdm/aes_decryptor.cc

Issue 1199643002: Have GetKeyIds() return the key IDs from the first matching 'pssh' box (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: changes Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | media/cdm/cenc_utils.h » ('j') | media/cdm/cenc_utils.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/cdm/aes_decryptor.cc
diff --git a/media/cdm/aes_decryptor.cc b/media/cdm/aes_decryptor.cc
index c145b008c5d0b2167572172f0057091ebafa239a..7dd4a76b5e72e90c5ff36657a1afd4f030f3621c 100644
--- a/media/cdm/aes_decryptor.cc
+++ b/media/cdm/aes_decryptor.cc
@@ -27,6 +27,14 @@
namespace media {
+#if defined(USE_PROPRIETARY_CODECS)
+// CENC SystemID for the Common System.
+// https://w3c.github.io/encrypted-media/cenc-format.html#common-system
+const uint8_t kCencCommonSystemId[] = {0x10, 0x77, 0xef, 0xec, 0xc0, 0xb2,
+ 0x4d, 0x02, 0xac, 0xe3, 0x3c, 0x1e,
+ 0x52, 0xe2, 0xfb, 0x4b};
+#endif
+
// Keeps track of the session IDs and DecryptionKeys. The keys are ordered by
// insertion time (last insertion is first). It takes ownership of the
// DecryptionKeys.
@@ -275,13 +283,17 @@ void AesDecryptor::CreateSessionAndGenerateRequest(
break;
case EmeInitDataType::CENC:
#if defined(USE_PROPRIETARY_CODECS)
+ {
// |init_data| is a set of 0 or more concatenated 'pssh' boxes.
- if (!GetKeyIdsForCommonSystemId(init_data, &keys)) {
+ std::vector<uint8_t> common_system_id(
+ kCencCommonSystemId,
+ kCencCommonSystemId + arraysize(kCencCommonSystemId));
+ if (!GetKeyIdsFromPsshBoxes(init_data, common_system_id, &keys)) {
promise->reject(NOT_SUPPORTED_ERROR, 0,
"No supported PSSH box found.");
return;
}
- break;
+ } break;
#else
promise->reject(NOT_SUPPORTED_ERROR, 0,
"Initialization data type CENC is not supported.");
« no previous file with comments | « no previous file | media/cdm/cenc_utils.h » ('j') | media/cdm/cenc_utils.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698