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 #include "media/base/data_buffer.h" | 5 #include "media/base/data_buffer.h" |
6 | 6 |
7 #include "base/logging.h" | |
8 | 7 |
9 namespace media { | 8 namespace media { |
10 | 9 |
11 DataBuffer::DataBuffer(int buffer_size) | 10 DataBuffer::DataBuffer(int buffer_size) |
12 : buffer_size_(buffer_size), | 11 : buffer_size_(buffer_size), |
13 data_size_(0) { | 12 data_size_(0) { |
14 CHECK_GE(buffer_size, 0); | 13 CHECK_GE(buffer_size, 0); |
15 data_.reset(new uint8[buffer_size_]); | 14 data_.reset(new uint8[buffer_size_]); |
16 } | 15 } |
17 | 16 |
(...skipping 25 matching lines...) Expand all Loading... |
43 // If you hit this CHECK you likely have a bug in a demuxer. Go fix it. | 42 // If you hit this CHECK you likely have a bug in a demuxer. Go fix it. |
44 CHECK(data); | 43 CHECK(data); |
45 return make_scoped_refptr(new DataBuffer(data, size)); | 44 return make_scoped_refptr(new DataBuffer(data, size)); |
46 } | 45 } |
47 | 46 |
48 // static | 47 // static |
49 scoped_refptr<DataBuffer> DataBuffer::CreateEOSBuffer() { | 48 scoped_refptr<DataBuffer> DataBuffer::CreateEOSBuffer() { |
50 return make_scoped_refptr(new DataBuffer(NULL, 0)); | 49 return make_scoped_refptr(new DataBuffer(NULL, 0)); |
51 } | 50 } |
52 } // namespace media | 51 } // namespace media |
OLD | NEW |