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