7 #ifndef PACKAGER_MEDIA_FORMATS_MP4_FRAGMENTER_H_ 8 #define PACKAGER_MEDIA_FORMATS_MP4_FRAGMENTER_H_ 13 #include "packager/base/logging.h" 14 #include "packager/status.h" 26 struct SegmentReference;
56 void ClearFragmentFinalized() { fragment_finalized_ =
false; }
58 uint64_t fragment_duration()
const {
return fragment_duration_; }
59 uint64_t first_sap_time()
const {
return first_sap_time_; }
60 uint64_t earliest_presentation_time()
const {
61 return earliest_presentation_time_;
63 bool fragment_initialized()
const {
return fragment_initialized_; }
64 bool fragment_finalized()
const {
return fragment_finalized_; }
66 const std::vector<KeyFrameInfo>& key_frame_infos()
const {
67 return key_frame_infos_;
75 bool use_decoding_timestamp_in_timeline) {
76 use_decoding_timestamp_in_timeline_ = use_decoding_timestamp_in_timeline;
83 bool allow_adjust_earliest_presentation_time) {
84 allow_adjust_earliest_presentation_time_ =
85 allow_adjust_earliest_presentation_time;
98 Status FinalizeFragmentForEncryption();
100 bool StartsWithSAP()
const;
102 std::shared_ptr<const StreamInfo> stream_info_;
103 bool use_decoding_timestamp_in_timeline_;
105 uint64_t seek_preroll_;
106 bool fragment_initialized_;
107 bool fragment_finalized_;
108 uint64_t fragment_duration_;
109 int64_t earliest_presentation_time_;
110 bool first_fragment_ =
true;
111 bool allow_adjust_earliest_presentation_time_ =
false;
112 int64_t first_sap_time_;
113 std::unique_ptr<BufferWriter> data_;
115 std::vector<KeyFrameInfo> key_frame_infos_;
120 template <
typename T>
124 DCHECK(default_value);
125 DCHECK(!entries->empty());
127 typename std::vector<T>::const_iterator it = entries->begin();
129 for (; it < entries->end(); ++it)
135 *default_value = value;
143 #endif // PACKAGER_MEDIA_FORMATS_MP4_FRAGMENTER_H_
All the methods that are virtual are virtual for mocking.