diff options
Diffstat (limited to 'media/formats/mp4/mp4_stream_parser.h')
-rw-r--r-- | media/formats/mp4/mp4_stream_parser.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/media/formats/mp4/mp4_stream_parser.h b/media/formats/mp4/mp4_stream_parser.h index 36613b3..4923ab9 100644 --- a/media/formats/mp4/mp4_stream_parser.h +++ b/media/formats/mp4/mp4_stream_parser.h @@ -42,6 +42,7 @@ class MEDIA_EXPORT MP4StreamParser : public StreamParser { enum State { kWaitingForInit, kParsingBoxes, + kWaitingForSampleData, kEmittingSamples, kError }; @@ -78,6 +79,15 @@ class MEDIA_EXPORT MP4StreamParser : public StreamParser { void Reset(); + // Checks to see if we have enough data in |queue_| to transition to + // kEmittingSamples and start enqueuing samples. + bool HaveEnoughDataToEnqueueSamples(); + + // Sets |highest_end_offset_| based on the data in |moov_| + // and |moof|. Returns true if |highest_end_offset_| was successfully + // computed. + bool ComputeHighestEndOffset(const MovieFragment& moof); + State state_; InitCB init_cb_; NewConfigCB config_cb_; @@ -99,6 +109,11 @@ class MEDIA_EXPORT MP4StreamParser : public StreamParser { // Valid iff it is greater than the head of the queue. int64 mdat_tail_; + // The highest end offset in the current moof. This offset is + // relative to |moof_head_|. This value is used to make sure we have collected + // enough bytes to parse all samples and aux_info in the current moof. + int64 highest_end_offset_; + scoped_ptr<mp4::Movie> moov_; scoped_ptr<mp4::TrackRunIterator> runs_; |