@@ -8325,10 +8325,10 @@ index b0722e7da81e56530deb570b82ed7cfece970362..1d1463231269363939e4c746a6dada5e
8325
8325
}
8326
8326
diff --git a/Source/WebKit/UIProcess/Inspector/Agents/InspectorScreencastAgent.cpp b/Source/WebKit/UIProcess/Inspector/Agents/InspectorScreencastAgent.cpp
8327
8327
new file mode 100644
8328
- index 0000000000000000000000000000000000000000..3f091aa8ea5e44980f2ea62e26ab860697c6a066
8328
+ index 0000000000000000000000000000000000000000..de9e93e295e3af981965f9fd85f7f89e9da8d390
8329
8329
--- /dev/null
8330
8330
+++ b/Source/WebKit/UIProcess/Inspector/Agents/InspectorScreencastAgent.cpp
8331
- @@ -0,0 +1,166 @@
8331
+ @@ -0,0 +1,163 @@
8332
8332
+/*
8333
8333
+ * Copyright (C) 2020 Microsoft Corporation.
8334
8334
+ *
@@ -8363,6 +8363,7 @@ index 0000000000000000000000000000000000000000..3f091aa8ea5e44980f2ea62e26ab8606
8363
8363
+#include <JavaScriptCore/InspectorFrontendDispatchers.h>
8364
8364
+#include <JavaScriptCore/InspectorFrontendRouter.h>
8365
8365
+#include <WebCore/NotImplemented.h>
8366
+ +#include <wtf/RunLoop.h>
8366
8367
+
8367
8368
+#if USE(CAIRO)
8368
8369
+#include "DrawingAreaProxy.h"
@@ -8474,15 +8475,11 @@ index 0000000000000000000000000000000000000000..3f091aa8ea5e44980f2ea62e26ab8606
8474
8475
+ if (!m_encoder)
8475
8476
+ return;
8476
8477
+
8477
- + m_page.callAfterNextPresentationUpdate( [agent = makeWeakPtr(this)](CallbackBase::Error error ) mutable {
8478
+ + RunLoop::main().dispatchAfter(Seconds(1.0 / 24), [agent = makeWeakPtr(this)]() mutable {
8478
8479
+ if (!agent)
8479
8480
+ return;
8480
8481
+
8481
- + if (error == CallbackBase::Error::None) {
8482
- + agent->encodeFrame();
8483
- + } else {
8484
- + fprintf(stderr, "callAfterNextPresentationUpdate failed error= %d\n", error);
8485
- + }
8482
+ + agent->encodeFrame();
8486
8483
+ agent->scheduleFrameEncoding();
8487
8484
+ });
8488
8485
+}
@@ -8582,10 +8579,10 @@ index 0000000000000000000000000000000000000000..003ad364d76071ce30d11cce7d1b61a6
8582
8579
+} // namespace WebKit
8583
8580
diff --git a/Source/WebKit/UIProcess/Inspector/Agents/ScreencastEncoder.cpp b/Source/WebKit/UIProcess/Inspector/Agents/ScreencastEncoder.cpp
8584
8581
new file mode 100644
8585
- index 0000000000000000000000000000000000000000..d92957ee6d2b7ebf14eeb5c7206ea78b36927749
8582
+ index 0000000000000000000000000000000000000000..9bef1bb85b02342ca8fd8129b80d7f540189dfbe
8586
8583
--- /dev/null
8587
8584
+++ b/Source/WebKit/UIProcess/Inspector/Agents/ScreencastEncoder.cpp
8588
- @@ -0,0 +1,381 @@
8585
+ @@ -0,0 +1,378 @@
8589
8586
+/*
8590
8587
+ * Copyright (c) 2010, The WebM Project authors. All rights reserved.
8591
8588
+ * Copyright (c) 2013 The Chromium Authors. All rights reserved.
@@ -8766,10 +8763,7 @@ index 0000000000000000000000000000000000000000..d92957ee6d2b7ebf14eeb5c7206ea78b
8766
8763
+ {
8767
8764
+ m_encoderQueue->dispatch([this, frame = WTFMove(frame)] {
8768
8765
+ frame->convertToVpxImage(m_image.get());
8769
- + // TODO: figure out why passing duration to the codec results in much
8770
- + // worse visual quality and makes video stutter.
8771
- + for (int i = 0; i < frame->duration(); i++)
8772
- + encodeFrame(m_image.get(), 1);
8766
+ + encodeFrame(m_image.get(), frame->duration());
8773
8767
+ });
8774
8768
+ }
8775
8769
+
0 commit comments