# FFmpegKit Linux API: FFmpegKitConfig.h Source File

Loading...
Searching...
No Matches
FFmpegKitConfig.h
Go to the documentation of this file.
/*
* Copyright (c) 2022 Taner Sener
*
* This file is part of FFmpegKit.
*
* FFmpegKit is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FFmpegKit is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with FFmpegKit. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef FFMPEG_KIT_CONFIG_H
#define FFMPEG_KIT_CONFIG_H
#include <stdio.h>
#include <pthread.h>
#include <unistd.h>
#include "FFmpegSession.h"
#include "FFprobeSession.h"
#include "Level.h"
#include "LogCallback.h"
#include "MediaInformationSession.h"
#include "Signal.h"
#include "StatisticsCallback.h"
#include <map>
namespace ffmpegkit {
class FFmpegKitConfig {
public:
static constexpr const char* FFmpegKitVersion = "6.0";
static constexpr const char* FFmpegKitNamedPipePrefix = "fk_pipe_";
static void enableRedirection();
static void disableRedirection();
static int setFontconfigConfigurationPath(const std::string& path);
static void setFontDirectory(const std::string& fontDirectoryPath, const std::map<std::string,std::string>& fontNameMapping);
static void setFontDirectoryList(const std::list<std::string>& fontDirectoryList, const std::map<std::string,std::string>& fontNameMapping);
static std::shared_ptr<std::string> registerNewFFmpegPipe();
static void closeFFmpegPipe(const std::string& ffmpegPipePath);
static std::string getFFmpegVersion();
static std::string getVersion();
static bool isLTSBuild();
static std::string getBuildDate();
static int setEnvironmentVariable(const std::string& variableName, const std::string& variableValue);
static void ignoreSignal(const ffmpegkit::Signal signal);
static void ffmpegExecute(const std::shared_ptr<ffmpegkit::FFmpegSession> ffmpegSession);
static void ffprobeExecute(const std::shared_ptr<ffmpegkit::FFprobeSession> ffprobeSession);
static void getMediaInformationExecute(const std::shared_ptr<ffmpegkit::MediaInformationSession> mediaInformationSession, const int waitTimeout);
static void asyncFFmpegExecute(const std::shared_ptr<ffmpegkit::FFmpegSession> ffmpegSession);
static void asyncFFprobeExecute(const std::shared_ptr<ffmpegkit::FFprobeSession> ffprobeSession);
static void asyncGetMediaInformationExecute(const std::shared_ptr<ffmpegkit::MediaInformationSession> mediaInformationSession, int waitTimeout);
static void enableLogCallback(const ffmpegkit::LogCallback logCallback);
static void enableStatisticsCallback(const ffmpegkit::StatisticsCallback statisticsCallback);
static void enableFFmpegSessionCompleteCallback(const FFmpegSessionCompleteCallback ffmpegSessionCompleteCallback);
static FFmpegSessionCompleteCallback getFFmpegSessionCompleteCallback();
static void enableFFprobeSessionCompleteCallback(const FFprobeSessionCompleteCallback ffprobeSessionCompleteCallback);
static FFprobeSessionCompleteCallback getFFprobeSessionCompleteCallback();
static void enableMediaInformationSessionCompleteCallback(const MediaInformationSessionCompleteCallback mediaInformationSessionCompleteCallback);
static MediaInformationSessionCompleteCallback getMediaInformationSessionCompleteCallback();
static ffmpegkit::Level getLogLevel();
static void setLogLevel(const ffmpegkit::Level level);
static std::string logLevelToString(const ffmpegkit::Level level);
static int getSessionHistorySize();
static void setSessionHistorySize(const int sessionHistorySize);
static std::shared_ptr<ffmpegkit::Session> getSession(const long sessionId);
static std::shared_ptr<ffmpegkit::Session> getLastSession();
static std::shared_ptr<ffmpegkit::Session> getLastCompletedSession();
static std::shared_ptr<std::list<std::shared_ptr<ffmpegkit::Session>>> getSessions();
static void clearSessions();
static std::shared_ptr<std::list<std::shared_ptr<ffmpegkit::FFmpegSession>>> getFFmpegSessions();
static std::shared_ptr<std::list<std::shared_ptr<ffmpegkit::FFprobeSession>>> getFFprobeSessions();
static std::shared_ptr<std::list<std::shared_ptr<ffmpegkit::MediaInformationSession>>> getMediaInformationSessions();
static std::shared_ptr<std::list<std::shared_ptr<ffmpegkit::Session>>> getSessionsByState(const SessionState state);
static LogRedirectionStrategy getLogRedirectionStrategy();
static void setLogRedirectionStrategy(const LogRedirectionStrategy logRedirectionStrategy);
static int messagesInTransmit(const long sessionId);
static std::string sessionStateToString(SessionState state);
static std::list<std::string> parseArguments(const std::string& command);
static std::string argumentsToString(std::shared_ptr<std::list<std::string>> arguments);
};
}
#endif // FFMPEG_KIT_CONFIG_H
sessionHistorySize
static int sessionHistorySize
Definition FFmpegKitConfig.cpp:58
ffmpegSessionCompleteCallback
static ffmpegkit::FFmpegSessionCompleteCallback ffmpegSessionCompleteCallback
Definition FFmpegKitConfig.cpp:75
logCallback
static ffmpegkit::LogCallback logCallback
Definition FFmpegKitConfig.cpp:69
statisticsCallback
static ffmpegkit::StatisticsCallback statisticsCallback
Definition FFmpegKitConfig.cpp:72
ffprobeSessionCompleteCallback
static ffmpegkit::FFprobeSessionCompleteCallback ffprobeSessionCompleteCallback
Definition FFmpegKitConfig.cpp:76
mediaInformationSessionCompleteCallback
static ffmpegkit::MediaInformationSessionCompleteCallback mediaInformationSessionCompleteCallback
Definition FFmpegKitConfig.cpp:77
FFmpegSession.h
FFprobeSession.h
Level.h
LogCallback.h
MediaInformationSession.h
Signal.h
StatisticsCallback.h
ffmpegkit::FFmpegKitConfig
Definition FFmpegKitConfig.h:41
ffmpegkit::FFmpegKitConfig::getVersion
static std::string getVersion()
Definition FFmpegKitConfig.cpp:972
ffmpegkit::FFmpegKitConfig::disableRedirection
static void disableRedirection()
Definition FFmpegKitConfig.cpp:823
ffmpegkit::FFmpegKitConfig::getMediaInformationSessions
static std::shared_ptr< std::list< std::shared_ptr< ffmpegkit::MediaInformationSession > > > getMediaInformationSessions()
Definition FFmpegKitConfig.cpp:1308
ffmpegkit::FFmpegKitConfig::enableFFmpegSessionCompleteCallback
static void enableFFmpegSessionCompleteCallback(const FFmpegSessionCompleteCallback ffmpegSessionCompleteCallback)
Definition FFmpegKitConfig.cpp:1152
ffmpegkit::FFmpegKitConfig::getSessionHistorySize
static int getSessionHistorySize()
Definition FFmpegKitConfig.cpp:1200
ffmpegkit::FFmpegKitConfig::getLastSession
static std::shared_ptr< ffmpegkit::Session > getLastSession()
Definition FFmpegKitConfig.cpp:1229
ffmpegkit::FFmpegKitConfig::enableRedirection
static void enableRedirection()
Definition FFmpegKitConfig.cpp:800
ffmpegkit::FFmpegKitConfig::FFmpegKitNamedPipePrefix
static constexpr const char * FFmpegKitNamedPipePrefix
Definition FFmpegKitConfig.h:50
ffmpegkit::FFmpegKitConfig::enableLogCallback
static void enableLogCallback(const ffmpegkit::LogCallback logCallback)
Definition FFmpegKitConfig.cpp:1144
ffmpegkit::FFmpegKitConfig::registerNewFFmpegPipe
static std::shared_ptr< std::string > registerNewFFmpegPipe()
Definition FFmpegKitConfig.cpp:932
ffmpegkit::FFmpegKitConfig::FFmpegKitVersion
static constexpr const char * FFmpegKitVersion
Definition FFmpegKitConfig.h:45
ffmpegkit::FFmpegKitConfig::getLogRedirectionStrategy
static LogRedirectionStrategy getLogRedirectionStrategy()
Definition FFmpegKitConfig.cpp:1344
ffmpegkit::FFmpegKitConfig::getFFprobeSessions
static std::shared_ptr< std::list< std::shared_ptr< ffmpegkit::FFprobeSession > > > getFFprobeSessions()
Definition FFmpegKitConfig.cpp:1290
ffmpegkit::FFmpegKitConfig::messagesInTransmit
static int messagesInTransmit(const long sessionId)
Definition FFmpegKitConfig.cpp:1352
ffmpegkit::FFmpegKitConfig::closeFFmpegPipe
static void closeFFmpegPipe(const std::string &ffmpegPipePath)
Definition FFmpegKitConfig.cpp:964
ffmpegkit::FFmpegKitConfig::asyncFFprobeExecute
static void asyncFFprobeExecute(const std::shared_ptr< ffmpegkit::FFprobeSession > ffprobeSession)
Definition FFmpegKitConfig.cpp:1088
ffmpegkit::FFmpegKitConfig::getLogLevel
static ffmpegkit::Level getLogLevel()
Definition FFmpegKitConfig.cpp:1176
ffmpegkit::FFmpegKitConfig::getSession
static std::shared_ptr< ffmpegkit::Session > getSession(const long sessionId)
Definition FFmpegKitConfig.cpp:1217
ffmpegkit::FFmpegKitConfig::asyncGetMediaInformationExecute
static void asyncGetMediaInformationExecute(const std::shared_ptr< ffmpegkit::MediaInformationSession > mediaInformationSession, int waitTimeout)
Definition FFmpegKitConfig.cpp:1116
ffmpegkit::FFmpegKitConfig::setLogRedirectionStrategy
static void setLogRedirectionStrategy(const LogRedirectionStrategy logRedirectionStrategy)
Definition FFmpegKitConfig.cpp:1348
ffmpegkit::FFmpegKitConfig::getMediaInformationExecute
static void getMediaInformationExecute(const std::shared_ptr< ffmpegkit::MediaInformationSession > mediaInformationSession, const int waitTimeout)
Definition FFmpegKitConfig.cpp:1036
ffmpegkit::FFmpegKitConfig::setEnvironmentVariable
static int setEnvironmentVariable(const std::string &variableName, const std::string &variableValue)
Definition FFmpegKitConfig.cpp:994
ffmpegkit::FFmpegKitConfig::getSessionsByState
static std::shared_ptr< std::list< std::shared_ptr< ffmpegkit::Session > > > getSessionsByState(const SessionState state)
Definition FFmpegKitConfig.cpp:1326
ffmpegkit::FFmpegKitConfig::enableStatisticsCallback
static void enableStatisticsCallback(const ffmpegkit::StatisticsCallback statisticsCallback)
Definition FFmpegKitConfig.cpp:1148
ffmpegkit::FFmpegKitConfig::parseArguments
static std::list< std::string > parseArguments(const std::string &command)
Definition FFmpegKitConfig.cpp:1366
ffmpegkit::FFmpegKitConfig::ffprobeExecute
static void ffprobeExecute(const std::shared_ptr< ffmpegkit::FFprobeSession > ffprobeSession)
Definition FFmpegKitConfig.cpp:1024
ffmpegkit::FFmpegKitConfig::setSessionHistorySize
static void setSessionHistorySize(const int sessionHistorySize)
Definition FFmpegKitConfig.cpp:1204
ffmpegkit::FFmpegKitConfig::setLogLevel
static void setLogLevel(const ffmpegkit::Level level)
Definition FFmpegKitConfig.cpp:1180
ffmpegkit::FFmpegKitConfig::setFontDirectory
static void setFontDirectory(const std::string &fontDirectoryPath, const std::map< std::string, std::string > &fontNameMapping)
Definition FFmpegKitConfig.cpp:848
ffmpegkit::FFmpegKitConfig::asyncFFmpegExecute
static void asyncFFmpegExecute(const std::shared_ptr< ffmpegkit::FFmpegSession > ffmpegSession)
Definition FFmpegKitConfig.cpp:1060
ffmpegkit::FFmpegKitConfig::getFFmpegSessionCompleteCallback
static FFmpegSessionCompleteCallback getFFmpegSessionCompleteCallback()
Definition FFmpegKitConfig.cpp:1156
ffmpegkit::FFmpegKitConfig::ignoreSignal
static void ignoreSignal(const ffmpegkit::Signal signal)
Definition FFmpegKitConfig.cpp:998
ffmpegkit::FFmpegKitConfig::getFFprobeSessionCompleteCallback
static FFprobeSessionCompleteCallback getFFprobeSessionCompleteCallback()
Definition FFmpegKitConfig.cpp:1164
ffmpegkit::FFmpegKitConfig::getLastCompletedSession
static std::shared_ptr< ffmpegkit::Session > getLastCompletedSession()
Definition FFmpegKitConfig.cpp:1236
ffmpegkit::FFmpegKitConfig::clearSessions
static void clearSessions()
Definition FFmpegKitConfig.cpp:1262
ffmpegkit::FFmpegKitConfig::isLTSBuild
static bool isLTSBuild()
Definition FFmpegKitConfig.cpp:980
ffmpegkit::FFmpegKitConfig::sessionStateToString
static std::string sessionStateToString(SessionState state)
Definition FFmpegKitConfig.cpp:1356
ffmpegkit::FFmpegKitConfig::getFFmpegSessions
static std::shared_ptr< std::list< std::shared_ptr< ffmpegkit::FFmpegSession > > > getFFmpegSessions()
Definition FFmpegKitConfig.cpp:1272
ffmpegkit::FFmpegKitConfig::setFontconfigConfigurationPath
static int setFontconfigConfigurationPath(const std::string &path)
Definition FFmpegKitConfig.cpp:844
ffmpegkit::FFmpegKitConfig::argumentsToString
static std::string argumentsToString(std::shared_ptr< std::list< std::string > > arguments)
Definition FFmpegKitConfig.cpp:1417
ffmpegkit::FFmpegKitConfig::logLevelToString
static std::string logLevelToString(const ffmpegkit::Level level)
Definition FFmpegKitConfig.cpp:1184
ffmpegkit::FFmpegKitConfig::setFontDirectoryList
static void setFontDirectoryList(const std::list< std::string > &fontDirectoryList, const std::map< std::string, std::string > &fontNameMapping)
Definition FFmpegKitConfig.cpp:852
ffmpegkit::FFmpegKitConfig::enableMediaInformationSessionCompleteCallback
static void enableMediaInformationSessionCompleteCallback(const MediaInformationSessionCompleteCallback mediaInformationSessionCompleteCallback)
Definition FFmpegKitConfig.cpp:1168
ffmpegkit::FFmpegKitConfig::enableFFprobeSessionCompleteCallback
static void enableFFprobeSessionCompleteCallback(const FFprobeSessionCompleteCallback ffprobeSessionCompleteCallback)
Definition FFmpegKitConfig.cpp:1160
ffmpegkit::FFmpegKitConfig::getFFmpegVersion
static std::string getFFmpegVersion()
Definition FFmpegKitConfig.cpp:968
ffmpegkit::FFmpegKitConfig::getSessions
static std::shared_ptr< std::list< std::shared_ptr< ffmpegkit::Session > > > getSessions()
Definition FFmpegKitConfig.cpp:1251
ffmpegkit::FFmpegKitConfig::getBuildDate
static std::string getBuildDate()
Definition FFmpegKitConfig.cpp:988
ffmpegkit::FFmpegKitConfig::ffmpegExecute
static void ffmpegExecute(const std::shared_ptr< ffmpegkit::FFmpegSession > ffmpegSession)
Definition FFmpegKitConfig.cpp:1012
ffmpegkit::FFmpegKitConfig::getMediaInformationSessionCompleteCallback
static MediaInformationSessionCompleteCallback getMediaInformationSessionCompleteCallback()
Definition FFmpegKitConfig.cpp:1172
ffmpegkit
Definition AbstractSession.h:25
ffmpegkit::LogRedirectionStrategy
LogRedirectionStrategy
Definition LogRedirectionStrategy.h:25
ffmpegkit::StatisticsCallback
std::function< void(const std::shared_ptr< ffmpegkit::Statistics > statistics)> StatisticsCallback
Definition StatisticsCallback.h:35
ffmpegkit::Level
Level
Definition Level.h:28
ffmpegkit::SessionState
SessionState
Definition SessionState.h:25
ffmpegkit::MediaInformationSessionCompleteCallback
std::function< void(const std::shared_ptr< ffmpegkit::MediaInformationSession > session)> MediaInformationSessionCompleteCallback
Definition MediaInformationSessionCompleteCallback.h:53
ffmpegkit::LogCallback
std::function< void(const std::shared_ptr< ffmpegkit::Log > log)> LogCallback
Definition LogCallback.h:35
ffmpegkit::Signal
Signal
Definition Signal.h:25
ffmpegkit::FFprobeSessionCompleteCallback
std::function< void(const std::shared_ptr< ffmpegkit::FFprobeSession > session)> FFprobeSessionCompleteCallback
Definition FFprobeSessionCompleteCallback.h:52
ffmpegkit::FFmpegSessionCompleteCallback
std::function< void(const std::shared_ptr< ffmpegkit::FFmpegSession > session)> FFmpegSessionCompleteCallback
Definition FFmpegSessionCompleteCallback.h:52