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
3 // found in the LICENSE file.
5 #include "media/base/bit_reader.h"
9 BitReader::BitReader(const uint8
* data
, int size
)
10 : initial_size_(size
),
13 bit_reader_core_(this) {
18 BitReader::~BitReader() {}
20 int BitReader::GetBytes(int max_nbytes
, const uint8
** out
) {
21 DCHECK_GE(max_nbytes
, 0);
24 int nbytes
= max_nbytes
;
25 if (nbytes
> bytes_left_
)
30 bytes_left_
-= nbytes
;