| 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); | |
| 268 frame->AddDestructionObserver( | 266 frame->AddDestructionObserver( |
| 269 base::Bind(&VideoCaptureImpl::DidFinishConsumingFrame, frame->metadata(), | 267 base::Bind(&VideoCaptureImpl::DidFinishConsumingFrame, frame->metadata(), |
| 270 release_sync_point_storage, | 268 release_sync_point_storage, |
| 271 media::BindToCurrentLoop(base::Bind( | 269 media::BindToCurrentLoop(base::Bind( |
| 272 &VideoCaptureImpl::OnClientBufferFinished, | 270 &VideoCaptureImpl::OnClientBufferFinished, |
| 273 weak_factory_.GetWeakPtr(), buffer_id, buffer)))); | 271 weak_factory_.GetWeakPtr(), buffer_id, buffer)))); |
| 274 | 272 |
| 275 frame->metadata()->MergeInternalValuesFrom(metadata); | 273 frame->metadata()->MergeInternalValuesFrom(metadata); |
| 276 deliver_frame_cb_.Run(frame, timestamp); | 274 deliver_frame_cb_.Run(frame, timestamp); |
| 277 } | 275 } |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 401 void VideoCaptureImpl::ResetClient() { | 399 void VideoCaptureImpl::ResetClient() { |
| 402 client_params_ = media::VideoCaptureParams(); | 400 client_params_ = media::VideoCaptureParams(); |
| 403 state_update_cb_.Reset(); | 401 state_update_cb_.Reset(); |
| 404 deliver_frame_cb_.Reset(); | 402 deliver_frame_cb_.Reset(); |
| 405 first_frame_timestamp_ = base::TimeTicks(); | 403 first_frame_timestamp_ = base::TimeTicks(); |
| 406 device_id_ = kUndefinedDeviceId; | 404 device_id_ = kUndefinedDeviceId; |
| 407 state_ = VIDEO_CAPTURE_STATE_STOPPED; | 405 state_ = VIDEO_CAPTURE_STATE_STOPPED; |
| 408 } | 406 } |
| 409 | 407 |
| 410 } // namespace content | 408 } // namespace content |
| OLD | NEW |