OLD | NEW |
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 #include "content/renderer/media/video_capture_impl.h" | 5 #include "content/renderer/media/video_capture_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
9 #include "content/child/child_process.h" | 9 #include "content/child/child_process.h" |
10 #include "content/common/media/video_capture_messages.h" | 10 #include "content/common/media/video_capture_messages.h" |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 return; | 251 return; |
252 } | 252 } |
253 | 253 |
254 last_frame_format_ = format; | 254 last_frame_format_ = format; |
255 gfx::Size size(format.width, format.height); | 255 gfx::Size size(format.width, format.height); |
256 | 256 |
257 ClientBufferMap::iterator iter = client_buffers_.find(buffer_id); | 257 ClientBufferMap::iterator iter = client_buffers_.find(buffer_id); |
258 DCHECK(iter != client_buffers_.end()); | 258 DCHECK(iter != client_buffers_.end()); |
259 scoped_refptr<ClientBuffer> buffer = iter->second; | 259 scoped_refptr<ClientBuffer> buffer = iter->second; |
260 scoped_refptr<media::VideoFrame> frame = | 260 scoped_refptr<media::VideoFrame> frame = |
261 media::VideoFrame::WrapExternalSharedMemory( | 261 media::VideoFrame::WrapExternalPackedMemory( |
262 media::VideoFrame::I420, | 262 media::VideoFrame::I420, |
263 size, gfx::Rect(size), size, | 263 size, |
| 264 gfx::Rect(size), |
| 265 size, |
264 reinterpret_cast<uint8*>(buffer->buffer->memory()), | 266 reinterpret_cast<uint8*>(buffer->buffer->memory()), |
265 buffer->buffer_size, | 267 buffer->buffer_size, |
266 buffer->buffer->handle(), | 268 buffer->buffer->handle(), |
267 // TODO(sheu): convert VideoCaptureMessageFilter::Delegate to use | 269 // TODO(sheu): convert VideoCaptureMessageFilter::Delegate to use |
268 // base::TimeTicks instead of base::Time. http://crbug.com/249215 | 270 // base::TimeTicks instead of base::Time. http://crbug.com/249215 |
269 timestamp - base::Time::UnixEpoch(), | 271 timestamp - base::Time::UnixEpoch(), |
270 media::BindToLoop( | 272 media::BindToLoop( |
271 capture_message_loop_proxy_, | 273 capture_message_loop_proxy_, |
272 base::Bind( | 274 base::Bind( |
273 &VideoCaptureImpl::DoClientBufferFinishedOnCaptureThread, | 275 &VideoCaptureImpl::DoClientBufferFinishedOnCaptureThread, |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
422 if (it != clients->end()) { | 424 if (it != clients->end()) { |
423 handler->OnStopped(this); | 425 handler->OnStopped(this); |
424 handler->OnRemoved(this); | 426 handler->OnRemoved(this); |
425 clients->erase(it); | 427 clients->erase(it); |
426 found = true; | 428 found = true; |
427 } | 429 } |
428 return found; | 430 return found; |
429 } | 431 } |
430 | 432 |
431 } // namespace content | 433 } // namespace content |
OLD | NEW |