Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(49)

Unified Diff: media/capture/video/shared_memory_buffer_handle.cc

Issue 2818513003: [Mojo Video Capture] Adapt video_capture service to refactored video capture stack (Closed)
Patch Set: Fix compile errors Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: media/capture/video/shared_memory_buffer_handle.cc
diff --git a/media/capture/video/shared_memory_buffer_handle.cc b/media/capture/video/shared_memory_buffer_handle.cc
new file mode 100644
index 0000000000000000000000000000000000000000..8814697ee5b940779ee035fef82ca7ccd4ac4e4f
--- /dev/null
+++ b/media/capture/video/shared_memory_buffer_handle.cc
@@ -0,0 +1,31 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "media/capture/video/shared_memory_buffer_handle.h"
+
+#include "base/memory/ptr_util.h"
+#include "mojo/public/cpp/system/platform_handle.h"
+
+namespace media {
+
+SharedMemoryBufferHandle::SharedMemoryBufferHandle(
+ base::SharedMemory* shared_memory,
+ size_t mapped_size)
+ : shared_memory_(shared_memory), mapped_size_(mapped_size) {}
+
+SharedMemoryBufferHandle::~SharedMemoryBufferHandle() = default;
+
+size_t SharedMemoryBufferHandle::mapped_size() const {
+ return mapped_size_;
+}
+
+uint8_t* SharedMemoryBufferHandle::data() const {
+ return static_cast<uint8_t*>(shared_memory_->memory());
+}
+
+const uint8_t* SharedMemoryBufferHandle::const_data() const {
+ return static_cast<const uint8_t*>(shared_memory_->memory());
+}
+
+} // namespace media
« no previous file with comments | « media/capture/video/shared_memory_buffer_handle.h ('k') | media/capture/video/shared_memory_buffer_tracker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698