7 #ifndef MEDIA_FORMATS_MP4_MP4_MEDIA_PARSER_H_
8 #define MEDIA_FORMATS_MP4_MP4_MEDIA_PARSER_H_
15 #include "packager/base/callback_forward.h"
16 #include "packager/base/compiler_specific.h"
17 #include "packager/base/memory/scoped_ptr.h"
18 #include "packager/base/memory/ref_counted.h"
19 #include "packager/base/memory/scoped_ptr.h"
20 #include "packager/media/base/decryptor_source.h"
21 #include "packager/media/base/media_parser.h"
22 #include "packager/media/base/offset_byte_queue.h"
29 class TrackRunIterator;
31 struct ProtectionSystemSpecificHeader;
42 KeySource* decryption_key_source)
override;
43 bool Flush()
override WARN_UNUSED_RESULT;
44 bool Parse(
const uint8_t* buf,
int size)
override WARN_UNUSED_RESULT;
53 bool LoadMoov(
const std::string& file_path);
63 bool ParseBox(
bool* err);
67 bool FetchKeysIfNecessary(
68 const std::vector<ProtectionSystemSpecificHeader>& headers);
76 bool ReadAndDiscardMDATsUntil(
const int64_t offset);
78 void ChangeState(State new_state);
82 bool EnqueueSample(
bool* err);
90 scoped_ptr<DecryptorSource> decryptor_source_;
104 scoped_ptr<Movie> moov_;
105 scoped_ptr<TrackRunIterator> runs_;
114 #endif // MEDIA_FORMATS_MP4_MP4_MEDIA_PARSER_H_