Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(48)

Side by Side Diff: media/webm/webm_parser.h

Issue 7203002: Adding ChunkDemuxer implementation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixing more CR comments Created 9 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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 buffer that contains an INFO element.
40 //
41 // If the info element was successfully parsed, this method will
42 // return the number of bytes parsed. If an error occurs this
43 // method returns -1.
44 int ParseWebMInfo(const uint8* buf, int size,
45 WebMParserClient* client);
46
47 // Parses a buffer that contains an TRACKS element.
48 //
49 // If the tracks element was successfully parsed, this method will
50 // return the number of bytes parsed. If an error occurs this
51 // method returns -1.
52 int ParseWebMTracks(const uint8* buf, int size,
53 WebMParserClient* client);
54
55 // Parses a buffer that contains CLUSTER elements.
56 //
57 // If a cluster was successfully parsed, this method will
58 // return the number of bytes parsed. If an error occurs this
59 // method returns -1.
60 int ParseWebMClusters(const uint8* buf, int size,
61 WebMParserClient* client);
62
63 } // namespace media
64
65 #endif // MEDIA_WEBM_WEBM_PARSER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698