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;
89 Status FinalizeFragmentForEncryption();
91 bool StartsWithSAP()
const;
93 std::shared_ptr<const StreamInfo> stream_info_;
94 bool use_decoding_timestamp_in_timeline_;
96 uint64_t seek_preroll_;
97 bool fragment_initialized_;
98 bool fragment_finalized_;
99 uint64_t fragment_duration_;
100 int64_t earliest_presentation_time_;
101 bool first_fragment_ =
true;
102 int64_t first_sap_time_;
103 std::unique_ptr<BufferWriter> data_;
105 std::vector<KeyFrameInfo> key_frame_infos_;
110 template <
typename T>
114 DCHECK(default_value);
115 DCHECK(!entries->empty());
117 typename std::vector<T>::const_iterator it = entries->begin();
119 for (; it < entries->end(); ++it)
125 *default_value = value;
133 #endif // PACKAGER_MEDIA_FORMATS_MP4_FRAGMENTER_H_
All the methods that are virtual are virtual for mocking.