| 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->metadata()->SetTimeTicks(media::VideoFrameMetadata::REFERENCE_TIME, | |
| 288 timestamp); | |
| 289 frame->AddDestructionObserver( | 287 frame->AddDestructionObserver( |
| 290 base::Bind(&VideoCaptureImpl::DidFinishConsumingFrame, | 288 base::Bind(&VideoCaptureImpl::DidFinishConsumingFrame, |
| 291 frame->metadata(), | 289 frame->metadata(), |
| 292 release_sync_point_storage, | 290 release_sync_point_storage, |
| 293 media::BindToCurrentLoop(base::Bind( | 291 media::BindToCurrentLoop(base::Bind( |
| 294 &VideoCaptureImpl::OnClientBufferFinished, | 292 &VideoCaptureImpl::OnClientBufferFinished, |
| 295 weak_factory_.GetWeakPtr(), | 293 weak_factory_.GetWeakPtr(), |
| 296 buffer_id, | 294 buffer_id, |
| 297 buffer)))); | 295 buffer)))); |
| 298 | 296 |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 460 double consumer_resource_utilization = -1.0; | 458 double consumer_resource_utilization = -1.0; |
| 461 if (!metadata->GetDouble(media::VideoFrameMetadata::RESOURCE_UTILIZATION, | 459 if (!metadata->GetDouble(media::VideoFrameMetadata::RESOURCE_UTILIZATION, |
| 462 &consumer_resource_utilization)) { | 460 &consumer_resource_utilization)) { |
| 463 consumer_resource_utilization = -1.0; | 461 consumer_resource_utilization = -1.0; |
| 464 } | 462 } |
| 465 | 463 |
| 466 callback_to_io_thread.Run(release_sync_point, consumer_resource_utilization); | 464 callback_to_io_thread.Run(release_sync_point, consumer_resource_utilization); |
| 467 } | 465 } |
| 468 | 466 |
| 469 } // namespace content | 467 } // namespace content |
| OLD | NEW |