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 #include "content/browser/media/capture/web_contents_video_capture_device.h" | 5 #include "content/browser/media/capture/web_contents_video_capture_device.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <memory> | 10 #include <memory> |
(...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
657 if (!view) { | 657 if (!view) { |
658 DVLOG(1) << "Cannot renew subscription: No view to capture."; | 658 DVLOG(1) << "Cannot renew subscription: No view to capture."; |
659 return; | 659 return; |
660 } | 660 } |
661 | 661 |
662 DVLOG(1) << "Renewing subscription to RenderWidgetHostView@" << view; | 662 DVLOG(1) << "Renewing subscription to RenderWidgetHostView@" << view; |
663 subscription_.reset(new ContentCaptureSubscription( | 663 subscription_.reset(new ContentCaptureSubscription( |
664 view->GetWeakPtr(), oracle_proxy_, | 664 view->GetWeakPtr(), oracle_proxy_, |
665 base::Bind(&WebContentsCaptureMachine::Capture, | 665 base::Bind(&WebContentsCaptureMachine::Capture, |
666 weak_ptr_factory_.GetWeakPtr()))); | 666 weak_ptr_factory_.GetWeakPtr()))); |
| 667 // Capture a refresh frame immediately to make sure the latest frame in the |
| 668 // video stream has the correct content. |
| 669 subscription_->MaybeCaptureForRefresh(); |
667 } | 670 } |
668 | 671 |
669 void WebContentsCaptureMachine::UpdateCaptureSize() { | 672 void WebContentsCaptureMachine::UpdateCaptureSize() { |
670 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 673 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
671 | 674 |
672 if (!oracle_proxy_) | 675 if (!oracle_proxy_) |
673 return; | 676 return; |
674 RenderWidgetHostView* const view = tracker_->GetTargetView(); | 677 RenderWidgetHostView* const view = tracker_->GetTargetView(); |
675 if (!view) | 678 if (!view) |
676 return; | 679 return; |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
741 void WebContentsVideoCaptureDevice::StopAndDeAllocate() { | 744 void WebContentsVideoCaptureDevice::StopAndDeAllocate() { |
742 core_->StopAndDeAllocate(); | 745 core_->StopAndDeAllocate(); |
743 } | 746 } |
744 | 747 |
745 void WebContentsVideoCaptureDevice::OnUtilizationReport(int frame_feedback_id, | 748 void WebContentsVideoCaptureDevice::OnUtilizationReport(int frame_feedback_id, |
746 double utilization) { | 749 double utilization) { |
747 core_->OnConsumerReportingUtilization(frame_feedback_id, utilization); | 750 core_->OnConsumerReportingUtilization(frame_feedback_id, utilization); |
748 } | 751 } |
749 | 752 |
750 } // namespace content | 753 } // namespace content |
OLD | NEW |