Package com.arthenica.ffmpegkit
Interface Session
-
- All Known Implementing Classes:
AbstractSession
,FFmpegSession
,FFprobeSession
,MediaInformationSession
public interface Session
Common interface for all
FFmpegKit
sessions.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addLog(Log log)
Adds a new log entry for this session.void
cancel()
Cancels running the session.java.util.List<Log>
getAllLogs()
Returns all log entries generated for this session.java.util.List<Log>
getAllLogs(int waitTimeout)
Returns all log entries generated for this session.java.lang.String
getAllLogsAsString()
Returns all log entries generated for this session as a concatenated string.java.lang.String
getAllLogsAsString(int waitTimeout)
Returns all log entries generated for this session as a concatenated string.java.lang.String[]
getArguments()
Returns command arguments as an array.java.lang.String
getCommand()
Returns command arguments as a concatenated string.java.util.Date
getCreateTime()
Returns session create time.long
getDuration()
Returns the time taken to execute this session.java.util.Date
getEndTime()
Returns session end time.ExecuteCallback
getExecuteCallback()
Returns the session specific execute callback function.java.lang.String
getFailStackTrace()
Returns the stack trace of the exception received while executing this session.java.util.concurrent.Future<?>
getFuture()
Returns the future created for this session, if it is executed asynchronously.LogCallback
getLogCallback()
Returns the session specific log callback function.LogRedirectionStrategy
getLogRedirectionStrategy()
Returns session specific log redirection strategy.java.util.List<Log>
getLogs()
Returns all log entries delivered for this session.java.lang.String
getLogsAsString()
Returns all log entries delivered for this session as a concatenated string.java.lang.String
getOutput()
Returns the log output generated while running the session.ReturnCode
getReturnCode()
Returns the return code for this session.long
getSessionId()
Returns the session identifier.java.util.Date
getStartTime()
Returns session start time.SessionState
getState()
Returns the state of the session.boolean
isFFmpeg()
Returns whether it is anFFmpeg
session or not.boolean
isFFprobe()
Returns whether it is anFFprobe
session or not.boolean
thereAreAsynchronousMessagesInTransmit()
Returns whether there are still asynchronous messages being transmitted for this session or not.
-
-
-
Method Detail
-
getExecuteCallback
ExecuteCallback getExecuteCallback()
Returns the session specific execute callback function.- Returns:
- session specific execute callback function
-
getLogCallback
LogCallback getLogCallback()
Returns the session specific log callback function.- Returns:
- session specific log callback function
-
getSessionId
long getSessionId()
Returns the session identifier.- Returns:
- session identifier
-
getCreateTime
java.util.Date getCreateTime()
Returns session create time.- Returns:
- session create time
-
getStartTime
java.util.Date getStartTime()
Returns session start time.- Returns:
- session start time
-
getEndTime
java.util.Date getEndTime()
Returns session end time.- Returns:
- session end time
-
getDuration
long getDuration()
Returns the time taken to execute this session.- Returns:
- time taken to execute this session in milliseconds or zero (0) if the session is not over yet
-
getArguments
java.lang.String[] getArguments()
Returns command arguments as an array.- Returns:
- command arguments as an array
-
getCommand
java.lang.String getCommand()
Returns command arguments as a concatenated string.- Returns:
- command arguments as a concatenated string
-
getAllLogs
java.util.List<Log> getAllLogs(int waitTimeout)
Returns all log entries generated for this session. If there are asynchronous messages that are not delivered yet, this method waits for them until the given timeout.- Parameters:
waitTimeout
- wait timeout for asynchronous messages in milliseconds- Returns:
- list of log entries generated for this session
-
getAllLogs
java.util.List<Log> getAllLogs()
Returns all log entries generated for this session. If there are asynchronous messages that are not delivered yet, this method waits for them.- Returns:
- list of log entries generated for this session
-
getLogs
java.util.List<Log> getLogs()
Returns all log entries delivered for this session. Note that if there are asynchronous log messages that are not delivered yet, this method will not wait for them and will return immediately.- Returns:
- list of log entries received for this session
-
getAllLogsAsString
java.lang.String getAllLogsAsString(int waitTimeout)
Returns all log entries generated for this session as a concatenated string. If there are asynchronous messages that are not delivered yet, this method waits for them until the given timeout.- Parameters:
waitTimeout
- wait timeout for asynchronous messages in milliseconds- Returns:
- all log entries generated for this session as a concatenated string
-
getAllLogsAsString
java.lang.String getAllLogsAsString()
Returns all log entries generated for this session as a concatenated string. If there are asynchronous messages that are not delivered yet, this method waits for them.- Returns:
- all log entries generated for this session as a concatenated string
-
getLogsAsString
java.lang.String getLogsAsString()
Returns all log entries delivered for this session as a concatenated string. Note that if there are asynchronous log messages that are not delivered yet, this method will not wait for them and will return immediately.- Returns:
- list of log entries received for this session
-
getOutput
java.lang.String getOutput()
Returns the log output generated while running the session.- Returns:
- log output generated
-
getState
SessionState getState()
Returns the state of the session.- Returns:
- state of the session
-
getReturnCode
ReturnCode getReturnCode()
Returns the return code for this session. Note that return code is only set for sessions that end with COMPLETED state. If a session is not started, still running or failed then this method returns null.- Returns:
- the return code for this session if the session is COMPLETED, null if session is not started, still running or failed
-
getFailStackTrace
java.lang.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 has COMPLETED state this method returns null.
- Returns:
- stack trace of the exception received while executing this session, null if session is not started, still running or completed
-
getLogRedirectionStrategy
LogRedirectionStrategy getLogRedirectionStrategy()
Returns session specific log redirection strategy.- Returns:
- session specific log redirection strategy
-
thereAreAsynchronousMessagesInTransmit
boolean thereAreAsynchronousMessagesInTransmit()
Returns whether there are still asynchronous messages being transmitted for this session or not.- Returns:
- true if there are still asynchronous messages being transmitted, false otherwise
-
addLog
void addLog(Log log)
Adds a new log entry for this session.- Parameters:
log
- log entry
-
getFuture
java.util.concurrent.Future<?> getFuture()
Returns the future created for this session, if it is executed asynchronously.- Returns:
- future that runs this session asynchronously
-
isFFmpeg
boolean isFFmpeg()
Returns whether it is anFFmpeg
session or not.- Returns:
- true if it is an
FFmpeg
session, false otherwise
-
isFFprobe
boolean isFFprobe()
Returns whether it is anFFprobe
session or not.- Returns:
- true if it is an
FFprobe
session, false otherwise
-
cancel
void cancel()
Cancels running the session.
-
-