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

Unified Diff: media/mp4/box_definitions.cc

Issue 10837116: Update EME MediaKeyNeededEvent.initData for ISO BMFF to match current spec. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review comments. Created 8 years, 3 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
Index: media/mp4/box_definitions.cc
diff --git a/media/mp4/box_definitions.cc b/media/mp4/box_definitions.cc
index 9b64f48b1594567f4642af20d153fe8fd1d4e13c..ac7bd1a0173e2ff5afe1db05c0cf3ada95db2506 100644
--- a/media/mp4/box_definitions.cc
+++ b/media/mp4/box_definitions.cc
@@ -26,11 +26,17 @@ ProtectionSystemSpecificHeader::~ProtectionSystemSpecificHeader() {}
FourCC ProtectionSystemSpecificHeader::BoxType() const { return FOURCC_PSSH; }
bool ProtectionSystemSpecificHeader::Parse(BoxReader* reader) {
+ // Validate the box's contents and hang on to the system ID.
uint32 size;
- return reader->ReadFullBoxHeader() &&
+ RCHECK(reader->ReadFullBoxHeader() &&
reader->ReadVec(&system_id, 16) &&
reader->Read4(&size) &&
- reader->ReadVec(&data, size);
+ reader->HasBytes(size));
+
+ // Copy the entire box, including the header, for passing to EME as initData.
+ DCHECK(raw_box.empty());
+ raw_box.assign(reader->data(), reader->data() + reader->size());
+ return true;
}
SampleAuxiliaryInformationOffset::SampleAuxiliaryInformationOffset() {}
« no previous file with comments | « media/mp4/box_definitions.h ('k') | media/mp4/box_reader.h » ('j') | media/mp4/box_reader.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698