Search in sources :

Example 1 with ScreenRecorderOptions

use of com.android.ddmlib.ScreenRecorderOptions in project android by JetBrains.

the class ScreenRecorderAction method performAction.

public void performAction() {
    final ScreenRecorderOptionsDialog dialog = new ScreenRecorderOptionsDialog(myProject);
    if (!dialog.showAndGet()) {
        return;
    }
    final ScreenRecorderOptions options = dialog.getOptions();
    final CountDownLatch latch = new CountDownLatch(1);
    final CollectingOutputReceiver receiver = new CollectingOutputReceiver(latch);
    ApplicationManager.getApplication().executeOnPooledThread(new Runnable() {

        @Override
        public void run() {
            try {
                myDevice.startScreenRecorder(REMOTE_PATH, options, receiver);
            } catch (Exception e) {
                showError(myProject, "Unexpected error while launching screen recorder", e);
                latch.countDown();
            }
        }
    });
    Task.Modal screenRecorderShellTask = new ScreenRecorderTask(myProject, myDevice, latch, receiver);
    screenRecorderShellTask.setCancelText("Stop Recording");
    screenRecorderShellTask.queue();
}
Also used : ScreenRecorderOptions(com.android.ddmlib.ScreenRecorderOptions) Task(com.intellij.openapi.progress.Task) CollectingOutputReceiver(com.android.ddmlib.CollectingOutputReceiver) CountDownLatch(java.util.concurrent.CountDownLatch)

Aggregations

CollectingOutputReceiver (com.android.ddmlib.CollectingOutputReceiver)1 ScreenRecorderOptions (com.android.ddmlib.ScreenRecorderOptions)1 Task (com.intellij.openapi.progress.Task)1 CountDownLatch (java.util.concurrent.CountDownLatch)1