5 #ifndef PACKAGER_MEDIA_FORMATS_WEBM_CLUSTER_BUILDER_H_
6 #define PACKAGER_MEDIA_FORMATS_WEBM_CLUSTER_BUILDER_H_
11 #include "packager/base/macros.h"
18 Cluster(std::unique_ptr<uint8_t[]> data,
int size);
21 const uint8_t* data()
const {
return data_.get(); }
22 int size()
const {
return size_; }
25 std::unique_ptr<uint8_t[]> data_;
28 DISALLOW_IMPLICIT_CONSTRUCTORS(
Cluster);
36 void SetClusterTimecode(int64_t cluster_timecode);
37 void AddSimpleBlock(
int track_num,
42 void AddBlockGroup(
int track_num,
49 void AddBlockGroupWithoutBlockDuration(
int track_num,
56 std::unique_ptr<Cluster> Finish();
57 std::unique_ptr<Cluster> FinishWithUnknownSize();
60 void AddBlockGroupInternal(
int track_num,
62 bool include_block_duration,
69 void ExtendBuffer(
int bytes_needed);
70 void UpdateUInt64(
int offset, int64_t value);
71 void WriteBlock(uint8_t* buf,
78 std::unique_ptr<uint8_t[]> buffer_;
81 int64_t cluster_timecode_;
89 #endif // PACKAGER_MEDIA_FORMATS_WEBM_CLUSTER_BUILDER_H_