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

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

Issue 7203002: Adding ChunkDemuxer implementation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed unit tests and nits Created 9 years, 5 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
« no previous file with comments | « media/webm/cluster_builder.cc ('k') | media/webm/webm_cluster_parser.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_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 : public WebMParserClient {
17 public:
18 typedef std::deque<scoped_refptr<Buffer> > BufferQueue;
19
20 WebMClusterParser(int64 timecode_scale,
21 int audio_track_num,
22 base::TimeDelta audio_default_duration,
23 int video_track_num,
24 base::TimeDelta video_default_duration);
25 virtual ~WebMClusterParser();
26
27 // Parses a WebM cluster element in |buf|.
28 //
29 // Returns the number of bytes parsed on success. Returns -1
30 // if a parse error occurs.
31 int Parse(const uint8* buf, int size);
32
33 const BufferQueue& audio_buffers() const { return audio_buffers_; }
34 const BufferQueue& video_buffers() const { return video_buffers_; }
35
36 private:
37 // WebMParserClient methods.
38 virtual bool OnListStart(int id);
39 virtual bool OnListEnd(int id);
40 virtual bool OnUInt(int id, int64 val);
41 virtual bool OnFloat(int id, double val);
42 virtual bool OnBinary(int id, const uint8* data, int size);
43 virtual bool OnString(int id, const std::string& str);
44 virtual bool OnSimpleBlock(int track_num, int timecode, int flags,
45 const uint8* data, int size);
46
47 double timecode_multiplier_; // Multiplier used to convert timecodes into
48 // microseconds.
49 int audio_track_num_;
50 base::TimeDelta audio_default_duration_;
51 int video_track_num_;
52 base::TimeDelta video_default_duration_;
53
54 int64 last_block_timecode_;
55
56 int64 cluster_timecode_;
57 BufferQueue audio_buffers_;
58 BufferQueue video_buffers_;
59
60 DISALLOW_IMPLICIT_CONSTRUCTORS(WebMClusterParser);
61 };
62
63 } // namespace media
64
65 #endif // MEDIA_WEBM_WEBM_CLUSTER_PARSER_H_
OLDNEW
« no previous file with comments | « media/webm/cluster_builder.cc ('k') | media/webm/webm_cluster_parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698