• 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_UNKNOWN_PARSER_H_
9 #define SRC_UNKNOWN_PARSER_H_
10 
11 #include <cstdint>
12 
13 #include "src/element_parser.h"
14 #include "webm/callback.h"
15 #include "webm/reader.h"
16 #include "webm/status.h"
17 
18 namespace webm {
19 
20 // Parses unknown elements by delegating to Callback::OnUnknownElement.
21 class UnknownParser : public ElementParser {
22  public:
23   Status Init(const ElementMetadata& metadata, std::uint64_t max_size) override;
24 
25   Status Feed(Callback* callback, Reader* reader,
26               std::uint64_t* num_bytes_read) override;
27 
28  private:
29   // The metadata for this element.
30   ElementMetadata metadata_;
31 
32   // The number of bytes remaining that have not been read in the element.
33   std::uint64_t bytes_remaining_;
34 };
35 
36 }  // namespace webm
37 
38 #endif  // SRC_UNKNOWN_PARSER_H_
39