• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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_CHAPTER_ATOM_PARSER_H_
9 #define SRC_CHAPTER_ATOM_PARSER_H_
10 
11 #include "src/byte_parser.h"
12 #include "src/chapter_display_parser.h"
13 #include "src/int_parser.h"
14 #include "src/master_value_parser.h"
15 #include "webm/dom_types.h"
16 #include "webm/id.h"
17 
18 namespace webm {
19 
20 // Spec reference:
21 // http://matroska.org/technical/specs/index.html#ChapterAtom
22 // http://www.webmproject.org/docs/container/#ChapterAtom
23 class ChapterAtomParser : public MasterValueParser<ChapterAtom> {
24  public:
25   explicit ChapterAtomParser(std::size_t max_recursive_depth = 25)
26       : MasterValueParser<ChapterAtom>(
27             MakeChild<UnsignedIntParser>(Id::kChapterUid, &ChapterAtom::uid),
28             MakeChild<StringParser>(Id::kChapterStringUid,
29                                     &ChapterAtom::string_uid),
30             MakeChild<UnsignedIntParser>(Id::kChapterTimeStart,
31                                          &ChapterAtom::time_start),
32             MakeChild<UnsignedIntParser>(Id::kChapterTimeEnd,
33                                          &ChapterAtom::time_end),
34             MakeChild<ChapterDisplayParser>(Id::kChapterDisplay,
35                                             &ChapterAtom::displays),
36             MakeChild<ChapterAtomParser>(Id::kChapterAtom, &ChapterAtom::atoms,
37                                          max_recursive_depth)) {}
38 };
39 
40 }  // namespace webm
41 
42 #endif  // SRC_CHAPTER_ATOM_PARSER_H_
43