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 // Implementation notes: This needs to work on a variety of hardware | 5 // Implementation notes: This needs to work on a variety of hardware |
6 // configurations where the speed of the CPU and GPU greatly affect overall | 6 // configurations where the speed of the CPU and GPU greatly affect overall |
7 // performance. Spanning several threads, the process of capturing has been | 7 // performance. Spanning several threads, the process of capturing has been |
8 // split up into four conceptual stages: | 8 // split up into four conceptual stages: |
9 // | 9 // |
10 // 1. Reserve Buffer: Before a frame can be captured, a slot in the consumer's | 10 // 1. Reserve Buffer: Before a frame can be captured, a slot in the consumer's |
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
522 is_started_ = false; | 522 is_started_ = false; |
523 consumer_ = NULL; | 523 consumer_ = NULL; |
524 } | 524 } |
525 | 525 |
526 void CaptureOracle::DidCaptureFrame( | 526 void CaptureOracle::DidCaptureFrame( |
527 const scoped_refptr<media::VideoFrame>& frame, | 527 const scoped_refptr<media::VideoFrame>& frame, |
528 base::Time timestamp, | 528 base::Time timestamp, |
529 bool success) { | 529 bool success) { |
530 base::AutoLock guard(lock_); | 530 base::AutoLock guard(lock_); |
531 | 531 |
532 TRACE_EVENT_ASYNC_END1("mirroring", "Capture", frame.get(), | 532 TRACE_EVENT_ASYNC_END2("mirroring", "Capture", frame.get(), |
533 "success", success); | 533 "success", success, |
| 534 "timestamp", timestamp.ToInternalValue()); |
534 | 535 |
535 if (!consumer_ || !is_started_) | 536 if (!consumer_ || !is_started_) |
536 return; // Capture is stopped. | 537 return; // Capture is stopped. |
537 | 538 |
538 if (success) | 539 if (success) |
539 consumer_->OnIncomingCapturedVideoFrame(frame, timestamp); | 540 consumer_->OnIncomingCapturedVideoFrame(frame, timestamp); |
540 } | 541 } |
541 | 542 |
542 bool FrameSubscriber::ShouldCaptureFrame( | 543 bool FrameSubscriber::ShouldCaptureFrame( |
543 scoped_refptr<media::VideoFrame>* storage, | 544 scoped_refptr<media::VideoFrame>* storage, |
(...skipping 774 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1318 return false; | 1319 return false; |
1319 else | 1320 else |
1320 return true; | 1321 return true; |
1321 } | 1322 } |
1322 | 1323 |
1323 base::Time SmoothEventSampler::GetLastSampledEvent() { | 1324 base::Time SmoothEventSampler::GetLastSampledEvent() { |
1324 return last_sample_; | 1325 return last_sample_; |
1325 } | 1326 } |
1326 | 1327 |
1327 } // namespace content | 1328 } // namespace content |
OLD | NEW |