Shaka Packager SDK
webm_info_parser.h
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef PACKAGER_MEDIA_FORMATS_WEBM_WEBM_INFO_PARSER_H_
6 #define PACKAGER_MEDIA_FORMATS_WEBM_WEBM_INFO_PARSER_H_
7 
8 #include <chrono>
9 
10 #include <packager/macros/classes.h>
11 #include <packager/media/formats/webm/webm_parser.h>
12 
13 namespace shaka {
14 namespace media {
15 
18  public:
20  ~WebMInfoParser() override;
21 
26  int Parse(const uint8_t* buf, int size);
27 
28  int64_t timecode_scale() const { return timecode_scale_; }
29  double duration() const { return duration_; }
30  std::chrono::system_clock::time_point date_utc() const { return date_utc_; }
31 
32  private:
33  // WebMParserClient methods
34  WebMParserClient* OnListStart(int id) override;
35  bool OnListEnd(int id) override;
36  bool OnUInt(int id, int64_t val) override;
37  bool OnFloat(int id, double val) override;
38  bool OnBinary(int id, const uint8_t* data, int size) override;
39  bool OnString(int id, const std::string& str) override;
40 
41  int64_t timecode_scale_;
42  double duration_;
43  std::chrono::system_clock::time_point date_utc_;
44 
45  DISALLOW_COPY_AND_ASSIGN(WebMInfoParser);
46 };
47 
48 } // namespace media
49 } // namespace shaka
50 
51 #endif // PACKAGER_MEDIA_FORMATS_WEBM_WEBM_INFO_PARSER_H_
Parser for WebM Info element.
int Parse(const uint8_t *buf, int size)
All the methods that are virtual are virtual for mocking.
Definition: crypto_flags.cc:66