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 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 release_sync_point_storage = new uint32(0); | 256 release_sync_point_storage = new uint32(0); |
257 frame = media::VideoFrame::WrapNativeTexture( | 257 frame = media::VideoFrame::WrapNativeTexture( |
258 pixel_format, | 258 pixel_format, |
259 mailbox_holder, | 259 mailbox_holder, |
260 base::Bind(&SaveReleaseSyncPoint, release_sync_point_storage), | 260 base::Bind(&SaveReleaseSyncPoint, release_sync_point_storage), |
261 coded_size, | 261 coded_size, |
262 gfx::Rect(coded_size), | 262 gfx::Rect(coded_size), |
263 coded_size, | 263 coded_size, |
264 timestamp - first_frame_timestamp_); | 264 timestamp - first_frame_timestamp_); |
265 } | 265 } |
| 266 frame->metadata()->SetTimeTicks(media::VideoFrameMetadata::REFERENCE_TIME, |
| 267 timestamp); |
266 frame->AddDestructionObserver( | 268 frame->AddDestructionObserver( |
267 base::Bind(&VideoCaptureImpl::DidFinishConsumingFrame, frame->metadata(), | 269 base::Bind(&VideoCaptureImpl::DidFinishConsumingFrame, frame->metadata(), |
268 release_sync_point_storage, | 270 release_sync_point_storage, |
269 media::BindToCurrentLoop(base::Bind( | 271 media::BindToCurrentLoop(base::Bind( |
270 &VideoCaptureImpl::OnClientBufferFinished, | 272 &VideoCaptureImpl::OnClientBufferFinished, |
271 weak_factory_.GetWeakPtr(), buffer_id, buffer)))); | 273 weak_factory_.GetWeakPtr(), buffer_id, buffer)))); |
272 | 274 |
273 frame->metadata()->MergeInternalValuesFrom(metadata); | 275 frame->metadata()->MergeInternalValuesFrom(metadata); |
274 deliver_frame_cb_.Run(frame, timestamp); | 276 deliver_frame_cb_.Run(frame, timestamp); |
275 } | 277 } |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
399 void VideoCaptureImpl::ResetClient() { | 401 void VideoCaptureImpl::ResetClient() { |
400 client_params_ = media::VideoCaptureParams(); | 402 client_params_ = media::VideoCaptureParams(); |
401 state_update_cb_.Reset(); | 403 state_update_cb_.Reset(); |
402 deliver_frame_cb_.Reset(); | 404 deliver_frame_cb_.Reset(); |
403 first_frame_timestamp_ = base::TimeTicks(); | 405 first_frame_timestamp_ = base::TimeTicks(); |
404 device_id_ = kUndefinedDeviceId; | 406 device_id_ = kUndefinedDeviceId; |
405 state_ = VIDEO_CAPTURE_STATE_STOPPED; | 407 state_ = VIDEO_CAPTURE_STATE_STOPPED; |
406 } | 408 } |
407 | 409 |
408 } // namespace content | 410 } // namespace content |
OLD | NEW |