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

Side by Side Diff: media/webm/cluster_builder.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/test/data/webm_vp8_track_entry ('k') | media/webm/cluster_builder.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_CLUSTER_BUILDER_H_
6 #define MEDIA_WEBM_CLUSTER_BUILDER_H_
7
8 #include "base/basictypes.h"
9 #include "base/scoped_ptr.h"
10 #include "media/base/buffers.h"
11
12 namespace media {
13
14 class Cluster {
15 public:
16 // Takes ownership of |data|
17 Cluster(const uint8* data, int size);
18 ~Cluster();
19
20 const uint8* data() const { return data_.get(); }
21 int size() const { return size_; }
22
23 private:
24 scoped_array<const uint8> data_;
25 int size_;
26
27 DISALLOW_IMPLICIT_CONSTRUCTORS(Cluster);
28 };
29
30 class ClusterBuilder {
31 public:
32 ClusterBuilder();
33
34 void SetClusterTimecode(int64 cluster_timecode);
35 void AddSimpleBlock(int track_num, int64 timecode, int flags,
36 const uint8* data, int size);
37
38 Cluster* Finish();
39
40 private:
41 void Reset();
42 void ExtendBuffer(int bytes_needed);
43 void UpdateUInt64(int offset, int64 value);
44
45 scoped_array<uint8> buffer_;
46 int buffer_size_;
47 int bytes_used_;
48 int64 cluster_timecode_;
49
50 DISALLOW_COPY_AND_ASSIGN(ClusterBuilder);
51 };
52
53 } // namespace media
54
55 #endif // MEDIA_WEBM_CLUSTER_BUILDER_H_
OLDNEW
« no previous file with comments | « media/test/data/webm_vp8_track_entry ('k') | media/webm/cluster_builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698