| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef MEDIA_FORMATS_MP4_TRACK_RUN_ITERATOR_H_ | 5 #ifndef MEDIA_FORMATS_MP4_TRACK_RUN_ITERATOR_H_ |
| 6 #define MEDIA_FORMATS_MP4_TRACK_RUN_ITERATOR_H_ | 6 #define MEDIA_FORMATS_MP4_TRACK_RUN_ITERATOR_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 DecodeTimestamp MEDIA_EXPORT DecodeTimestampFromRational(int64 numer, | 25 DecodeTimestamp MEDIA_EXPORT DecodeTimestampFromRational(int64 numer, |
| 26 int64 denom); | 26 int64 denom); |
| 27 | 27 |
| 28 struct SampleInfo; | 28 struct SampleInfo; |
| 29 struct TrackRunInfo; | 29 struct TrackRunInfo; |
| 30 | 30 |
| 31 class MEDIA_EXPORT TrackRunIterator { | 31 class MEDIA_EXPORT TrackRunIterator { |
| 32 public: | 32 public: |
| 33 // Create a new TrackRunIterator. A reference to |moov| will be retained for | 33 // Create a new TrackRunIterator. A reference to |moov| will be retained for |
| 34 // the lifetime of this object. | 34 // the lifetime of this object. |
| 35 TrackRunIterator(const Movie* moov, const LogCB& log_cb); | 35 TrackRunIterator(const Movie* moov, const scoped_refptr<MediaLog>& media_log); |
| 36 ~TrackRunIterator(); | 36 ~TrackRunIterator(); |
| 37 | 37 |
| 38 // Sets up the iterator to handle all the runs from the current fragment. | 38 // Sets up the iterator to handle all the runs from the current fragment. |
| 39 bool Init(const MovieFragment& moof); | 39 bool Init(const MovieFragment& moof); |
| 40 | 40 |
| 41 // Returns true if the properties of the current run or sample are valid. | 41 // Returns true if the properties of the current run or sample are valid. |
| 42 bool IsRunValid() const; | 42 bool IsRunValid() const; |
| 43 bool IsSampleValid() const; | 43 bool IsSampleValid() const; |
| 44 | 44 |
| 45 // Advance the properties to refer to the next run or sample. Requires that | 45 // Advance the properties to refer to the next run or sample. Requires that |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 uint32 GetGroupDescriptionIndex(uint32 sample_index) const; | 93 uint32 GetGroupDescriptionIndex(uint32 sample_index) const; |
| 94 const CencSampleEncryptionInfoEntry& GetSampleEncryptionInfoEntry( | 94 const CencSampleEncryptionInfoEntry& GetSampleEncryptionInfoEntry( |
| 95 uint32 group_description_index) const; | 95 uint32 group_description_index) const; |
| 96 | 96 |
| 97 // Sample encryption information. | 97 // Sample encryption information. |
| 98 bool IsSampleEncrypted(size_t sample_index) const; | 98 bool IsSampleEncrypted(size_t sample_index) const; |
| 99 uint8 GetIvSize(size_t sample_index) const; | 99 uint8 GetIvSize(size_t sample_index) const; |
| 100 const std::vector<uint8>& GetKeyId(size_t sample_index) const; | 100 const std::vector<uint8>& GetKeyId(size_t sample_index) const; |
| 101 | 101 |
| 102 const Movie* moov_; | 102 const Movie* moov_; |
| 103 LogCB log_cb_; | 103 scoped_refptr<MediaLog> media_log_; |
| 104 | 104 |
| 105 std::vector<TrackRunInfo> runs_; | 105 std::vector<TrackRunInfo> runs_; |
| 106 std::vector<TrackRunInfo>::const_iterator run_itr_; | 106 std::vector<TrackRunInfo>::const_iterator run_itr_; |
| 107 std::vector<SampleInfo>::const_iterator sample_itr_; | 107 std::vector<SampleInfo>::const_iterator sample_itr_; |
| 108 | 108 |
| 109 std::vector<FrameCENCInfo> cenc_info_; | 109 std::vector<FrameCENCInfo> cenc_info_; |
| 110 | 110 |
| 111 int64 sample_dts_; | 111 int64 sample_dts_; |
| 112 int64 sample_offset_; | 112 int64 sample_offset_; |
| 113 | 113 |
| 114 DISALLOW_COPY_AND_ASSIGN(TrackRunIterator); | 114 DISALLOW_COPY_AND_ASSIGN(TrackRunIterator); |
| 115 }; | 115 }; |
| 116 | 116 |
| 117 } // namespace mp4 | 117 } // namespace mp4 |
| 118 } // namespace media | 118 } // namespace media |
| 119 | 119 |
| 120 #endif // MEDIA_FORMATS_MP4_TRACK_RUN_ITERATOR_H_ | 120 #endif // MEDIA_FORMATS_MP4_TRACK_RUN_ITERATOR_H_ |
| OLD | NEW |