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

Unified Diff: media/capture/content/android/screen_capture_machine_android.cc

Issue 2364413002: Screen Video Capture: Implement suspend optimization. (Closed)
Patch Set: Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: media/capture/content/android/screen_capture_machine_android.cc
diff --git a/media/capture/content/android/screen_capture_machine_android.cc b/media/capture/content/android/screen_capture_machine_android.cc
index f3b2ee90970949b4efd9156143c4c424757d8f7d..69c8906c4f1c94b1c48aa5de1bcedcbaa22e72b9 100644
--- a/media/capture/content/android/screen_capture_machine_android.cc
+++ b/media/capture/content/android/screen_capture_machine_android.cc
@@ -21,7 +21,8 @@ bool ScreenCaptureMachineAndroid::RegisterScreenCaptureMachine(JNIEnv* env) {
return RegisterNativesImpl(env);
}
-ScreenCaptureMachineAndroid::ScreenCaptureMachineAndroid() {}
+ScreenCaptureMachineAndroid::ScreenCaptureMachineAndroid()
+ : suspend_frame_capture_(false) {}
ScreenCaptureMachineAndroid::~ScreenCaptureMachineAndroid() {}
@@ -43,6 +44,9 @@ void ScreenCaptureMachineAndroid::OnRGBAFrameAvailable(JNIEnv* env,
jint width,
jint height,
jlong timestamp) {
+ if (suspend_frame_capture_)
+ return;
+
const VideoCaptureOracle::Event event = VideoCaptureOracle::kCompositorUpdate;
const uint64_t absolute_micro =
timestamp / base::Time::kNanosecondsPerMicrosecond;
@@ -118,6 +122,9 @@ void ScreenCaptureMachineAndroid::OnI420FrameAvailable(JNIEnv* env,
jint width,
jint height,
jlong timestamp) {
+ if (suspend_frame_capture_)
+ return;
+
const VideoCaptureOracle::Event event = VideoCaptureOracle::kCompositorUpdate;
const uint64_t absolute_micro =
timestamp / base::Time::kNanosecondsPerMicrosecond;

Powered by Google App Engine
This is Rietveld 408576698