From 8d489f9bb9a37133ac6549cd076e9a0161760015 Mon Sep 17 00:00:00 2001 From: Jean-Yves Avenard Date: Thu, 22 Jun 2017 22:50:08 +0200 Subject: [PATCH] Bug 1374774: P6. Fix ByteReader constness. r=gerald MozReview-Commit-ID: 8bQA189OOVF --HG-- extra : rebase_source : 4f4e371c43da839ae6168241879d580b97435bb0 --- .../binding/include/mp4_demuxer/ByteReader.h | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/media/libstagefright/binding/include/mp4_demuxer/ByteReader.h b/media/libstagefright/binding/include/mp4_demuxer/ByteReader.h index 9c7df04bd03f..ec65f7ae1930 100644 --- a/media/libstagefright/binding/include/mp4_demuxer/ByteReader.h +++ b/media/libstagefright/binding/include/mp4_demuxer/ByteReader.h @@ -50,14 +50,14 @@ public: { } - size_t Offset() + size_t Offset() const { return mLength - mRemaining; } size_t Remaining() const { return mRemaining; } - bool CanRead8() { return mRemaining >= 1; } + bool CanRead8() const { return mRemaining >= 1; } uint8_t ReadU8() { @@ -188,7 +188,7 @@ public: return mPtr; } - uint8_t PeekU8() + uint8_t PeekU8() const { auto ptr = Peek(1); if (!ptr) { @@ -198,7 +198,7 @@ public: return *ptr; } - uint16_t PeekU16() + uint16_t PeekU16() const { auto ptr = Peek(2); if (!ptr) { @@ -208,7 +208,7 @@ public: return mozilla::BigEndian::readUint16(ptr); } - uint32_t PeekU24() + uint32_t PeekU24() const { auto ptr = Peek(3); if (!ptr) { @@ -218,12 +218,12 @@ public: return ptr[0] << 16 | ptr[1] << 8 | ptr[2]; } - uint32_t Peek24() + uint32_t Peek24() const { return (uint32_t)PeekU24(); } - uint32_t PeekU32() + uint32_t PeekU32() const { auto ptr = Peek(4); if (!ptr) { @@ -233,7 +233,7 @@ public: return mozilla::BigEndian::readUint32(ptr); } - int32_t Peek32() + int32_t Peek32() const { auto ptr = Peek(4); if (!ptr) { @@ -243,7 +243,7 @@ public: return mozilla::BigEndian::readInt32(ptr); } - uint64_t PeekU64() + uint64_t PeekU64() const { auto ptr = Peek(8); if (!ptr) { @@ -253,7 +253,7 @@ public: return mozilla::BigEndian::readUint64(ptr); } - int64_t Peek64() + int64_t Peek64() const { auto ptr = Peek(8); if (!ptr) { @@ -263,7 +263,7 @@ public: return mozilla::BigEndian::readInt64(ptr); } - const uint8_t* Peek(size_t aCount) + const uint8_t* Peek(size_t aCount) const { if (aCount > mRemaining) { return nullptr; @@ -290,12 +290,12 @@ public: return mPtr; } - uint32_t Align() + uint32_t Align() const { return 4 - ((intptr_t)mPtr & 3); } - template bool CanReadType() { return mRemaining >= sizeof(T); } + template bool CanReadType() const { return mRemaining >= sizeof(T); } template T ReadType() {