OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2011 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_WEBM_WEBM_PARSER_H_ | |
6 #define MEDIA_WEBM_WEBM_PARSER_H_ | |
7 | |
8 #include <string> | |
9 | |
10 #include "base/basictypes.h" | |
11 | |
12 namespace media { | |
13 | |
14 // Interface for receiving WebM parser events. | |
15 // | |
16 // Each method is called when an element of the specified type is parsed. | |
17 // The ID of the element that was parsed is given along with the value | |
18 // stored in the element. List elements generate calls at the start and | |
19 // end of the list. Any pointers passed to these methods are only guaranteed | |
20 // to be valid for the life of that call. Each method returns a bool that | |
21 // indicates whether the parsed data is valid. If false is returned | |
22 // then the parse is immediately terminated and an error is reported by the | |
23 // parser. | |
24 class WebMParserClient { | |
25 public: | |
26 virtual ~WebMParserClient(); | |
27 | |
28 virtual bool OnListStart(int id) = 0; | |
29 virtual bool OnListEnd(int id) = 0; | |
30 virtual bool OnUInt(int id, int64 val) = 0; | |
31 virtual bool OnFloat(int id, double val) = 0; | |
32 virtual bool OnBinary(int id, const uint8* data, int size) = 0; | |
33 virtual bool OnString(int id, const std::string& str) = 0; | |
34 virtual bool OnSimpleBlock(int track_num, int timecode, | |
35 int flags, | |
36 const uint8* data, int size) = 0; | |
37 }; | |
38 | |
39 // Parses a single list element that matches |id|. This method fails if the | |
40 // buffer points to an element that does not match |id|. | |
41 int WebMParseListElement(const uint8* buf, int size, int id, | |
scherkus (not reviewing)
2011/06/24 18:27:37
OOC why is this method out here by itself?
acolwell GONE FROM CHROMIUM
2011/06/27 23:48:25
It is the only method that the various WebMXXParse
| |
42 int level, WebMParserClient* client); | |
43 | |
44 } // namespace media | |
45 | |
46 #endif // MEDIA_WEBM_WEBM_PARSER_H_ | |
OLD | NEW |