7 #ifndef MEDIA_FORMATS_WEBM_SEGMENTER_H_
8 #define MEDIA_FORMATS_WEBM_SEGMENTER_H_
10 #include "packager/base/memory/ref_counted.h"
11 #include "packager/base/memory/scoped_ptr.h"
12 #include "packager/media/base/status.h"
13 #include "packager/media/formats/webm/mkv_writer.h"
14 #include "packager/media/formats/webm/seek_head.h"
15 #include "packager/third_party/libwebm/src/mkvmuxer.hpp"
17 namespace edash_packager {
22 class AudioStreamInfo;
27 class ProgressListener;
29 class VideoStreamInfo;
91 void set_progress_target(uint64_t target) { progress_target_ = target; }
94 mkvmuxer::Cluster* cluster() {
return cluster_.get(); }
95 mkvmuxer::Cues* cues() {
return &cues_; }
98 SeekHead* seek_head() {
return &seek_head_; }
100 int track_id()
const {
return track_id_; }
101 uint64_t segment_payload_pos()
const {
return segment_payload_pos_; }
102 double cluster_length_sec()
const {
return cluster_length_sec_; }
104 virtual Status DoInitialize(scoped_ptr<MkvWriter> writer) = 0;
105 virtual Status DoFinalize() = 0;
114 virtual Status NewSubsegment(uint64_t start_timescale) = 0;
118 virtual Status NewSegment(uint64_t start_timescale) = 0;
121 Status FinalizeSegment(uint64_t end_timescale);
125 scoped_ptr<mkvmuxer::Cluster> cluster_;
126 mkvmuxer::Cues cues_;
128 mkvmuxer::SegmentInfo segment_info_;
129 mkvmuxer::Tracks tracks_;
134 uint64_t progress_target_;
135 uint64_t accumulated_progress_;
136 uint64_t total_duration_;
137 uint64_t sample_duration_;
140 uint64_t segment_payload_pos_;
142 double cluster_length_sec_;
143 double segment_length_sec_;
154 #endif // MEDIA_FORMATS_WEBM_SEGMENTER_H_