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

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

Issue 109553002: [Telemetry] Make StartVideoCapture start capturing synchronously. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: skyostil comments 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
« no previous file with comments | « build/android/screenshot.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/core/platform/android_platform_backend.py
diff --git a/tools/telemetry/telemetry/core/platform/android_platform_backend.py b/tools/telemetry/telemetry/core/platform/android_platform_backend.py
index d753372599c73b6968ee517e4574581b6cdc37ca..a0f82299564a55b3fdb717e2bf233744918767e6 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
« no previous file with comments | « build/android/screenshot.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698