7 #ifndef PACKAGER_MEDIA_FORMATS_MP4_MP4_MEDIA_PARSER_H_
8 #define PACKAGER_MEDIA_FORMATS_MP4_MP4_MEDIA_PARSER_H_
16 #include "packager/base/callback_forward.h"
17 #include "packager/media/base/decryptor_source.h"
18 #include "packager/media/base/media_parser.h"
19 #include "packager/media/base/offset_byte_queue.h"
26 class TrackRunIterator;
28 struct ProtectionSystemSpecificHeader;
40 KeySource* decryption_key_source)
override;
41 bool Flush()
override WARN_UNUSED_RESULT;
42 bool Parse(
const uint8_t* buf,
int size)
override WARN_UNUSED_RESULT;
51 bool LoadMoov(
const std::string& file_path);
61 bool ParseBox(
bool* err);
65 bool FetchKeysIfNecessary(
66 const std::vector<ProtectionSystemSpecificHeader>& headers);
74 bool ReadAndDiscardMDATsUntil(
const int64_t offset);
76 void ChangeState(State new_state);
80 bool EnqueueSample(
bool* err);
88 std::unique_ptr<DecryptorSource> decryptor_source_;
102 std::unique_ptr<Movie> moov_;
103 std::unique_ptr<TrackRunIterator> runs_;
112 #endif // PACKAGER_MEDIA_FORMATS_MP4_MP4_MEDIA_PARSER_H_