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 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 timestamp - first_frame_timestamp_, | 244 timestamp - first_frame_timestamp_, |
245 media::BindToCurrentLoop( | 245 media::BindToCurrentLoop( |
246 base::Bind(&VideoCaptureImpl::OnClientBufferFinished, | 246 base::Bind(&VideoCaptureImpl::OnClientBufferFinished, |
247 weak_factory_.GetWeakPtr(), | 247 weak_factory_.GetWeakPtr(), |
248 buffer_id, | 248 buffer_id, |
249 buffer, | 249 buffer, |
250 std::vector<uint32>()))); | 250 std::vector<uint32>()))); |
251 | 251 |
252 for (ClientInfoMap::iterator it = clients_.begin(); it != clients_.end(); | 252 for (ClientInfoMap::iterator it = clients_.begin(); it != clients_.end(); |
253 ++it) { | 253 ++it) { |
254 it->second.deliver_frame_cb.Run(frame, format); | 254 it->second.deliver_frame_cb.Run(frame, format, timestamp); |
255 } | 255 } |
256 } | 256 } |
257 | 257 |
258 static void NullReadPixelsCB(const SkBitmap& bitmap) { NOTIMPLEMENTED(); } | 258 static void NullReadPixelsCB(const SkBitmap& bitmap) { NOTIMPLEMENTED(); } |
259 | 259 |
260 void VideoCaptureImpl::OnMailboxBufferReceived( | 260 void VideoCaptureImpl::OnMailboxBufferReceived( |
261 int buffer_id, | 261 int buffer_id, |
262 const gpu::MailboxHolder& mailbox_holder, | 262 const gpu::MailboxHolder& mailbox_holder, |
263 const media::VideoCaptureFormat& format, | 263 const media::VideoCaptureFormat& format, |
264 base::TimeTicks timestamp) { | 264 base::TimeTicks timestamp) { |
(...skipping 17 matching lines...) Expand all Loading... |
282 buffer_id, | 282 buffer_id, |
283 scoped_refptr<ClientBuffer>())), | 283 scoped_refptr<ClientBuffer>())), |
284 last_frame_format_.frame_size, | 284 last_frame_format_.frame_size, |
285 gfx::Rect(last_frame_format_.frame_size), | 285 gfx::Rect(last_frame_format_.frame_size), |
286 last_frame_format_.frame_size, | 286 last_frame_format_.frame_size, |
287 timestamp - first_frame_timestamp_, | 287 timestamp - first_frame_timestamp_, |
288 base::Bind(&NullReadPixelsCB)); | 288 base::Bind(&NullReadPixelsCB)); |
289 | 289 |
290 for (ClientInfoMap::iterator it = clients_.begin(); it != clients_.end(); | 290 for (ClientInfoMap::iterator it = clients_.begin(); it != clients_.end(); |
291 ++it) { | 291 ++it) { |
292 it->second.deliver_frame_cb.Run(frame, format); | 292 it->second.deliver_frame_cb.Run(frame, format, timestamp); |
293 } | 293 } |
294 } | 294 } |
295 | 295 |
296 void VideoCaptureImpl::OnClientBufferFinished( | 296 void VideoCaptureImpl::OnClientBufferFinished( |
297 int buffer_id, | 297 int buffer_id, |
298 const scoped_refptr<ClientBuffer>& /* ignored_buffer */, | 298 const scoped_refptr<ClientBuffer>& /* ignored_buffer */, |
299 const std::vector<uint32>& release_sync_points) { | 299 const std::vector<uint32>& release_sync_points) { |
300 DCHECK(thread_checker_.CalledOnValidThread()); | 300 DCHECK(thread_checker_.CalledOnValidThread()); |
301 Send(new VideoCaptureHostMsg_BufferReady( | 301 Send(new VideoCaptureHostMsg_BufferReady( |
302 device_id_, buffer_id, release_sync_points)); | 302 device_id_, buffer_id, release_sync_points)); |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
435 ClientInfoMap::iterator it = clients->find(client_id); | 435 ClientInfoMap::iterator it = clients->find(client_id); |
436 if (it != clients->end()) { | 436 if (it != clients->end()) { |
437 it->second.state_update_cb.Run(VIDEO_CAPTURE_STATE_STOPPED); | 437 it->second.state_update_cb.Run(VIDEO_CAPTURE_STATE_STOPPED); |
438 clients->erase(it); | 438 clients->erase(it); |
439 found = true; | 439 found = true; |
440 } | 440 } |
441 return found; | 441 return found; |
442 } | 442 } |
443 | 443 |
444 } // namespace content | 444 } // namespace content |
OLD | NEW |