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

Unified Diff: tools/telemetry/telemetry/core/platform/__init__.py

Issue 93733002: [Telemetry] Refactoring in preparation for video-based Speed Index support. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix lint Created 7 years 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: tools/telemetry/telemetry/core/platform/__init__.py
diff --git a/tools/telemetry/telemetry/core/platform/__init__.py b/tools/telemetry/telemetry/core/platform/__init__.py
index ad5909ce77f453b1f10f63ad35ea04bcc5a6810e..338d4e5b41e91566d2ec62896ccdcd4534df6001 100644
--- a/tools/telemetry/telemetry/core/platform/__init__.py
+++ b/tools/telemetry/telemetry/core/platform/__init__.py
@@ -128,6 +128,37 @@ class Platform(object):
"""Installs the given application."""
return self._platform_backend.InstallApplication(application)
+ def CanCaptureVideo(self):
+ """Returns a bool indicating whether the platform supports video capture."""
+ return self._platform_backend.CanCaptureVideo()
+
+ def StartVideoCapture(self, min_bitrate_mbps):
+ """Starts capturing video.
+
+ Outer framing may be included (from the OS, browser window, and webcam).
+
+ Args:
+ min_bitrate_mbps: The minimum capture bitrate in MegaBits Per Second.
+ The platform is free to deliver a higher bitrate if it can do so
+ without increasing overhead.
+
+ Raises:
+ ValueError if the required |min_bitrate_mbps| can't be achieved.
+ """
+ return self._platform_backend.StartVideoCapture(min_bitrate_mbps)
+
+ def StopVideoCapture(self):
+ """Stops capturing video.
+
+ Yields:
+ (time_ms, bitmap) tuples representing each video keyframe. Only the first
+ frame in a run of sequential duplicate bitmaps is included.
+ time_ms is milliseconds relative to the first frame.
+ bitmap is a telemetry.core.backends.png_bitmap.
+ """
+ for t in self._platform_backend.StopVideoCapture():
+ yield t
+
def CreatePlatformBackendForCurrentOS():
if sys.platform.startswith('linux'):

Powered by Google App Engine
This is Rietveld 408576698