DASH Media Packaging SDK
 All Classes Namespaces Functions Variables Typedefs Enumerator
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 MEDIA_FORMATS_WEBM_WEBM_INFO_PARSER_H_
6 #define MEDIA_FORMATS_WEBM_WEBM_INFO_PARSER_H_
7 
8 #include "packager/base/compiler_specific.h"
9 #include "packager/base/time/time.h"
10 #include "packager/media/formats/webm/webm_parser.h"
11 
12 namespace edash_packager {
13 namespace media {
14 
17  public:
19  ~WebMInfoParser() override;
20 
25  int Parse(const uint8_t* buf, int size);
26 
27  int64_t timecode_scale() const { return timecode_scale_; }
28  double duration() const { return duration_; }
29  base::Time date_utc() const { return date_utc_; }
30 
31  private:
32  // WebMParserClient methods
33  WebMParserClient* OnListStart(int id) override;
34  bool OnListEnd(int id) override;
35  bool OnUInt(int id, int64_t val) override;
36  bool OnFloat(int id, double val) override;
37  bool OnBinary(int id, const uint8_t* data, int size) override;
38  bool OnString(int id, const std::string& str) override;
39 
40  int64_t timecode_scale_;
41  double duration_;
42  base::Time date_utc_;
43 
44  DISALLOW_COPY_AND_ASSIGN(WebMInfoParser);
45 };
46 
47 } // namespace media
48 } // namespace edash_packager
49 
50 #endif // MEDIA_FORMATS_WEBM_WEBM_INFO_PARSER_H_
Parser for WebM Info element.
int Parse(const uint8_t *buf, int size)