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_BASE_BIT_READER_H_ | 5 #ifndef MEDIA_BASE_BIT_READER_H_ |
6 #define MEDIA_BASE_BIT_READER_H_ | 6 #define MEDIA_BASE_BIT_READER_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 int bits_available() const { | 36 int bits_available() const { |
37 return initial_size_ * 8 - bits_read(); | 37 return initial_size_ * 8 - bits_read(); |
38 } | 38 } |
39 | 39 |
40 int bits_read() const { | 40 int bits_read() const { |
41 return bit_reader_core_.bits_read(); | 41 return bit_reader_core_.bits_read(); |
42 } | 42 } |
43 | 43 |
44 private: | 44 private: |
45 // BitReaderCore::ByteStreamProvider implementation. | 45 // BitReaderCore::ByteStreamProvider implementation. |
46 virtual int GetBytes(int max_n, const uint8** out) OVERRIDE; | 46 virtual int GetBytes(int max_n, const uint8** out) override; |
47 | 47 |
48 // Total number of bytes that was initially passed to BitReader. | 48 // Total number of bytes that was initially passed to BitReader. |
49 const int initial_size_; | 49 const int initial_size_; |
50 | 50 |
51 // Pointer to the next unread byte in the stream. | 51 // Pointer to the next unread byte in the stream. |
52 const uint8* data_; | 52 const uint8* data_; |
53 | 53 |
54 // Bytes left in the stream. | 54 // Bytes left in the stream. |
55 int bytes_left_; | 55 int bytes_left_; |
56 | 56 |
57 BitReaderCore bit_reader_core_; | 57 BitReaderCore bit_reader_core_; |
58 | 58 |
59 DISALLOW_COPY_AND_ASSIGN(BitReader); | 59 DISALLOW_COPY_AND_ASSIGN(BitReader); |
60 }; | 60 }; |
61 | 61 |
62 } // namespace media | 62 } // namespace media |
63 | 63 |
64 #endif // MEDIA_BASE_BIT_READER_H_ | 64 #endif // MEDIA_BASE_BIT_READER_H_ |
OLD | NEW |