Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_MP4_BOX_READER_H_ | 5 #ifndef MEDIA_MP4_BOX_READER_H_ |
| 6 #define MEDIA_MP4_BOX_READER_H_ | 6 #define MEDIA_MP4_BOX_READER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 47 bool ReadVec(std::vector<uint8>* t, int count) WARN_UNUSED_RESULT; | 47 bool ReadVec(std::vector<uint8>* t, int count) WARN_UNUSED_RESULT; |
| 48 | 48 |
| 49 // These variants read a 4-byte integer of the corresponding signedness and | 49 // These variants read a 4-byte integer of the corresponding signedness and |
| 50 // store it in the 8-byte return type. | 50 // store it in the 8-byte return type. |
| 51 bool Read4Into8(uint64* v) WARN_UNUSED_RESULT; | 51 bool Read4Into8(uint64* v) WARN_UNUSED_RESULT; |
| 52 bool Read4sInto8s(int64* v) WARN_UNUSED_RESULT; | 52 bool Read4sInto8s(int64* v) WARN_UNUSED_RESULT; |
| 53 | 53 |
| 54 // Advance the stream by this many bytes. | 54 // Advance the stream by this many bytes. |
| 55 bool SkipBytes(int nbytes) WARN_UNUSED_RESULT; | 55 bool SkipBytes(int nbytes) WARN_UNUSED_RESULT; |
| 56 | 56 |
| 57 const uint8* data() { return buf_; } | |
|
ddorwin
2012/09/21 04:04:28
Can this be a const function? The two below should
strobe_
2012/09/21 18:29:46
Done.
| |
| 57 int size() { return size_; } | 58 int size() { return size_; } |
| 58 int pos() { return pos_; } | 59 int pos() { return pos_; } |
| 59 | 60 |
| 60 protected: | 61 protected: |
| 61 const uint8* buf_; | 62 const uint8* buf_; |
| 62 int size_; | 63 int size_; |
| 63 int pos_; | 64 int pos_; |
| 64 | 65 |
| 65 template<typename T> bool Read(T* t) WARN_UNUSED_RESULT; | 66 template<typename T> bool Read(T* t) WARN_UNUSED_RESULT; |
| 66 }; | 67 }; |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 197 ++child_itr; | 198 ++child_itr; |
| 198 } | 199 } |
| 199 children_.clear(); | 200 children_.clear(); |
| 200 return true; | 201 return true; |
| 201 } | 202 } |
| 202 | 203 |
| 203 } // namespace mp4 | 204 } // namespace mp4 |
| 204 } // namespace media | 205 } // namespace media |
| 205 | 206 |
| 206 #endif // MEDIA_MP4_BOX_READER_H_ | 207 #endif // MEDIA_MP4_BOX_READER_H_ |
| OLD | NEW |