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..6173bf7ec23c60d79d6e5c9dabbe6cb58c2328fe 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): |
| # 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')) |
| @@ -80,13 +76,15 @@ class VideoRecorder(object): |
| 'kill -SIGINT ' + ' '.join(self._recorder_pids)) |
| self._recorder.wait() |
| - def Pull(self): |
| + def Pull(self, host_file): |
| """Pull resulting video file from the device. |
| - Returns: |
| - Output video file name on the host. |
| + Args: |
| + host_file: Path to the video file to store on the host. |
| """ |
| + host_file_name = host_file or ('screen-recording-%s.mp4' % |
| + self._device.old_interface.GetTimestamp()) |
|
nednguyen
2014/07/08 23:24:20
The original code convert this to abspath. I am no
Satyanarayana N H Manyam
2014/07/09 00:58:02
Done.
|
| + self._device.old_interface.EnsureHostDirectory(self._host_file) |
| self._device.old_interface.PullFileFromDevice( |
| - self._device_file, self._host_file) |
| + self._device_file, host_file_name) |
| self._device.RunShellCommand('rm -f "%s"' % self._device_file) |
| - return self._host_file |