OLD | NEW |
| (Empty) |
1 // Copyright 2013 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. | |
4 | |
5 #include "media/base/encoded_bitstream_buffer.h" | |
6 | |
7 #include "base/logging.h" | |
8 | |
9 namespace media { | |
10 | |
11 EncodedBitstreamBuffer::EncodedBitstreamBuffer( | |
12 int buffer_id, | |
13 uint8* buffer, | |
14 uint32 size, | |
15 base::SharedMemoryHandle handle, | |
16 const media::BufferEncodingMetadata& metadata, | |
17 const base::Closure& destroy_cb) | |
18 : buffer_id_(buffer_id), | |
19 buffer_(buffer), | |
20 size_(size), | |
21 shared_memory_handle_(handle), | |
22 metadata_(metadata), | |
23 destroy_cb_(destroy_cb) { | |
24 } | |
25 | |
26 EncodedBitstreamBuffer::~EncodedBitstreamBuffer() { | |
27 destroy_cb_.Run(); | |
28 } | |
29 | |
30 int EncodedBitstreamBuffer::buffer_id() const { | |
31 return buffer_id_; | |
32 } | |
33 | |
34 const uint8* EncodedBitstreamBuffer::buffer() const { | |
35 return buffer_; | |
36 } | |
37 | |
38 uint32 EncodedBitstreamBuffer::size() const { | |
39 return size_; | |
40 } | |
41 | |
42 base::SharedMemoryHandle EncodedBitstreamBuffer::shared_memory_handle() const { | |
43 return shared_memory_handle_; | |
44 } | |
45 | |
46 const media::BufferEncodingMetadata& EncodedBitstreamBuffer::metadata() const { | |
47 return metadata_; | |
48 } | |
49 | |
50 } // namespace media | |
OLD | NEW |