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 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 | 274 |
275 if (first_frame_timestamp_.is_null()) | 275 if (first_frame_timestamp_.is_null()) |
276 first_frame_timestamp_ = timestamp; | 276 first_frame_timestamp_ = timestamp; |
277 | 277 |
278 scoped_refptr<media::VideoFrame> frame = media::VideoFrame::WrapNativeTexture( | 278 scoped_refptr<media::VideoFrame> frame = media::VideoFrame::WrapNativeTexture( |
279 mailbox_holder, | 279 mailbox_holder, |
280 media::BindToCurrentLoop(base::Bind( | 280 media::BindToCurrentLoop(base::Bind( |
281 &VideoCaptureImpl::OnClientBufferFinished, weak_factory_.GetWeakPtr(), | 281 &VideoCaptureImpl::OnClientBufferFinished, weak_factory_.GetWeakPtr(), |
282 buffer_id, scoped_refptr<ClientBuffer>())), | 282 buffer_id, scoped_refptr<ClientBuffer>())), |
283 packed_frame_size, gfx::Rect(packed_frame_size), packed_frame_size, | 283 packed_frame_size, gfx::Rect(packed_frame_size), packed_frame_size, |
284 timestamp - first_frame_timestamp_, false); | 284 timestamp - first_frame_timestamp_, false /* allow_overlay */, |
| 285 true /* has_alpha */); |
285 frame->metadata()->MergeInternalValuesFrom(metadata); | 286 frame->metadata()->MergeInternalValuesFrom(metadata); |
286 | 287 |
287 for (const auto& client : clients_) | 288 for (const auto& client : clients_) |
288 client.second.deliver_frame_cb.Run(frame, timestamp); | 289 client.second.deliver_frame_cb.Run(frame, timestamp); |
289 } | 290 } |
290 | 291 |
291 void VideoCaptureImpl::OnClientBufferFinished( | 292 void VideoCaptureImpl::OnClientBufferFinished( |
292 int buffer_id, | 293 int buffer_id, |
293 const scoped_refptr<ClientBuffer>& /* ignored_buffer */, | 294 const scoped_refptr<ClientBuffer>& /* ignored_buffer */, |
294 uint32 release_sync_point) { | 295 uint32 release_sync_point) { |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
420 const ClientInfoMap::iterator it = clients->find(client_id); | 421 const ClientInfoMap::iterator it = clients->find(client_id); |
421 if (it != clients->end()) { | 422 if (it != clients->end()) { |
422 it->second.state_update_cb.Run(VIDEO_CAPTURE_STATE_STOPPED); | 423 it->second.state_update_cb.Run(VIDEO_CAPTURE_STATE_STOPPED); |
423 clients->erase(it); | 424 clients->erase(it); |
424 found = true; | 425 found = true; |
425 } | 426 } |
426 return found; | 427 return found; |
427 } | 428 } |
428 | 429 |
429 } // namespace content | 430 } // namespace content |
OLD | NEW |