| 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 <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <limits> | 10 #include <limits> |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 bool Read2s(int16_t* v) WARN_UNUSED_RESULT; | 56 bool Read2s(int16_t* v) WARN_UNUSED_RESULT; |
| 57 bool Read4(uint32_t* v) WARN_UNUSED_RESULT; | 57 bool Read4(uint32_t* v) WARN_UNUSED_RESULT; |
| 58 bool Read4s(int32_t* v) WARN_UNUSED_RESULT; | 58 bool Read4s(int32_t* v) WARN_UNUSED_RESULT; |
| 59 bool Read8(uint64_t* v) WARN_UNUSED_RESULT; | 59 bool Read8(uint64_t* v) WARN_UNUSED_RESULT; |
| 60 bool Read8s(int64_t* v) WARN_UNUSED_RESULT; | 60 bool Read8s(int64_t* v) WARN_UNUSED_RESULT; |
| 61 | 61 |
| 62 bool ReadFourCC(FourCC* v) WARN_UNUSED_RESULT; | 62 bool ReadFourCC(FourCC* v) WARN_UNUSED_RESULT; |
| 63 | 63 |
| 64 bool ReadVec(std::vector<uint8_t>* t, uint64_t count) WARN_UNUSED_RESULT; | 64 bool ReadVec(std::vector<uint8_t>* t, uint64_t count) WARN_UNUSED_RESULT; |
| 65 | 65 |
| 66 // Read a null-terminated string. |
| 67 bool ReadString(std::string* v) WARN_UNUSED_RESULT; |
| 68 |
| 66 // These variants read a 4-byte integer of the corresponding signedness and | 69 // These variants read a 4-byte integer of the corresponding signedness and |
| 67 // store it in the 8-byte return type. | 70 // store it in the 8-byte return type. |
| 68 bool Read4Into8(uint64_t* v) WARN_UNUSED_RESULT; | 71 bool Read4Into8(uint64_t* v) WARN_UNUSED_RESULT; |
| 69 bool Read4sInto8s(int64_t* v) WARN_UNUSED_RESULT; | 72 bool Read4sInto8s(int64_t* v) WARN_UNUSED_RESULT; |
| 70 | 73 |
| 71 // Advance the stream by this many bytes. | 74 // Advance the stream by this many bytes. |
| 72 bool SkipBytes(uint64_t nbytes) WARN_UNUSED_RESULT; | 75 bool SkipBytes(uint64_t nbytes) WARN_UNUSED_RESULT; |
| 73 | 76 |
| 74 const uint8_t* data() const { return buf_; } | 77 const uint8_t* data() const { return buf_; } |
| 75 | 78 |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 pos_ += child_reader.size(); | 278 pos_ += child_reader.size(); |
| 276 } | 279 } |
| 277 | 280 |
| 278 return !err; | 281 return !err; |
| 279 } | 282 } |
| 280 | 283 |
| 281 } // namespace mp4 | 284 } // namespace mp4 |
| 282 } // namespace media | 285 } // namespace media |
| 283 | 286 |
| 284 #endif // MEDIA_FORMATS_MP4_BOX_READER_H_ | 287 #endif // MEDIA_FORMATS_MP4_BOX_READER_H_ |
| OLD | NEW |