blob: 37cf01cfd38b4ed7a69c790c996013ed6cb01001 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef MEDIA_WEBM_WEBM_INFO_PARSER_H_
#define MEDIA_WEBM_WEBM_INFO_PARSER_H_
#include "media/webm/webm_parser.h"
namespace media {
// Parser for WebM Info element.
class WebMInfoParser : public WebMParserClient {
public:
WebMInfoParser();
virtual ~WebMInfoParser();
// Parses a WebM Info element in |buf|.
//
// Returns -1 if the parse fails.
// Returns 0 if more data is needed.
// Returns the number of bytes parsed on success.
int Parse(const uint8* buf, int size);
int64 timecode_scale() const { return timecode_scale_; }
double duration() const { return duration_; }
private:
// WebMParserClient methods
virtual bool OnListStart(int id);
virtual bool OnListEnd(int id);
virtual bool OnUInt(int id, int64 val);
virtual bool OnFloat(int id, double val);
virtual bool OnBinary(int id, const uint8* data, int size);
virtual bool OnString(int id, const std::string& str);
virtual bool OnSimpleBlock(int track_num, int timecode, int flags,
const uint8* data, int size);
int64 timecode_scale_;
double duration_;
DISALLOW_COPY_AND_ASSIGN(WebMInfoParser);
};
} // namespace media
#endif // MEDIA_WEBM_WEBM_INFO_PARSER_H_
|