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

Unified Diff: media/base/video_frame.cc

Issue 1637793004: [WIP] Mojo Video Capture thingy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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/base/video_frame.cc
diff --git a/media/base/video_frame.cc b/media/base/video_frame.cc
index 0ad4ac0f807607d90b0bc0a24695a79507d2eeb8..b024620e05da0438e1494c280520f39046c56db8 100644
--- a/media/base/video_frame.cc
+++ b/media/base/video_frame.cc
@@ -786,6 +786,12 @@ size_t VideoFrame::shared_memory_offset() const {
return shared_memory_offset_;
}
+const base::SharedMemory& VideoFrame::shared_memory() const {
+ DCHECK_EQ(storage_type_, STORAGE_SHMEM);
+ return *shared_memory_.get();
+}
+
+
const std::vector<gfx::GpuMemoryBufferHandle>&
VideoFrame::gpu_memory_buffer_handles() const {
DCHECK_EQ(storage_type_, STORAGE_GPU_MEMORY_BUFFERS);
@@ -833,6 +839,11 @@ void VideoFrame::AddSharedMemoryHandle(base::SharedMemoryHandle handle) {
shared_memory_handle_ = handle;
}
+void VideoFrame::AddSharedMemory(scoped_ptr<base::SharedMemory> shared_memory) {
+ storage_type_ = STORAGE_SHMEM;
+ shared_memory_ = std::move(shared_memory);
+}
+
#if defined(OS_MACOSX)
CVPixelBufferRef VideoFrame::cv_pixel_buffer() const {
return cv_pixel_buffer_.get();

Powered by Google App Engine
This is Rietveld 408576698