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 <memory> |
12 #include <vector> | 12 #include <vector> |
13 | 13 |
14 #include "base/macros.h" | 14 #include "base/macros.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 #include "media/media_features.h" |
20 | 21 |
21 namespace media { | 22 namespace media { |
22 | 23 |
23 class DecryptConfig; | 24 class DecryptConfig; |
24 | 25 |
25 namespace mp4 { | 26 namespace mp4 { |
26 | 27 |
27 base::TimeDelta MEDIA_EXPORT TimeDeltaFromRational(int64_t numer, | 28 base::TimeDelta MEDIA_EXPORT TimeDeltaFromRational(int64_t numer, |
28 int64_t denom); | 29 int64_t denom); |
29 DecodeTimestamp MEDIA_EXPORT DecodeTimestampFromRational(int64_t numer, | 30 DecodeTimestamp MEDIA_EXPORT DecodeTimestampFromRational(int64_t numer, |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 private: | 93 private: |
93 void ResetRun(); | 94 void ResetRun(); |
94 const TrackEncryption& track_encryption() const; | 95 const TrackEncryption& track_encryption() const; |
95 | 96 |
96 uint32_t GetGroupDescriptionIndex(uint32_t sample_index) const; | 97 uint32_t GetGroupDescriptionIndex(uint32_t sample_index) const; |
97 | 98 |
98 // Sample encryption information. | 99 // Sample encryption information. |
99 bool IsSampleEncrypted(size_t sample_index) const; | 100 bool IsSampleEncrypted(size_t sample_index) const; |
100 uint8_t GetIvSize(size_t sample_index) const; | 101 uint8_t GetIvSize(size_t sample_index) const; |
101 const std::vector<uint8_t>& GetKeyId(size_t sample_index) const; | 102 const std::vector<uint8_t>& GetKeyId(size_t sample_index) const; |
| 103 #if BUILDFLAG(ENABLE_CBCS_ENCRYPTION_SCHEME) |
| 104 bool ApplyConstantIv(size_t sample_index, SampleEncryptionEntry* entry) const; |
| 105 #endif |
102 | 106 |
103 const Movie* moov_; | 107 const Movie* moov_; |
104 scoped_refptr<MediaLog> media_log_; | 108 scoped_refptr<MediaLog> media_log_; |
105 | 109 |
106 std::vector<TrackRunInfo> runs_; | 110 std::vector<TrackRunInfo> runs_; |
107 std::vector<TrackRunInfo>::const_iterator run_itr_; | 111 std::vector<TrackRunInfo>::const_iterator run_itr_; |
108 std::vector<SampleInfo>::const_iterator sample_itr_; | 112 std::vector<SampleInfo>::const_iterator sample_itr_; |
109 | 113 |
110 int64_t sample_dts_; | 114 int64_t sample_dts_; |
111 int64_t sample_offset_; | 115 int64_t sample_offset_; |
112 | 116 |
113 DISALLOW_COPY_AND_ASSIGN(TrackRunIterator); | 117 DISALLOW_COPY_AND_ASSIGN(TrackRunIterator); |
114 }; | 118 }; |
115 | 119 |
116 } // namespace mp4 | 120 } // namespace mp4 |
117 } // namespace media | 121 } // namespace media |
118 | 122 |
119 #endif // MEDIA_FORMATS_MP4_TRACK_RUN_ITERATOR_H_ | 123 #endif // MEDIA_FORMATS_MP4_TRACK_RUN_ITERATOR_H_ |
OLD | NEW |