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

Unified Diff: content/browser/renderer_host/media/video_capture_buffer_pool.cc

Issue 22645005: media::VideoFrame::WrapExternalSharedMemory (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@git-svn
Patch Set: Created 7 years, 4 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: content/browser/renderer_host/media/video_capture_buffer_pool.cc
diff --git a/content/browser/renderer_host/media/video_capture_buffer_pool.cc b/content/browser/renderer_host/media/video_capture_buffer_pool.cc
index ae29c75fc0bd5e878534ecc720c58f5ce16767c8..207f86a99f3df42cea42f8402ddaf3dacdd2f856 100644
--- a/content/browser/renderer_host/media/video_capture_buffer_pool.cc
+++ b/content/browser/renderer_host/media/video_capture_buffer_pool.cc
@@ -144,21 +144,15 @@ scoped_refptr<media::VideoFrame> VideoCaptureBufferPool::ReserveI420VideoFrame(
Buffer* buffer = buffers_[buffer_id];
// Wrap the buffer in a VideoFrame container.
- uint8* base_ptr = static_cast<uint8*>(buffer->shared_memory.memory());
- size_t u_offset = size.GetArea();
- size_t v_offset = u_offset + u_offset / 4;
scoped_refptr<media::VideoFrame> frame =
- media::VideoFrame::WrapExternalYuvData(
- media::VideoFrame::YV12, // Actually it's I420, but equivalent here.
- size, gfx::Rect(size), size,
- size.width(), // y stride
- size.width() / 2, // u stride
- size.width() / 2, // v stride
- base_ptr, // y address
- base_ptr + u_offset, // u address
- base_ptr + v_offset, // v address
- base::TimeDelta(), // timestamp (unused).
+ media::VideoFrame::WrapExternalSharedMemory(
+ media::VideoFrame::I420,
+ size,
+ gfx::Rect(size),
+ size,
+ static_cast<uint8*>(buffer->shared_memory.memory()),
buffer->shared_memory.handle(),
+ base::TimeDelta(),
disposal_handler);
if (buffer->rotation != rotation) {

Powered by Google App Engine
This is Rietveld 408576698