From 11d2736751eac8005eeb74bb5a038e920012229b Mon Sep 17 00:00:00 2001 From: Jean-Yves Avenard Date: Mon, 24 Oct 2016 17:22:05 +1100 Subject: [PATCH] Bug 1309163: Add BitReader::BitsLeft method. r=gerald MozReview-Commit-ID: 9HOunJRb1ht --HG-- extra : rebase_source : 6d71fb2afd90fc061b53bbb7285e5eada3bfea4a --- media/libstagefright/binding/BitReader.cpp | 6 ++++++ .../libstagefright/binding/include/mp4_demuxer/BitReader.h | 2 ++ 2 files changed, 8 insertions(+) diff --git a/media/libstagefright/binding/BitReader.cpp b/media/libstagefright/binding/BitReader.cpp index 4bf80cabaa51..826bb216eae4 100644 --- a/media/libstagefright/binding/BitReader.cpp +++ b/media/libstagefright/binding/BitReader.cpp @@ -101,4 +101,10 @@ BitReader::BitCount() const return mSize * 8 - mBitReader->numBitsLeft(); } +size_t +BitReader::BitsLeft() const +{ + return mBitReader->numBitsLeft(); +} + } // namespace mp4_demuxer diff --git a/media/libstagefright/binding/include/mp4_demuxer/BitReader.h b/media/libstagefright/binding/include/mp4_demuxer/BitReader.h index 27a10338f22b..17526f618002 100644 --- a/media/libstagefright/binding/include/mp4_demuxer/BitReader.h +++ b/media/libstagefright/binding/include/mp4_demuxer/BitReader.h @@ -34,6 +34,8 @@ public: // Return the number of bits parsed so far; size_t BitCount() const; + // Return the number of bits left. + size_t BitsLeft() const; private: nsAutoPtr mBitReader;