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