7 #ifndef PACKAGER_MEDIA_CHUNKING_CHUNKING_HANDLER_
8 #define PACKAGER_MEDIA_CHUNKING_CHUNKING_HANDLER_
12 #include "packager/media/base/media_handler.h"
70 Status
Process(std::unique_ptr<StreamData> stream_data)
override;
75 friend class ChunkingHandlerTest;
81 Status ProcessMediaSample(
const MediaSample* sample);
84 Status DispatchNonMainSamples(int64_t timestamp_threshold);
87 Status DispatchSegmentInfoForAllStreams();
88 Status DispatchSubsegmentInfoForAllStreams();
93 std::atomic<int64_t> thread_id_;
97 const size_t kInvalidStreamIndex =
static_cast<size_t>(-1);
98 size_t main_stream_index_ = kInvalidStreamIndex;
100 int64_t segment_duration_ = 0;
101 int64_t subsegment_duration_ = 0;
107 std::deque<std::unique_ptr<StreamData>> non_main_samples_;
110 int64_t current_segment_index_ = -1;
112 int64_t current_subsegment_index_ = -1;
114 std::vector<std::shared_ptr<SegmentInfo>> segment_info_;
115 std::vector<std::shared_ptr<SegmentInfo>> subsegment_info_;
116 std::vector<uint32_t> time_scales_;
118 std::vector<int64_t> last_sample_end_timestamps_;
124 #endif // PACKAGER_MEDIA_CHUNKING_CHUNKING_HANDLER_