Chromium Code Reviews| Index: build/android/pylib/screenshot.py |
| diff --git a/build/android/pylib/screenshot.py b/build/android/pylib/screenshot.py |
| index a09bc3d0a130261a08828b875a90ee798e7bb569..a5ca1a55d60ba57f3987f5d9485982d1f4e9d933 100644 |
| --- a/build/android/pylib/screenshot.py |
| +++ b/build/android/pylib/screenshot.py |
| @@ -24,7 +24,7 @@ class VideoRecorder(object): |
| default. |
| rotate: If True, the video will be rotated 90 degrees. |
| """ |
| - def __init__(self, device, host_file, megabits_per_second=4, size=None, |
| + def __init__(self, device, megabits_per_second=4, size=None, |
| rotate=False): |
|
nednguyen
2014/07/08 22:28:12
There are other place that specifies the host_file
nduca
2014/07/08 22:34:21
or update the other callsites to use the new pull
Satyanarayana N H Manyam
2014/07/08 22:46:41
Ok added the parameter to the Pull then.
|
| # TODO(jbudorick) Remove once telemetry gets switched over. |
| if isinstance(device, pylib.android_commands.AndroidCommands): |
| @@ -32,9 +32,6 @@ class VideoRecorder(object): |
| self._device = device |
| self._device_file = ( |
| '%s/screen-recording.mp4' % device.GetExternalStoragePath()) |
| - self._host_file = host_file or ('screen-recording-%s.mp4' % |
| - device.old_interface.GetTimestamp()) |
| - self._host_file = os.path.abspath(self._host_file) |
| self._recorder = None |
| self._recorder_pids = None |
| self._recorder_stdout = None |
| @@ -53,7 +50,6 @@ class VideoRecorder(object): |
| def Start(self): |
| """Start recording video.""" |
| - self._device.old_interface.EnsureHostDirectory(self._host_file) |
| self._recorder_stdout = tempfile.mkstemp()[1] |
| self._recorder = cmd_helper.Popen( |
| self._args, stdout=open(self._recorder_stdout, 'w')) |
| @@ -84,9 +80,12 @@ class VideoRecorder(object): |
| """Pull resulting video file from the device. |
| Returns: |
| - Output video file name on the host. |
| + Output video file object on the host. |
|
nduca
2014/07/08 22:34:21
NamedTemporaryFile containing the video, on the ho
Satyanarayana N H Manyam
2014/07/08 22:57:27
Updated the code a bit
|
| """ |
| + host_file_obj = tempfile.NamedTemporaryFile( |
| + suffix='screen-recording-%s.mp4' % ( |
| + self._device.old_interface.GetTimestamp())) |
| self._device.old_interface.PullFileFromDevice( |
| - self._device_file, self._host_file) |
| + self._device_file, host_file_obj.name) |
| self._device.RunShellCommand('rm -f "%s"' % self._device_file) |
| - return self._host_file |
| + return host_file_obj |