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

Side by Side Diff: content/renderer/media/video_capture_impl.cc

Issue 877353002: media: VideoFrame: add offset for shared memory buffers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Simplify shm pointer computation Created 5 years, 10 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 unified diff | Download patch
« no previous file with comments | « content/renderer/media/rtc_video_encoder.cc ('k') | media/base/video_frame.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 // 4 //
5 // Notes about usage of this object by VideoCaptureImplManager. 5 // Notes about usage of this object by VideoCaptureImplManager.
6 // 6 //
7 // VideoCaptureImplManager access this object by using a Unretained() 7 // VideoCaptureImplManager access this object by using a Unretained()
8 // binding and tasks on the IO thread. It is then important that 8 // binding and tasks on the IO thread. It is then important that
9 // VideoCaptureImpl never post task to itself. All operations must be 9 // VideoCaptureImpl never post task to itself. All operations must be
10 // synchronous. 10 // synchronous.
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 scoped_refptr<ClientBuffer> buffer = iter->second; 237 scoped_refptr<ClientBuffer> buffer = iter->second;
238 scoped_refptr<media::VideoFrame> frame = 238 scoped_refptr<media::VideoFrame> frame =
239 media::VideoFrame::WrapExternalPackedMemory( 239 media::VideoFrame::WrapExternalPackedMemory(
240 media::VideoFrame::I420, 240 media::VideoFrame::I420,
241 last_frame_format_.frame_size, 241 last_frame_format_.frame_size,
242 visible_rect, 242 visible_rect,
243 gfx::Size(visible_rect.width(), visible_rect.height()), 243 gfx::Size(visible_rect.width(), visible_rect.height()),
244 reinterpret_cast<uint8*>(buffer->buffer->memory()), 244 reinterpret_cast<uint8*>(buffer->buffer->memory()),
245 buffer->buffer_size, 245 buffer->buffer_size,
246 buffer->buffer->handle(), 246 buffer->buffer->handle(),
247 0,
247 timestamp - first_frame_timestamp_, 248 timestamp - first_frame_timestamp_,
248 media::BindToCurrentLoop( 249 media::BindToCurrentLoop(
249 base::Bind(&VideoCaptureImpl::OnClientBufferFinished, 250 base::Bind(&VideoCaptureImpl::OnClientBufferFinished,
250 weak_factory_.GetWeakPtr(), 251 weak_factory_.GetWeakPtr(),
251 buffer_id, 252 buffer_id,
252 buffer, 253 buffer,
253 0))); 254 0)));
254 255
255 for (ClientInfoMap::iterator it = clients_.begin(); it != clients_.end(); 256 for (ClientInfoMap::iterator it = clients_.begin(); it != clients_.end();
256 ++it) { 257 ++it) {
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
433 ClientInfoMap::iterator it = clients->find(client_id); 434 ClientInfoMap::iterator it = clients->find(client_id);
434 if (it != clients->end()) { 435 if (it != clients->end()) {
435 it->second.state_update_cb.Run(VIDEO_CAPTURE_STATE_STOPPED); 436 it->second.state_update_cb.Run(VIDEO_CAPTURE_STATE_STOPPED);
436 clients->erase(it); 437 clients->erase(it);
437 found = true; 438 found = true;
438 } 439 }
439 return found; 440 return found;
440 } 441 }
441 442
442 } // namespace content 443 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/media/rtc_video_encoder.cc ('k') | media/base/video_frame.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698