diff options
author | tonyg@chromium.org <tonyg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-10 01:50:08 +0000 |
---|---|---|
committer | tonyg@chromium.org <tonyg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-10 01:50:08 +0000 |
commit | 7733db9d5fca981f3dd1178c4e07ac757e5141bd (patch) | |
tree | 8d8db6484ffef44801e57855777382279fbcc951 /tools/telemetry | |
parent | 64896744845882dd3aaeb850dee0011279659c64 (diff) | |
download | chromium_src-7733db9d5fca981f3dd1178c4e07ac757e5141bd.zip chromium_src-7733db9d5fca981f3dd1178c4e07ac757e5141bd.tar.gz chromium_src-7733db9d5fca981f3dd1178c4e07ac757e5141bd.tar.bz2 |
[Telemetry] Make StartVideoCapture start capturing synchronously.
Previously it just asynchronously started capture.
BUG=323813
R=bulach@chromium.org, skyostil@chromium.org
Review URL: https://codereview.chromium.org/109553002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@239640 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/telemetry')
-rw-r--r-- | tools/telemetry/telemetry/core/platform/android_platform_backend.py | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/tools/telemetry/telemetry/core/platform/android_platform_backend.py b/tools/telemetry/telemetry/core/platform/android_platform_backend.py index d753372..a0f8229 100644 --- a/tools/telemetry/telemetry/core/platform/android_platform_backend.py +++ b/tools/telemetry/telemetry/core/platform/android_platform_backend.py @@ -3,7 +3,6 @@ # found in the LICENSE file. import logging -import os import subprocess import tempfile @@ -15,6 +14,7 @@ from telemetry.core.platform import proc_supporting_platform_backend # Get build/android scripts into our path. util.AddDirToPythonPath(util.GetChromiumSrcDir(), 'build', 'android') +from pylib import screenshot # pylint: disable=F0401 from pylib.perf import cache_control # pylint: disable=F0401 from pylib.perf import perf_control # pylint: disable=F0401 from pylib.perf import thermal_throttle # pylint: disable=F0401 @@ -190,18 +190,16 @@ class AndroidPlatformBackend( raise ValueError('Android video capture cannot capture at %dmbps. ' 'Max capture rate is 100mbps.' % min_bitrate_mbps) self._video_output = tempfile.mkstemp()[1] - self._video_recorder = subprocess.Popen( - [os.path.join(util.GetChromiumSrcDir(), 'build', 'android', - 'screenshot.py'), - '--video', '--bitrate', str(min_bitrate_mbps), '--file', - self._video_output], stdin=subprocess.PIPE, stdout=subprocess.PIPE) + self._video_recorder = screenshot.VideoRecorder( + self._adb, self._video_output, megabits_per_second=min_bitrate_mbps) + self._video_recorder.Start() + util.WaitFor(self._video_recorder.IsStarted, 5) def StopVideoCapture(self): assert self._video_recorder, 'Must start video capture first' - self._video_recorder.communicate(input='\n') - self._video_recorder.wait() + self._video_recorder.Stop() + self._video_output = self._video_recorder.Pull() self._video_recorder = None - for frame in self._FramesFromMp4(self._video_output): yield frame |