7 #ifndef PACKAGER_MEDIA_FORMATS_MP4_MP4_MEDIA_PARSER_H_
8 #define PACKAGER_MEDIA_FORMATS_MP4_MP4_MEDIA_PARSER_H_
15 #include <absl/flags/declare.h>
16 #include <absl/flags/flag.h>
18 #include <packager/macros/classes.h>
19 #include <packager/media/base/decryptor_source.h>
20 #include <packager/media/base/media_parser.h>
21 #include <packager/media/base/offset_byte_queue.h>
23 ABSL_DECLARE_FLAG(
bool, use_dovi_supplemental_codecs);
30 class TrackRunIterator;
32 struct ProtectionSystemSpecificHeader;
44 KeySource* decryption_key_source)
override;
45 [[nodiscard]]
bool Flush()
override;
46 [[nodiscard]]
bool Parse(
const uint8_t* buf,
int size)
override;
55 bool LoadMoov(
const std::string& file_path);
65 bool ParseBox(
bool* err);
69 bool FetchKeysIfNecessary(
70 const std::vector<ProtectionSystemSpecificHeader>& headers);
78 bool ReadAndDiscardMDATsUntil(
const int64_t offset);
80 void ChangeState(State new_state);
84 bool EnqueueSample(
bool* err);
92 std::unique_ptr<DecryptorSource> decryptor_source_;
106 std::unique_ptr<Movie> moov_;
107 std::unique_ptr<TrackRunIterator> runs_;
All the methods that are virtual are virtual for mocking.