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_SKIP_PARSER_H_ 9 #define SRC_SKIP_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 // A simple parser that merely skips (via Reader::Skip) ahead in the stream 21 // until the element has been fully skipped. 22 class SkipParser : public ElementParser { 23 public: 24 Status Init(const ElementMetadata& metadata, std::uint64_t max_size) override; 25 26 Status Feed(Callback* callback, Reader* reader, 27 std::uint64_t* num_bytes_read) override; 28 29 private: 30 std::uint64_t num_bytes_remaining_; 31 }; 32 33 } // namespace webm 34 35 #endif // SRC_SKIP_PARSER_H_ 36