Advertisement
Guest User

Untitled

a guest
Jun 27th, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. @Override
  2. public Result doWork() {
  3. shellCommand = new ShellCommand();
  4. ffmpegBinary = new String[] {
  5. FileUtils.getFFmpeg(context).getAbsolutePath()
  6. };
  7. command = concatenate(ffmpegBinary, command);
  8. CommandResult commandResult = getCommandResult(command);
  9. if (command`enter code here`Result.success) {
  10. onSuccess(videoPath);
  11. } else {
  12. onFailure(videoPath);
  13. }
  14. }
  15. //getCommandResult
  16. private CommandResult getCommandResult(String[] command) {
  17. try {
  18. process = shellCommand.run(command, null);
  19.  
  20. if (process == null) {
  21. return CommandResult.getDummyFailureResponse();
  22. }
  23. checkAndUpdateProcess();
  24. return CommandResult.getOutputFromProcess(process);
  25. } catch(Exception e) {} finally {
  26. Util.destroyProcess(process);
  27. }`enter code here`
  28. return CommandResult.getDummyFailureResponse();
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement