Package 

Class AbstractSession

  • All Implemented Interfaces:
    com.arthenica.ffmpegkit.Session

    
    public abstract class AbstractSession
     implements Session
                        

    Abstract session implementation which includes common features shared by FFmpeg, FFprobe and MediaInformation sessions.

    • Method Detail

      • getSessionId

         long getSessionId()

        Returns the session identifier.

      • getLogs

         List<Log> getLogs()

        Returns all log entries delivered for this session. Note that if there are asynchronous logmessages that are not delivered yet, this method will not wait for them and will returnimmediately.

      • getFuture

         Future<out Object> getFuture()

        Returns the future created for this session, if it is executed asynchronously.

      • setFuture

         void setFuture(Future<out Object> future)

        Sets the future created for this session.

        Parameters:
        future - future that runs this session asynchronously
      • getReturnCode

         ReturnCode getReturnCode()

        Returns the return code for this session. Note that return code is only set for sessionsthat end with COMPLETED state. If a session is not started, still running or failed thenthis method returns null.

      • getFailStackTrace

         String getFailStackTrace()

        Returns the stack trace of the exception received while executing this session.

        The stack trace is only set for sessions that end with FAILED state. For sessions that hasCOMPLETED state this method returns null.

      • getDuration

         long getDuration()

        Returns the time taken to execute this session.

      • getCommand

         String getCommand()

        Returns command arguments as a concatenated string.

      • getAllLogs

         List<Log> getAllLogs(int waitTimeout)

        Returns all log entries generated for this session. If there are asynchronousmessages that are not delivered yet, this method waits for them until the given timeout.

        Parameters:
        waitTimeout - wait timeout for asynchronous messages in milliseconds
      • getAllLogsAsString

         String getAllLogsAsString(int waitTimeout)

        Returns all log entries generated for this session as a concatenated string. If there areasynchronous messages that are not delivered yet, this method waits for them untilthe given timeout.

        Parameters:
        waitTimeout - wait timeout for asynchronous messages in milliseconds
      • getLogsAsString

         String getLogsAsString()

        Returns all log entries delivered for this session as a concatenated string. Note that ifthere are asynchronous log messages that are not delivered yet, this method will not waitfor them and will return immediately.

      • getOutput

         String getOutput()

        Returns the log output generated while running the session.

      • addLog

         void addLog(Log log)

        Adds a new log entry for this session.

        It is invoked internally by FFmpegKit library methods. Must not be used by userapplications.

        Parameters:
        log - log entry
      • cancel

         void cancel()

        Cancels running the session.