| 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 <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| 11 #include <memory> |
| 11 #include <vector> | 12 #include <vector> |
| 12 | 13 |
| 13 #include "base/macros.h" | 14 #include "base/macros.h" |
| 14 #include "base/memory/scoped_ptr.h" | |
| 15 #include "base/time/time.h" | 15 #include "base/time/time.h" |
| 16 #include "media/base/media_export.h" | 16 #include "media/base/media_export.h" |
| 17 #include "media/base/media_log.h" | 17 #include "media/base/media_log.h" |
| 18 #include "media/base/stream_parser_buffer.h" | 18 #include "media/base/stream_parser_buffer.h" |
| 19 #include "media/formats/mp4/box_definitions.h" | 19 #include "media/formats/mp4/box_definitions.h" |
| 20 | 20 |
| 21 namespace media { | 21 namespace media { |
| 22 | 22 |
| 23 class DecryptConfig; | 23 class DecryptConfig; |
| 24 | 24 |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 // Properties of the current sample. Only valid if IsSampleValid(). | 80 // Properties of the current sample. Only valid if IsSampleValid(). |
| 81 int64_t sample_offset() const; | 81 int64_t sample_offset() const; |
| 82 int sample_size() const; | 82 int sample_size() const; |
| 83 DecodeTimestamp dts() const; | 83 DecodeTimestamp dts() const; |
| 84 base::TimeDelta cts() const; | 84 base::TimeDelta cts() const; |
| 85 base::TimeDelta duration() const; | 85 base::TimeDelta duration() const; |
| 86 bool is_keyframe() const; | 86 bool is_keyframe() const; |
| 87 | 87 |
| 88 // Only call when is_encrypted() is true and AuxInfoNeedsToBeCached() is | 88 // Only call when is_encrypted() is true and AuxInfoNeedsToBeCached() is |
| 89 // false. Result is owned by caller. | 89 // false. Result is owned by caller. |
| 90 scoped_ptr<DecryptConfig> GetDecryptConfig(); | 90 std::unique_ptr<DecryptConfig> GetDecryptConfig(); |
| 91 | 91 |
| 92 private: | 92 private: |
| 93 void ResetRun(); | 93 void ResetRun(); |
| 94 const TrackEncryption& track_encryption() const; | 94 const TrackEncryption& track_encryption() const; |
| 95 | 95 |
| 96 uint32_t GetGroupDescriptionIndex(uint32_t sample_index) const; | 96 uint32_t GetGroupDescriptionIndex(uint32_t sample_index) const; |
| 97 | 97 |
| 98 // Sample encryption information. | 98 // Sample encryption information. |
| 99 bool IsSampleEncrypted(size_t sample_index) const; | 99 bool IsSampleEncrypted(size_t sample_index) const; |
| 100 uint8_t GetIvSize(size_t sample_index) const; | 100 uint8_t GetIvSize(size_t sample_index) const; |
| 101 const std::vector<uint8_t>& GetKeyId(size_t sample_index) const; | 101 const std::vector<uint8_t>& GetKeyId(size_t sample_index) const; |
| 102 | 102 |
| 103 const Movie* moov_; | 103 const Movie* moov_; |
| 104 scoped_refptr<MediaLog> media_log_; | 104 scoped_refptr<MediaLog> media_log_; |
| 105 | 105 |
| 106 std::vector<TrackRunInfo> runs_; | 106 std::vector<TrackRunInfo> runs_; |
| 107 std::vector<TrackRunInfo>::const_iterator run_itr_; | 107 std::vector<TrackRunInfo>::const_iterator run_itr_; |
| 108 std::vector<SampleInfo>::const_iterator sample_itr_; | 108 std::vector<SampleInfo>::const_iterator sample_itr_; |
| 109 | 109 |
| 110 int64_t sample_dts_; | 110 int64_t sample_dts_; |
| 111 int64_t sample_offset_; | 111 int64_t sample_offset_; |
| 112 | 112 |
| 113 DISALLOW_COPY_AND_ASSIGN(TrackRunIterator); | 113 DISALLOW_COPY_AND_ASSIGN(TrackRunIterator); |
| 114 }; | 114 }; |
| 115 | 115 |
| 116 } // namespace mp4 | 116 } // namespace mp4 |
| 117 } // namespace media | 117 } // namespace media |
| 118 | 118 |
| 119 #endif // MEDIA_FORMATS_MP4_TRACK_RUN_ITERATOR_H_ | 119 #endif // MEDIA_FORMATS_MP4_TRACK_RUN_ITERATOR_H_ |
| OLD | NEW |