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_CLUSTER_PARSER_H_ | |
6 #define MEDIA_WEBM_WEBM_CLUSTER_PARSER_H_ | |
7 | |
8 #include <deque> | |
9 | |
10 #include "base/scoped_ptr.h" | |
11 #include "media/base/buffers.h" | |
12 #include "media/webm/webm_parser.h" | |
13 | |
14 namespace media { | |
15 | |
16 class WebMClusterParser : private WebMParserClient { | |
scherkus (not reviewing)
2011/06/24 18:27:37
nit: use public
http://google-styleguide.googlecod
acolwell GONE FROM CHROMIUM
2011/06/27 23:48:25
Done.
| |
17 | |
scherkus (not reviewing)
2011/06/24 18:27:37
nit: blank line
acolwell GONE FROM CHROMIUM
2011/06/27 23:48:25
Done.
| |
18 public: | |
19 typedef std::deque<scoped_refptr<Buffer> > BufferQueue; | |
20 | |
21 WebMClusterParser(int64 timecode_scale, | |
22 int audio_track_num, | |
23 base::TimeDelta audio_default_duration, | |
24 int video_track_num, | |
25 base::TimeDelta video_default_duration); | |
26 virtual ~WebMClusterParser(); | |
27 | |
28 // Resets the state of the class so Parse() can be called again. | |
29 void Reset(); | |
scherkus (not reviewing)
2011/06/24 18:27:37
these methods can certainly be dangerous (i.e., fo
acolwell GONE FROM CHROMIUM
2011/06/27 23:48:25
Decided to remove Reset(). Parse resets the object
| |
30 | |
31 // Parses a WebM cluster element in |buf|. | |
32 // | |
33 // Returns the number of bytes parsed on success. Returns -1 | |
34 // if a parse error occurs. | |
35 int Parse(const uint8* buf, int size); | |
36 | |
37 const BufferQueue& audio_buffers() const; | |
38 const BufferQueue& video_buffers() const; | |
39 | |
40 private: | |
41 // WebMParserClient methods. | |
42 virtual bool OnListStart(int id); | |
43 virtual bool OnListEnd(int id); | |
44 virtual bool OnUInt(int id, int64 val); | |
45 virtual bool OnFloat(int id, double val); | |
46 virtual bool OnBinary(int id, const uint8* data, int size); | |
47 virtual bool OnString(int id, const std::string& str); | |
48 virtual bool OnSimpleBlock(int track_num, int timecode, int flags, | |
49 const uint8* data, int size); | |
50 | |
51 Buffer* CreateBuffer(const uint8* data, size_t size) const; | |
52 | |
53 double timecode_multiplier_; // Multiplier used to convert timecodes into | |
54 // microseconds. | |
55 int audio_track_num_; | |
56 base::TimeDelta audio_default_duration_; | |
57 int video_track_num_; | |
58 base::TimeDelta video_default_duration_; | |
59 | |
60 int64 cluster_timecode_; | |
61 BufferQueue audio_buffers_; | |
62 BufferQueue video_buffers_; | |
63 }; | |
scherkus (not reviewing)
2011/06/24 18:27:37
DISALLOW etc
acolwell GONE FROM CHROMIUM
2011/06/27 23:48:25
Done.
| |
64 | |
65 } // namespace media | |
66 | |
67 #endif // MEDIA_WEBM_WEBM_CLUSTER_PARSER_H_ | |
OLD | NEW |