![]() |
FFmpegKit Linux API 5.1
|
#include <AbstractSession.h>
Public Member Functions | |
AbstractSession (const std::list< std::string > &arguments, const ffmpegkit::LogCallback logCallback, const LogRedirectionStrategy logRedirectionStrategy) | |
void | waitForAsynchronousMessagesInTransmit (const int timeout) const |
ffmpegkit::LogCallback | getLogCallback () const override |
long | getSessionId () const override |
std::chrono::time_point< std::chrono::system_clock > | getCreateTime () const override |
std::chrono::time_point< std::chrono::system_clock > | getStartTime () const override |
std::chrono::time_point< std::chrono::system_clock > | getEndTime () const override |
long | getDuration () const override |
std::shared_ptr< std::list< std::string > > | getArguments () const override |
std::string | getCommand () const override |
std::shared_ptr< std::list< std::shared_ptr< ffmpegkit::Log > > > | getAllLogsWithTimeout (const int waitTimeout) const override |
std::shared_ptr< std::list< std::shared_ptr< ffmpegkit::Log > > > | getAllLogs () const override |
std::shared_ptr< std::list< std::shared_ptr< ffmpegkit::Log > > > | getLogs () const override |
std::string | getAllLogsAsStringWithTimeout (const int waitTimeout) const override |
std::string | getAllLogsAsString () const override |
std::string | getLogsAsString () const override |
std::string | getOutput () const override |
ffmpegkit::SessionState | getState () const override |
std::shared_ptr< ffmpegkit::ReturnCode > | getReturnCode () const override |
std::string | getFailStackTrace () const override |
ffmpegkit::LogRedirectionStrategy | getLogRedirectionStrategy () const override |
bool | thereAreAsynchronousMessagesInTransmit () const override |
void | addLog (const std::shared_ptr< ffmpegkit::Log > log) override |
void | startRunning () override |
void | complete (const std::shared_ptr< ffmpegkit::ReturnCode > returnCode) override |
void | fail (const char *error) override |
virtual bool | isFFmpeg () const override |
virtual bool | isFFprobe () const override |
virtual bool | isMediaInformation () const override |
void | cancel () override |
virtual ffmpegkit::LogCallback | getLogCallback () const =0 |
virtual long | getSessionId () const =0 |
virtual std::chrono::time_point< std::chrono::system_clock > | getCreateTime () const =0 |
virtual std::chrono::time_point< std::chrono::system_clock > | getStartTime () const =0 |
virtual std::chrono::time_point< std::chrono::system_clock > | getEndTime () const =0 |
virtual long | getDuration () const =0 |
virtual std::shared_ptr< std::list< std::string > > | getArguments () const =0 |
virtual std::string | getCommand () const =0 |
virtual std::shared_ptr< std::list< std::shared_ptr< ffmpegkit::Log > > > | getAllLogsWithTimeout (const int waitTimeout) const =0 |
virtual std::shared_ptr< std::list< std::shared_ptr< ffmpegkit::Log > > > | getAllLogs () const =0 |
virtual std::shared_ptr< std::list< std::shared_ptr< ffmpegkit::Log > > > | getLogs () const =0 |
virtual std::string | getAllLogsAsStringWithTimeout (const int waitTimeout) const =0 |
virtual std::string | getAllLogsAsString () const =0 |
virtual std::string | getLogsAsString () const =0 |
virtual std::string | getOutput () const =0 |
virtual ffmpegkit::SessionState | getState () const =0 |
virtual std::shared_ptr< ffmpegkit::ReturnCode > | getReturnCode () const =0 |
virtual std::string | getFailStackTrace () const =0 |
virtual LogRedirectionStrategy | getLogRedirectionStrategy () const =0 |
virtual bool | thereAreAsynchronousMessagesInTransmit () const =0 |
virtual void | addLog (const std::shared_ptr< ffmpegkit::Log > log)=0 |
virtual void | startRunning ()=0 |
virtual void | complete (const std::shared_ptr< ffmpegkit::ReturnCode > returnCode)=0 |
virtual void | fail (const char *error)=0 |
virtual bool | isFFmpeg () const =0 |
virtual bool | isFFprobe () const =0 |
virtual bool | isMediaInformation () const =0 |
virtual void | cancel ()=0 |
Static Public Attributes | |
static constexpr int | DefaultTimeoutForAsynchronousMessagesInTransmit = 5000 |
Private Attributes | |
const long | _sessionId |
ffmpegkit::LogCallback | _logCallback |
std::chrono::time_point< std::chrono::system_clock > | _createTime |
std::chrono::time_point< std::chrono::system_clock > | _startTime |
std::chrono::time_point< std::chrono::system_clock > | _endTime |
std::shared_ptr< std::list< std::string > > | _arguments |
std::shared_ptr< std::list< std::shared_ptr< ffmpegkit::Log > > > | _logs |
SessionState | _state |
std::shared_ptr< ffmpegkit::ReturnCode > | _returnCode |
std::string | _failStackTrace |
LogRedirectionStrategy | _logRedirectionStrategy |
Abstract session implementation which includes common features shared by FFmpeg
, FFprobe
and MediaInformation
sessions.
Definition at line 31 of file AbstractSession.h.
ffmpegkit::AbstractSession::AbstractSession | ( | const std::list< std::string > & | arguments, |
const ffmpegkit::LogCallback | logCallback, | ||
const LogRedirectionStrategy | logRedirectionStrategy | ||
) |
Creates a new abstract session.
arguments | command arguments |
logCallback | session specific log callback |
logRedirectionStrategy | session specific log redirection strategy |
Definition at line 36 of file AbstractSession.cpp.
|
overridevirtual |
Adds a new log entry for this session.
It is invoked internally by FFmpegKit
library methods. Must not be used by user applications.
log | log entry |
Implements ffmpegkit::Session.
Definition at line 162 of file AbstractSession.cpp.
|
overridevirtual |
Cancels running the session.
Implements ffmpegkit::Session.
Definition at line 198 of file AbstractSession.cpp.
|
overridevirtual |
Completes running the session with the provided return code.
returnCode | return code of the execution |
Implements ffmpegkit::Session.
Definition at line 171 of file AbstractSession.cpp.
|
overridevirtual |
Ends running the session with a failure.
error | error received |
Implements ffmpegkit::Session.
Definition at line 177 of file AbstractSession.cpp.
|
overridevirtual |
Returns all log entries generated for this session. If there are asynchronous messages that are not delivered yet, this method waits for them.
Implements ffmpegkit::Session.
Definition at line 106 of file AbstractSession.cpp.
|
overridevirtual |
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.
Implements ffmpegkit::Session.
Definition at line 124 of file AbstractSession.cpp.
|
overridevirtual |
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 |
Implements ffmpegkit::Session.
Definition at line 114 of file AbstractSession.cpp.
|
overridevirtual |
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 |
Implements ffmpegkit::Session.
Definition at line 97 of file AbstractSession.cpp.
|
overridevirtual |
Returns command arguments as a list.
Implements ffmpegkit::Session.
Definition at line 89 of file AbstractSession.cpp.
|
overridevirtual |
Returns command arguments as a concatenated string.
Implements ffmpegkit::Session.
Definition at line 93 of file AbstractSession.cpp.
|
overridevirtual |
Returns session create time.
Implements ffmpegkit::Session.
Definition at line 66 of file AbstractSession.cpp.
|
overridevirtual |
Returns the time taken to execute this session.
Implements ffmpegkit::Session.
Definition at line 78 of file AbstractSession.cpp.
|
overridevirtual |
Returns session end time.
Implements ffmpegkit::Session.
Definition at line 74 of file AbstractSession.cpp.
|
overridevirtual |
Returns the stack trace of the exception received while executing this session.
The stack trace is only set for sessions that end with SessionStateFailed state. For sessions that has SessionStateCompleted state this method returns an empty string.
Implements ffmpegkit::Session.
Definition at line 150 of file AbstractSession.cpp.
|
overridevirtual |
Returns the session specific log callback.
Implements ffmpegkit::Session.
Definition at line 58 of file AbstractSession.cpp.
|
overridevirtual |
Returns session specific log redirection strategy.
Implements ffmpegkit::Session.
Definition at line 154 of file AbstractSession.cpp.
|
overridevirtual |
Returns all log entries delivered for this session. Note that if there are asynchronous messages that are not delivered yet, this method will not wait for them and will return immediately.
Implements ffmpegkit::Session.
Definition at line 110 of file AbstractSession.cpp.
|
overridevirtual |
Returns all log entries delivered for this session as a concatenated string. Note that if there are asynchronous messages that are not delivered yet, this method will not wait for them and will return immediately.
Implements ffmpegkit::Session.
Definition at line 128 of file AbstractSession.cpp.
|
overridevirtual |
Returns the log output generated while running the session.
Implements ffmpegkit::Session.
Definition at line 138 of file AbstractSession.cpp.
|
overridevirtual |
Returns the return code for this session. Note that return code is only set for sessions that end with SessionStateCompleted state. If a session is not started, still running or failed then this method returns nullptr.
Implements ffmpegkit::Session.
Definition at line 146 of file AbstractSession.cpp.
|
overridevirtual |
Returns the session identifier.
Implements ffmpegkit::Session.
Definition at line 62 of file AbstractSession.cpp.
|
overridevirtual |
Returns session start time.
Implements ffmpegkit::Session.
Definition at line 70 of file AbstractSession.cpp.
|
overridevirtual |
Returns the state of the session.
Implements ffmpegkit::Session.
Definition at line 142 of file AbstractSession.cpp.
|
overridevirtual |
Returns whether it is an FFmpeg
session or not.
FFmpeg
session, false otherwise Implements ffmpegkit::Session.
Reimplemented in ffmpegkit::FFmpegSession, ffmpegkit::FFprobeSession, and ffmpegkit::MediaInformationSession.
Definition at line 183 of file AbstractSession.cpp.
|
overridevirtual |
Returns whether it is an FFprobe
session or not.
FFprobe
session, false otherwise Implements ffmpegkit::Session.
Reimplemented in ffmpegkit::FFmpegSession, ffmpegkit::FFprobeSession, and ffmpegkit::MediaInformationSession.
Definition at line 188 of file AbstractSession.cpp.
|
overridevirtual |
Returns whether it is a MediaInformation
session or not.
MediaInformation
session, false otherwise Implements ffmpegkit::Session.
Reimplemented in ffmpegkit::FFmpegSession, ffmpegkit::FFprobeSession, and ffmpegkit::MediaInformationSession.
Definition at line 193 of file AbstractSession.cpp.
|
overridevirtual |
Starts running the session.
Implements ffmpegkit::Session.
Definition at line 166 of file AbstractSession.cpp.
|
overridevirtual |
Returns whether there are still asynchronous messages being transmitted for this session or not.
Implements ffmpegkit::Session.
Definition at line 158 of file AbstractSession.cpp.
void ffmpegkit::AbstractSession::waitForAsynchronousMessagesInTransmit | ( | const int | timeout | ) | const |
Waits for all asynchronous messages to be transmitted until the given timeout.
timeout | wait timeout in milliseconds |
Definition at line 47 of file AbstractSession.cpp.
|
private |
Definition at line 277 of file AbstractSession.h.
|
private |
Definition at line 274 of file AbstractSession.h.
|
private |
Definition at line 276 of file AbstractSession.h.
|
private |
Definition at line 281 of file AbstractSession.h.
|
private |
Definition at line 273 of file AbstractSession.h.
|
private |
Definition at line 282 of file AbstractSession.h.
|
private |
Definition at line 278 of file AbstractSession.h.
|
private |
Definition at line 280 of file AbstractSession.h.
|
private |
Definition at line 272 of file AbstractSession.h.
|
private |
Definition at line 275 of file AbstractSession.h.
|
private |
Definition at line 279 of file AbstractSession.h.
|
staticconstexpr |
Defines how long default "getAll" methods wait, in milliseconds.
Definition at line 37 of file AbstractSession.h.