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_VOID_PARSER_H_
9 #define SRC_VOID_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 a Void element by delegating to Callback::OnVoid.
21 // Spec reference:
22 // http://matroska.org/technical/specs/index.html#Void
23 // http://www.webmproject.org/docs/container/#Void
24 class VoidParser : public ElementParser {
25  public:
26   Status Init(const ElementMetadata& metadata, std::uint64_t max_size) override;
27 
28   Status Feed(Callback* callback, Reader* reader,
29               std::uint64_t* num_bytes_read) override;
30 
31  private:
32   // The metadata for this element.
33   ElementMetadata metadata_;
34 
35   // The number of bytes remaining that have not been read in the element.
36   std::uint64_t bytes_remaining_ = 0;
37 };
38 
39 }  // namespace webm
40 
41 #endif  // SRC_VOID_PARSER_H_
42