OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2016 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/capture/video/shared_memory_buffer_handle.h" | |
6 | |
7 #include "base/memory/ptr_util.h" | |
8 #include "mojo/public/cpp/system/platform_handle.h" | |
9 | |
10 namespace media { | |
11 | |
12 SharedMemoryBufferHandle::SharedMemoryBufferHandle( | |
13 base::SharedMemory* shared_memory, | |
14 size_t mapped_size) | |
15 : shared_memory_(shared_memory), mapped_size_(mapped_size) {} | |
16 | |
17 SharedMemoryBufferHandle::~SharedMemoryBufferHandle() = default; | |
18 | |
19 size_t SharedMemoryBufferHandle::mapped_size() const { | |
20 return mapped_size_; | |
21 } | |
22 | |
23 uint8_t* SharedMemoryBufferHandle::data() { | |
24 return static_cast<uint8_t*>(shared_memory_->memory()); | |
emircan
2017/04/19 18:16:48
We should add checks to make sure |share_memory_|
chfremer
2017/04/19 23:03:37
I don't think checks would work here.
Added comme
| |
25 } | |
26 | |
27 const uint8_t* SharedMemoryBufferHandle::data() const { | |
28 return static_cast<const uint8_t*>(shared_memory_->memory()); | |
29 } | |
30 | |
31 } // namespace media | |
OLD | NEW |