接口 Session
-
public interface SessionCommon interface for all
FFmpegKitsessions.
-
-
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 voidaddLog(Log log)Adds a new log entry for this session.voidcancel()Cancels running the session.List<Log>getAllLogs()Returns all log entries generated for this session.List<Log>getAllLogs(int waitTimeout)Returns all log entries generated for this session.StringgetAllLogsAsString()Returns all log entries generated for this session as a concatenated string.StringgetAllLogsAsString(int waitTimeout)Returns all log entries generated for this session as a concatenated string.String[]getArguments()Returns command arguments as an array.StringgetCommand()Returns command arguments as a concatenated string.DategetCreateTime()Returns session create time.longgetDuration()Returns the time taken to execute this session.DategetEndTime()Returns session end time.StringgetFailStackTrace()Returns the stack trace of the exception received while executing this session.Future<?>getFuture()Returns the future created for this session, if it is executed asynchronously.LogCallbackgetLogCallback()Returns the session specific log callback.LogRedirectionStrategygetLogRedirectionStrategy()Returns session specific log redirection strategy.List<Log>getLogs()Returns all log entries delivered for this session.StringgetLogsAsString()Returns all log entries delivered for this session as a concatenated string.StringgetOutput()Returns the log output generated while running the session.ReturnCodegetReturnCode()Returns the return code for this session.longgetSessionId()Returns the session identifier.DategetStartTime()Returns session start time.SessionStategetState()Returns the state of the session.booleanisFFmpeg()Returns whether it is anFFmpegsession or not.booleanisFFprobe()Returns whether it is anFFprobesession or not.booleanisMediaInformation()Returns whether it is aMediaInformationsession or not.booleanthereAreAsynchronousMessagesInTransmit()Returns whether there are still asynchronous messages being transmitted for this session or not.
-
-
-
方法详细资料
-
getLogCallback
LogCallback getLogCallback()
Returns the session specific log callback.- 返回:
- session specific log callback
-
getSessionId
long getSessionId()
Returns the session identifier.- 返回:
- session identifier
-
getCreateTime
Date getCreateTime()
Returns session create time.- 返回:
- session create time
-
getStartTime
Date getStartTime()
Returns session start time.- 返回:
- session start time
-
getEndTime
Date getEndTime()
Returns session end time.- 返回:
- session end time
-
getDuration
long getDuration()
Returns the time taken to execute this session.- 返回:
- time taken to execute this session in milliseconds or zero (0) if the session is not over yet
-
getArguments
String[] getArguments()
Returns command arguments as an array.- 返回:
- command arguments as an array
-
getCommand
String getCommand()
Returns command arguments as a concatenated string.- 返回:
- command arguments as a concatenated string
-
getAllLogs
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.- 参数:
waitTimeout- wait timeout for asynchronous messages in milliseconds- 返回:
- list of log entries generated for this session
-
getAllLogs
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.- 返回:
- list of log entries generated for this session
-
getLogs
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.- 返回:
- list of log entries received for this session
-
getAllLogsAsString
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.- 参数:
waitTimeout- wait timeout for asynchronous messages in milliseconds- 返回:
- all log entries generated for this session as a concatenated string
-
getAllLogsAsString
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.- 返回:
- all log entries generated for this session as a concatenated string
-
getLogsAsString
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.- 返回:
- list of log entries received for this session
-
getOutput
String getOutput()
Returns the log output generated while running the session.- 返回:
- log output generated
-
getState
SessionState getState()
Returns the state of the session.- 返回:
- 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.- 返回:
- the return code for this session if the session is COMPLETED, null if session is not started, still running or failed
-
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 has COMPLETED state this method returns null.
- 返回:
- 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.- 返回:
- session specific log redirection strategy
-
thereAreAsynchronousMessagesInTransmit
boolean thereAreAsynchronousMessagesInTransmit()
Returns whether there are still asynchronous messages being transmitted for this session or not.- 返回:
- true if there are still asynchronous messages being transmitted, false otherwise
-
addLog
void addLog(Log log)
Adds a new log entry for this session.It is invoked internally by
FFmpegKitlibrary methods. Must not be used by user applications.- 参数:
log- log entry
-
getFuture
Future<?> getFuture()
Returns the future created for this session, if it is executed asynchronously.- 返回:
- future that runs this session asynchronously
-
isFFmpeg
boolean isFFmpeg()
Returns whether it is anFFmpegsession or not.- 返回:
- true if it is an
FFmpegsession, false otherwise
-
isFFprobe
boolean isFFprobe()
Returns whether it is anFFprobesession or not.- 返回:
- true if it is an
FFprobesession, false otherwise
-
isMediaInformation
boolean isMediaInformation()
Returns whether it is aMediaInformationsession or not.- 返回:
- true if it is a
MediaInformationsession, false otherwise
-
cancel
void cancel()
Cancels running the session.
-
-