Bug 1309163: Add BitReader::BitsLeft method. r=gerald
authorJean-Yves Avenard <jyavenard@mozilla.com>
Mon, 24 Oct 2016 17:22:05 +1100
changeset 325344 c58bfbe2800682c2c2c85716d3155e30a33997ad
parent 325343 5ae2260e20e758d04e80427d29cf8aa1d2cd2890
child 325345 99d76c84603d08dcccbd85630c5a62aebc909694
push id24
push usermaklebus@msu.edu
push dateTue, 20 Dec 2016 03:11:33 +0000
reviewersgerald
bugs1309163
milestone53.0a1
Bug 1309163: Add BitReader::BitsLeft method. r=gerald MozReview-Commit-ID: 9HOunJRb1ht
media/libstagefright/binding/BitReader.cpp
media/libstagefright/binding/include/mp4_demuxer/BitReader.h
--- a/media/libstagefright/binding/BitReader.cpp
+++ b/media/libstagefright/binding/BitReader.cpp
@@ -96,9 +96,15 @@ BitReader::ReadUTF8()
 }
 
 size_t
 BitReader::BitCount() const
 {
   return mSize * 8 - mBitReader->numBitsLeft();
 }
 
+size_t
+BitReader::BitsLeft() const
+{
+  return mBitReader->numBitsLeft();
+}
+
 } // namespace mp4_demuxer
--- a/media/libstagefright/binding/include/mp4_demuxer/BitReader.h
+++ b/media/libstagefright/binding/include/mp4_demuxer/BitReader.h
@@ -29,16 +29,18 @@ public:
   uint64_t ReadUTF8();
   // Read unsigned integer Exp-Golomb-coded.
   uint32_t ReadUE();
   // Read signed integer Exp-Golomb-coded.
   int32_t ReadSE();
 
   // Return the number of bits parsed so far;
   size_t BitCount() const;
+  // Return the number of bits left.
+  size_t BitsLeft() const;
 
 private:
   nsAutoPtr<stagefright::ABitReader> mBitReader;
   const size_t mSize;
 };
 
 } // namespace mp4_demuxer