| 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 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 release_sync_point_storage = new uint32(0); | 277 release_sync_point_storage = new uint32(0); |
| 278 frame = media::VideoFrame::WrapNativeTexture( | 278 frame = media::VideoFrame::WrapNativeTexture( |
| 279 pixel_format, | 279 pixel_format, |
| 280 mailbox_holder, | 280 mailbox_holder, |
| 281 base::Bind(&SaveReleaseSyncPoint, release_sync_point_storage), | 281 base::Bind(&SaveReleaseSyncPoint, release_sync_point_storage), |
| 282 coded_size, | 282 coded_size, |
| 283 gfx::Rect(coded_size), | 283 gfx::Rect(coded_size), |
| 284 coded_size, | 284 coded_size, |
| 285 timestamp - first_frame_timestamp_); | 285 timestamp - first_frame_timestamp_); |
| 286 } | 286 } |
| 287 frame->set_render_time(timestamp); |
| 287 frame->AddDestructionObserver( | 288 frame->AddDestructionObserver( |
| 288 base::Bind(&VideoCaptureImpl::DidFinishConsumingFrame, | 289 base::Bind(&VideoCaptureImpl::DidFinishConsumingFrame, |
| 289 frame->metadata(), | 290 frame->metadata(), |
| 290 release_sync_point_storage, | 291 release_sync_point_storage, |
| 291 media::BindToCurrentLoop(base::Bind( | 292 media::BindToCurrentLoop(base::Bind( |
| 292 &VideoCaptureImpl::OnClientBufferFinished, | 293 &VideoCaptureImpl::OnClientBufferFinished, |
| 293 weak_factory_.GetWeakPtr(), | 294 weak_factory_.GetWeakPtr(), |
| 294 buffer_id, | 295 buffer_id, |
| 295 buffer)))); | 296 buffer)))); |
| 296 | 297 |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 458 double consumer_resource_utilization = -1.0; | 459 double consumer_resource_utilization = -1.0; |
| 459 if (!metadata->GetDouble(media::VideoFrameMetadata::RESOURCE_UTILIZATION, | 460 if (!metadata->GetDouble(media::VideoFrameMetadata::RESOURCE_UTILIZATION, |
| 460 &consumer_resource_utilization)) { | 461 &consumer_resource_utilization)) { |
| 461 consumer_resource_utilization = -1.0; | 462 consumer_resource_utilization = -1.0; |
| 462 } | 463 } |
| 463 | 464 |
| 464 callback_to_io_thread.Run(release_sync_point, consumer_resource_utilization); | 465 callback_to_io_thread.Run(release_sync_point, consumer_resource_utilization); |
| 465 } | 466 } |
| 466 | 467 |
| 467 } // namespace content | 468 } // namespace content |
| OLD | NEW |