| 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 // 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 Loading... |
| 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 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 437 ClientInfoMap::iterator it = clients->find(client_id); | 438 ClientInfoMap::iterator it = clients->find(client_id); |
| 438 if (it != clients->end()) { | 439 if (it != clients->end()) { |
| 439 it->second.state_update_cb.Run(VIDEO_CAPTURE_STATE_STOPPED); | 440 it->second.state_update_cb.Run(VIDEO_CAPTURE_STATE_STOPPED); |
| 440 clients->erase(it); | 441 clients->erase(it); |
| 441 found = true; | 442 found = true; |
| 442 } | 443 } |
| 443 return found; | 444 return found; |
| 444 } | 445 } |
| 445 | 446 |
| 446 } // namespace content | 447 } // namespace content |
| OLD | NEW |