Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(84)

Side by Side Diff: media/capture/content/screen_capture_device_core.cc

Issue 1865283003: Revert of Tab/Desktop Capture: Use requests instead of timer-based refreshing. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@video_refresh_from_sinks
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "media/capture/content/screen_capture_device_core.h" 5 #include "media/capture/content/screen_capture_device_core.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 oracle_proxy_ = new ThreadSafeCaptureOracle( 58 oracle_proxy_ = new ThreadSafeCaptureOracle(
59 std::move(client), params, capture_machine_->IsAutoThrottlingEnabled()); 59 std::move(client), params, capture_machine_->IsAutoThrottlingEnabled());
60 60
61 capture_machine_->Start( 61 capture_machine_->Start(
62 oracle_proxy_, params, 62 oracle_proxy_, params,
63 base::Bind(&ScreenCaptureDeviceCore::CaptureStarted, AsWeakPtr())); 63 base::Bind(&ScreenCaptureDeviceCore::CaptureStarted, AsWeakPtr()));
64 64
65 TransitionStateTo(kCapturing); 65 TransitionStateTo(kCapturing);
66 } 66 }
67 67
68 void ScreenCaptureDeviceCore::RequestRefreshFrame() {
69 DCHECK(thread_checker_.CalledOnValidThread());
70
71 if (state_ != kCapturing)
72 return;
73
74 if (oracle_proxy_->AttemptPassiveRefresh())
75 return;
76 capture_machine_->MaybeCaptureForRefresh();
77 }
78
79 void ScreenCaptureDeviceCore::StopAndDeAllocate() { 68 void ScreenCaptureDeviceCore::StopAndDeAllocate() {
80 DCHECK(thread_checker_.CalledOnValidThread()); 69 DCHECK(thread_checker_.CalledOnValidThread());
81 70
82 if (state_ != kCapturing) 71 if (state_ != kCapturing)
83 return; 72 return;
84 73
85 oracle_proxy_->Stop(); 74 oracle_proxy_->Stop();
86 oracle_proxy_ = NULL; 75 oracle_proxy_ = NULL;
87 76
88 TransitionStateTo(kIdle); 77 TransitionStateTo(kIdle);
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 return; 123 return;
135 124
136 if (oracle_proxy_.get()) 125 if (oracle_proxy_.get())
137 oracle_proxy_->ReportError(from_here, reason); 126 oracle_proxy_->ReportError(from_here, reason);
138 127
139 StopAndDeAllocate(); 128 StopAndDeAllocate();
140 TransitionStateTo(kError); 129 TransitionStateTo(kError);
141 } 130 }
142 131
143 } // namespace media 132 } // namespace media
OLDNEW
« no previous file with comments | « media/capture/content/screen_capture_device_core.h ('k') | media/capture/content/smooth_event_sampler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698