Bug 1309163: Add BitReader::BitsLeft method. r?erald draft
authorJean-Yves Avenard <jyavenard@mozilla.com>
Mon, 24 Oct 2016 17:22:05 +1100
changeset 428633 bf4672d220fe27d516c65e321ad3f1324a282ceb
parent 428133 28681d252003e3110105473754da2f4097cb83a6
child 428634 bdaa012d8a03be784bf87c4ee7403ce6352d9a27
push id33379
push userbmo:jyavenard@mozilla.com
push dateMon, 24 Oct 2016 12:42:43 +0000
reviewerserald
bugs1309163
milestone52.0a1
Bug 1309163: Add BitReader::BitsLeft method. r?erald 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