OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "media/webm/webm_parser.h" | 5 #include "media/webm/webm_parser.h" |
6 | 6 |
7 // This file contains code to parse WebM file elements. It was created | 7 // This file contains code to parse WebM file elements. It was created |
8 // from information in the Matroska spec. | 8 // from information in the Matroska spec. |
9 // http://www.matroska.org/technical/specs/index.html | 9 // http://www.matroska.org/technical/specs/index.html |
10 // This file contains code for encrypted WebM. Current WebM | |
11 // encrypted request for comments specification is here | |
12 // http://wiki.webmproject.org/encryption/webm-encryption-rfc. | |
xhwang
2012/06/14 19:42:27
ditto, remove trailing "."
fgalligan1
2012/07/03 22:00:15
Done.
| |
10 | 13 |
11 #include <iomanip> | 14 #include <iomanip> |
12 | 15 |
13 #include "base/logging.h" | 16 #include "base/logging.h" |
14 #include "media/webm/webm_constants.h" | 17 #include "media/webm/webm_constants.h" |
15 | 18 |
16 namespace media { | 19 namespace media { |
17 | 20 |
18 enum ElementType { | 21 enum ElementType { |
19 UNKNOWN, | 22 UNKNOWN, |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
225 {LIST, kWebMIdContentCompression}, | 228 {LIST, kWebMIdContentCompression}, |
226 {LIST, kWebMIdContentEncryption}, | 229 {LIST, kWebMIdContentEncryption}, |
227 }; | 230 }; |
228 | 231 |
229 static const ElementIdInfo kContentCompressionIds[] = { | 232 static const ElementIdInfo kContentCompressionIds[] = { |
230 {UINT, kWebMIdContentCompAlgo}, | 233 {UINT, kWebMIdContentCompAlgo}, |
231 {BINARY, kWebMIdContentCompSettings}, | 234 {BINARY, kWebMIdContentCompSettings}, |
232 }; | 235 }; |
233 | 236 |
234 static const ElementIdInfo kContentEncryptionIds[] = { | 237 static const ElementIdInfo kContentEncryptionIds[] = { |
238 {LIST, kWebMIdContentEncAESSettings}, | |
235 {UINT, kWebMIdContentEncAlgo}, | 239 {UINT, kWebMIdContentEncAlgo}, |
236 {BINARY, kWebMIdContentEncKeyID}, | 240 {BINARY, kWebMIdContentEncKeyID}, |
237 {BINARY, kWebMIdContentSignature}, | 241 {BINARY, kWebMIdContentSignature}, |
238 {BINARY, kWebMIdContentSigKeyID}, | 242 {BINARY, kWebMIdContentSigKeyID}, |
239 {UINT, kWebMIdContentSigAlgo}, | 243 {UINT, kWebMIdContentSigAlgo}, |
240 {UINT, kWebMIdContentSigHashAlgo}, | 244 {UINT, kWebMIdContentSigHashAlgo}, |
241 }; | 245 }; |
242 | 246 |
247 static const ElementIdInfo kContentEncAESSettingsIds[] = { | |
248 {UINT, kWebMIdAESSettingsCipherMode}, | |
249 }; | |
250 | |
243 static const ElementIdInfo kCuesIds[] = { | 251 static const ElementIdInfo kCuesIds[] = { |
244 {LIST, kWebMIdCuePoint}, | 252 {LIST, kWebMIdCuePoint}, |
245 }; | 253 }; |
246 | 254 |
247 static const ElementIdInfo kCuePointIds[] = { | 255 static const ElementIdInfo kCuePointIds[] = { |
248 {UINT, kWebMIdCueTime}, | 256 {UINT, kWebMIdCueTime}, |
249 {LIST, kWebMIdCueTrackPositions}, | 257 {LIST, kWebMIdCueTrackPositions}, |
250 }; | 258 }; |
251 | 259 |
252 static const ElementIdInfo kCueTrackPositionsIds[] = { | 260 static const ElementIdInfo kCueTrackPositionsIds[] = { |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
369 LIST_ELEMENT_INFO(kWebMIdVideo, 3, kVideoIds), | 377 LIST_ELEMENT_INFO(kWebMIdVideo, 3, kVideoIds), |
370 LIST_ELEMENT_INFO(kWebMIdAudio, 3, kAudioIds), | 378 LIST_ELEMENT_INFO(kWebMIdAudio, 3, kAudioIds), |
371 LIST_ELEMENT_INFO(kWebMIdTrackOperation, 3, kTrackOperationIds), | 379 LIST_ELEMENT_INFO(kWebMIdTrackOperation, 3, kTrackOperationIds), |
372 LIST_ELEMENT_INFO(kWebMIdTrackCombinePlanes, 4, kTrackCombinePlanesIds), | 380 LIST_ELEMENT_INFO(kWebMIdTrackCombinePlanes, 4, kTrackCombinePlanesIds), |
373 LIST_ELEMENT_INFO(kWebMIdTrackPlane, 5, kTrackPlaneIds), | 381 LIST_ELEMENT_INFO(kWebMIdTrackPlane, 5, kTrackPlaneIds), |
374 LIST_ELEMENT_INFO(kWebMIdJoinBlocks, 4, kJoinBlocksIds), | 382 LIST_ELEMENT_INFO(kWebMIdJoinBlocks, 4, kJoinBlocksIds), |
375 LIST_ELEMENT_INFO(kWebMIdContentEncodings, 3, kContentEncodingsIds), | 383 LIST_ELEMENT_INFO(kWebMIdContentEncodings, 3, kContentEncodingsIds), |
376 LIST_ELEMENT_INFO(kWebMIdContentEncoding, 4, kContentEncodingIds), | 384 LIST_ELEMENT_INFO(kWebMIdContentEncoding, 4, kContentEncodingIds), |
377 LIST_ELEMENT_INFO(kWebMIdContentCompression, 5, kContentCompressionIds), | 385 LIST_ELEMENT_INFO(kWebMIdContentCompression, 5, kContentCompressionIds), |
378 LIST_ELEMENT_INFO(kWebMIdContentEncryption, 5, kContentEncryptionIds), | 386 LIST_ELEMENT_INFO(kWebMIdContentEncryption, 5, kContentEncryptionIds), |
387 LIST_ELEMENT_INFO(kWebMIdContentEncAESSettings, 6, kContentEncAESSettingsIds), | |
379 LIST_ELEMENT_INFO(kWebMIdCues, 1, kCuesIds), | 388 LIST_ELEMENT_INFO(kWebMIdCues, 1, kCuesIds), |
380 LIST_ELEMENT_INFO(kWebMIdCuePoint, 2, kCuePointIds), | 389 LIST_ELEMENT_INFO(kWebMIdCuePoint, 2, kCuePointIds), |
381 LIST_ELEMENT_INFO(kWebMIdCueTrackPositions, 3, kCueTrackPositionsIds), | 390 LIST_ELEMENT_INFO(kWebMIdCueTrackPositions, 3, kCueTrackPositionsIds), |
382 LIST_ELEMENT_INFO(kWebMIdCueReference, 4, kCueReferenceIds), | 391 LIST_ELEMENT_INFO(kWebMIdCueReference, 4, kCueReferenceIds), |
383 LIST_ELEMENT_INFO(kWebMIdAttachments, 1, kAttachmentsIds), | 392 LIST_ELEMENT_INFO(kWebMIdAttachments, 1, kAttachmentsIds), |
384 LIST_ELEMENT_INFO(kWebMIdAttachedFile, 2, kAttachedFileIds), | 393 LIST_ELEMENT_INFO(kWebMIdAttachedFile, 2, kAttachedFileIds), |
385 LIST_ELEMENT_INFO(kWebMIdChapters, 1, kChaptersIds), | 394 LIST_ELEMENT_INFO(kWebMIdChapters, 1, kChaptersIds), |
386 LIST_ELEMENT_INFO(kWebMIdEditionEntry, 2, kEditionEntryIds), | 395 LIST_ELEMENT_INFO(kWebMIdEditionEntry, 2, kEditionEntryIds), |
387 LIST_ELEMENT_INFO(kWebMIdChapterAtom, 3, kChapterAtomIds), | 396 LIST_ELEMENT_INFO(kWebMIdChapterAtom, 3, kChapterAtomIds), |
388 LIST_ELEMENT_INFO(kWebMIdChapterTrack, 4, kChapterTrackIds), | 397 LIST_ELEMENT_INFO(kWebMIdChapterTrack, 4, kChapterTrackIds), |
(...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
922 if (kSegmentIds[i].id_ == id_b) | 931 if (kSegmentIds[i].id_ == id_b) |
923 return true; | 932 return true; |
924 } | 933 } |
925 } | 934 } |
926 | 935 |
927 // kWebMIdSegment siblings. | 936 // kWebMIdSegment siblings. |
928 return ((id_b == kWebMIdSegment) || (id_b == kWebMIdEBMLHeader)); | 937 return ((id_b == kWebMIdSegment) || (id_b == kWebMIdEBMLHeader)); |
929 } | 938 } |
930 | 939 |
931 } // namespace media | 940 } // namespace media |
OLD | NEW |