1 // Copyright (c) 2016 The WebM project authors. All Rights Reserved. 2 // 3 // Use of this source code is governed by a BSD-style license 4 // that can be found in the LICENSE file in the root of the source 5 // tree. An additional intellectual property rights grant can be found 6 // in the file PATENTS. All contributing project authors may 7 // be found in the AUTHORS file in the root of the source tree. 8 #ifndef SRC_CONTENT_ENCRYPTION_PARSER_H_ 9 #define SRC_CONTENT_ENCRYPTION_PARSER_H_ 10 11 #include "src/byte_parser.h" 12 #include "src/content_enc_aes_settings_parser.h" 13 #include "src/master_value_parser.h" 14 #include "webm/dom_types.h" 15 #include "webm/id.h" 16 17 namespace webm { 18 19 // Spec reference: 20 // http://matroska.org/technical/specs/index.html#ContentEncryption 21 // http://www.webmproject.org/docs/container/#ContentEncryption 22 class ContentEncryptionParser : public MasterValueParser<ContentEncryption> { 23 public: ContentEncryptionParser()24 ContentEncryptionParser() 25 : MasterValueParser<ContentEncryption>( 26 MakeChild<IntParser<ContentEncAlgo>>(Id::kContentEncAlgo, 27 &ContentEncryption::algorithm), 28 MakeChild<BinaryParser>(Id::kContentEncKeyId, 29 &ContentEncryption::key_id), 30 MakeChild<ContentEncAesSettingsParser>( 31 Id::kContentEncAesSettings, &ContentEncryption::aes_settings)) { 32 } 33 }; 34 35 } // namespace webm 36 37 #endif // SRC_CONTENT_ENCRYPTION_PARSER_H_ 38