Shaka Packager SDK
Loading...
Searching...
No Matches
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#include <cstdint>
10
11#include <packager/macros/classes.h>
12#include <packager/media/formats/webm/webm_parser.h>
13
14namespace shaka {
15namespace media {
16
19 public:
21 ~WebMInfoParser() override;
22
27 int Parse(const uint8_t* buf, int size);
28
29 int64_t timecode_scale() const { return timecode_scale_; }
30 double duration() const { return duration_; }
31 std::chrono::system_clock::time_point date_utc() const { return date_utc_; }
32
33 private:
34 // WebMParserClient methods
35 WebMParserClient* OnListStart(int id) override;
36 bool OnListEnd(int id) override;
37 bool OnUInt(int id, int64_t val) override;
38 bool OnFloat(int id, double val) override;
39 bool OnBinary(int id, const uint8_t* data, int size) override;
40 bool OnString(int id, const std::string& str) override;
41
42 int64_t timecode_scale_;
43 double duration_;
44 std::chrono::system_clock::time_point date_utc_;
45
46 DISALLOW_COPY_AND_ASSIGN(WebMInfoParser);
47};
48
49} // namespace media
50} // namespace shaka
51
52#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.