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_BOX_READER_H_ | 5 #ifndef MEDIA_FORMATS_MP4_BOX_READER_H_ |
6 #define MEDIA_FORMATS_MP4_BOX_READER_H_ | 6 #define MEDIA_FORMATS_MP4_BOX_READER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 | 132 |
133 // Populate the values of 'version()' and 'flags()' from a full box header. | 133 // Populate the values of 'version()' and 'flags()' from a full box header. |
134 // Many boxes, but not all, use these values. This call should happen after | 134 // Many boxes, but not all, use these values. This call should happen after |
135 // the box has been initialized, and does not re-read the main box header. | 135 // the box has been initialized, and does not re-read the main box header. |
136 bool ReadFullBoxHeader() WARN_UNUSED_RESULT; | 136 bool ReadFullBoxHeader() WARN_UNUSED_RESULT; |
137 | 137 |
138 FourCC type() const { return type_; } | 138 FourCC type() const { return type_; } |
139 uint8 version() const { return version_; } | 139 uint8 version() const { return version_; } |
140 uint32 flags() const { return flags_; } | 140 uint32 flags() const { return flags_; } |
141 | 141 |
| 142 const LogCB& log_cb() const { return log_cb_; } |
| 143 |
142 private: | 144 private: |
143 BoxReader(const uint8* buf, const int size, const LogCB& log_cb); | 145 BoxReader(const uint8* buf, const int size, const LogCB& log_cb); |
144 | 146 |
145 // Must be called immediately after init. If the return is false, this | 147 // Must be called immediately after init. If the return is false, this |
146 // indicates that the box header and its contents were not available in the | 148 // indicates that the box header and its contents were not available in the |
147 // stream or were nonsensical, and that the box must not be used further. In | 149 // stream or were nonsensical, and that the box must not be used further. In |
148 // this case, if |*err| is false, the problem was simply a lack of data, and | 150 // this case, if |*err| is false, the problem was simply a lack of data, and |
149 // should only be an error condition if some higher-level component knows that | 151 // should only be an error condition if some higher-level component knows that |
150 // no more data is coming (i.e. EOS or end of containing box). If |*err| is | 152 // no more data is coming (i.e. EOS or end of containing box). If |*err| is |
151 // true, the error is unrecoverable and the stream should be aborted. | 153 // true, the error is unrecoverable and the stream should be aborted. |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 pos_ += child_reader.size(); | 210 pos_ += child_reader.size(); |
209 } | 211 } |
210 | 212 |
211 return !err; | 213 return !err; |
212 } | 214 } |
213 | 215 |
214 } // namespace mp4 | 216 } // namespace mp4 |
215 } // namespace media | 217 } // namespace media |
216 | 218 |
217 #endif // MEDIA_FORMATS_MP4_BOX_READER_H_ | 219 #endif // MEDIA_FORMATS_MP4_BOX_READER_H_ |
OLD | NEW |