Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

browser(webkit): do not spam stderr with screencast debug logs #4635

Merged
merged 1 commit into from
Dec 8, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions browser_patches/webkit/BUILD_NUMBER
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
1399
Changed: yurys@chromium.org Mon Dec 7 10:04:55 PST 2020
1400
Changed: dgozman@gmail.com Tue Dec 8 09:46:55 PST 2020
17 changes: 8 additions & 9 deletions browser_patches/webkit/patches/bootstrap.diff
Original file line number Diff line number Diff line change
@@ -9818,10 +9818,10 @@ index 0000000000000000000000000000000000000000..0d4a837cbb0bbba71e32ed083a4c4cfe
+} // namespace WebKit
diff --git a/Source/WebKit/UIProcess/Inspector/Agents/ScreencastEncoder.cpp b/Source/WebKit/UIProcess/Inspector/Agents/ScreencastEncoder.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..bc0bca0fcd5fe15d6ace9acb6bd21045633dc0de
index 0000000000000000000000000000000000000000..eca2c4cd9c8d312ad519e312c99f0b0a2435c9eb
--- /dev/null
+++ b/Source/WebKit/UIProcess/Inspector/Agents/ScreencastEncoder.cpp
@@ -0,0 +1,394 @@
@@ -0,0 +1,393 @@
+/*
+ * Copyright (c) 2010, The WebM Project authors. All rights reserved.
+ * Copyright (c) 2013 The Chromium Authors. All rights reserved.
@@ -10048,9 +10048,8 @@ index 0000000000000000000000000000000000000000..bc0bca0fcd5fe15d6ace9acb6bd21045
+ fprintf(stderr, "Failed to write compressed frame\n");
+ return false;
+ }
+ bool keyframe = (pkt->data.frame.flags & VPX_FRAME_IS_KEY) != 0;
+ ++m_frameCount;
+ fprintf(stderr, " #%03d %spts=%" PRId64 " sz=%zd\n", m_frameCount, keyframe ? "[K] " : "", pkt->data.frame.pts, pkt->data.frame.sz);
+ // fprintf(stderr, " #%03d %spts=%" PRId64 " sz=%zd\n", m_frameCount, (pkt->data.frame.flags & VPX_FRAME_IS_KEY) != 0 ? "[K] " : "", pkt->data.frame.pts, pkt->data.frame.sz);
+ m_pts += pkt->data.frame.duration;
+ }
+ }
@@ -10066,7 +10065,7 @@ index 0000000000000000000000000000000000000000..bc0bca0fcd5fe15d6ace9acb6bd21045
+
+ m_writer->finish();
+ fclose(m_file);
+ fprintf(stderr, "ScreencastEncoder::finish %d frames\n", m_frameCount);
+ // fprintf(stderr, "ScreencastEncoder::finish %d frames\n", m_frameCount);
+ }
+
+ Ref<WorkQueue> m_encoderQueue;
@@ -10132,7 +10131,7 @@ index 0000000000000000000000000000000000000000..bc0bca0fcd5fe15d6ace9acb6bd21045
+ }
+
+ std::unique_ptr<VPXCodec> vpxCodec(new VPXCodec(codec, cfg, file));
+ fprintf(stderr, "ScreencastEncoder initialized with: %s\n", vpx_codec_iface_name(codec_interface));
+ // fprintf(stderr, "ScreencastEncoder initialized with: %s\n", vpx_codec_iface_name(codec_interface));
+ return adoptRef(new ScreencastEncoder(WTFMove(vpxCodec), size, scale));
+}
+
@@ -10154,12 +10153,12 @@ index 0000000000000000000000000000000000000000..bc0bca0fcd5fe15d6ace9acb6bd21045
+#if USE(CAIRO)
+void ScreencastEncoder::encodeFrame(cairo_surface_t* drawingAreaSurface, IntSize size)
+{
+ fprintf(stderr, "ScreencastEncoder::encodeFrame\n");
+ // fprintf(stderr, "ScreencastEncoder::encodeFrame\n");
dgozman marked this conversation as resolved.
Show resolved Hide resolved
+ flushLastFrame();
+ // Note that in WPE drawing area size is updated asynchronously and may differ from acutal
+ // size of the surface.
+ if (size.isZero()) {
+ fprintf(stderr, "Cairo surface size is 0\n");
+ // fprintf(stderr, "Cairo surface size is 0\n");
+ return;
+ }
+
@@ -10192,7 +10191,7 @@ index 0000000000000000000000000000000000000000..bc0bca0fcd5fe15d6ace9acb6bd21045
+#elif PLATFORM(MAC)
+void ScreencastEncoder::encodeFrame(RetainPtr<CGImageRef>&& windowImage)
+{
+ fprintf(stderr, "ScreencastEncoder::encodeFrame\n");
+ // fprintf(stderr, "ScreencastEncoder::encodeFrame\n");
+ flushLastFrame();
+
+ m_lastFrame = makeUnique<VPXFrame>(WTFMove(windowImage), m_scale, m_offsetTop);