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

Unified Diff: media/capture/video/shared_memory_buffer_tracker.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_tracker.cc
diff --git a/media/capture/video/shared_memory_buffer_tracker.cc b/media/capture/video/shared_memory_buffer_tracker.cc
index dfdae676d226080d37ff528c4b299e3f1791a82a..c64ed3849884016ab1c99ef9e4b0123991715e59 100644
--- a/media/capture/video/shared_memory_buffer_tracker.cc
+++ b/media/capture/video/shared_memory_buffer_tracker.cc
@@ -5,6 +5,7 @@
#include "media/capture/video/shared_memory_buffer_tracker.h"
#include "base/memory/ptr_util.h"
+#include "media/capture/video/shared_memory_buffer_handle.h"
#include "mojo/public/cpp/system/platform_handle.h"
namespace media {
@@ -31,7 +32,8 @@ bool SharedMemoryBufferTracker::Init(const gfx::Size& dimensions,
std::unique_ptr<VideoCaptureBufferHandle>
SharedMemoryBufferTracker::GetMemoryMappedAccess() {
- return base::MakeUnique<SharedMemoryBufferHandle>(this);
+ return base::MakeUnique<SharedMemoryBufferHandle>(&shared_memory_,
+ mapped_size_);
}
mojo::ScopedSharedBufferHandle
@@ -46,22 +48,4 @@ SharedMemoryBufferTracker::GetNonOwnedSharedMemoryHandleForLegacyIPC() {
return shared_memory_.handle();
}
-SharedMemoryBufferHandle::SharedMemoryBufferHandle(
- SharedMemoryBufferTracker* tracker)
- : tracker_(tracker) {}
-
-SharedMemoryBufferHandle::~SharedMemoryBufferHandle() = default;
-
-size_t SharedMemoryBufferHandle::mapped_size() const {
- return tracker_->mapped_size_;
-}
-
-uint8_t* SharedMemoryBufferHandle::data() {
- return static_cast<uint8_t*>(tracker_->shared_memory_.memory());
-}
-
-const uint8_t* SharedMemoryBufferHandle::data() const {
- return static_cast<const uint8_t*>(tracker_->shared_memory_.memory());
-}
-
} // namespace media
« no previous file with comments | « media/capture/video/shared_memory_buffer_tracker.h ('k') | media/capture/video/video_capture_buffer_handle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698