7 #ifndef PACKAGER_MEDIA_CHUNKING_CHUNKING_HANDLER_
8 #define PACKAGER_MEDIA_CHUNKING_CHUNKING_HANDLER_
13 #include "packager/base/logging.h"
14 #include "packager/base/optional.h"
15 #include "packager/media/base/media_handler.h"
16 #include "packager/media/public/chunking_params.h"
48 Status Process(std::unique_ptr<StreamData> stream_data)
override;
53 friend class ChunkingHandlerTest;
58 Status OnStreamInfo(std::shared_ptr<const StreamInfo> info);
59 Status OnCueEvent(std::shared_ptr<const CueEvent> event);
60 Status OnMediaSample(std::shared_ptr<const MediaSample> sample);
62 Status EndSegmentIfStarted()
const;
63 Status EndSubsegmentIfStarted()
const;
65 bool IsSubsegmentEnabled() {
66 return subsegment_duration_ > 0 &&
67 subsegment_duration_ != segment_duration_;
73 int64_t segment_duration_ = 0;
74 int64_t subsegment_duration_ = 0;
77 int64_t current_segment_index_ = -1;
79 int64_t current_subsegment_index_ = -1;
81 base::Optional<int64_t> segment_start_time_;
82 base::Optional<int64_t> subsegment_start_time_;
83 int64_t max_segment_time_ = 0;
84 uint32_t time_scale_ = 0;
88 int64_t cue_offset_ = 0;
All the methods that are virtual are virtual for mocking.
Chunking (segmentation) related parameters.