| FFmpegKit Linux API 6.0

Loading...
Searching...
No Matches
FFmpegKitConfig.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2022 Taner Sener
3 *
4 * This file is part of FFmpegKit.
5 *
6 * FFmpegKit is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU Lesser General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * FFmpegKit is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public License
17 * along with FFmpegKit. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#ifndef FFMPEG_KIT_CONFIG_H
21#define FFMPEG_KIT_CONFIG_H
22
23#include <stdio.h>
24#include <pthread.h>
25#include <unistd.h>
26#include "FFmpegSession.h"
27#include "FFprobeSession.h"
28#include "Level.h"
29#include "LogCallback.h"
30#include "MediaInformationSession.h"
31#include "Signal.h"
32#include "StatisticsCallback.h"
33#include <map>
34
35 namespace ffmpegkit {
36
41 class FFmpegKitConfig {
42 public:
43
45 static constexpr const char* FFmpegKitVersion = "6.0";
46
50 static constexpr const char* FFmpegKitNamedPipePrefix = "fk_pipe_";
51
61 static void enableRedirection();
62
70 static void disableRedirection();
71
78 static int setFontconfigConfigurationPath(const std::string& path);
79
92 static void setFontDirectory(const std::string& fontDirectoryPath, const std::map<std::string,std::string>& fontNameMapping);
93
106 static void setFontDirectoryList(const std::list<std::string>& fontDirectoryList, const std::map<std::string,std::string>& fontNameMapping);
107
115 static std::shared_ptr<std::string> registerNewFFmpegPipe();
116
122 static void closeFFmpegPipe(const std::string& ffmpegPipePath);
123
129 static std::string getFFmpegVersion();
130
136 static std::string getVersion();
137
143 static bool isLTSBuild();
144
150 static std::string getBuildDate();
151
159 static int setEnvironmentVariable(const std::string& variableName, const std::string& variableValue);
160
167 static void ignoreSignal(const ffmpegkit::Signal signal);
168
174 static void ffmpegExecute(const std::shared_ptr<ffmpegkit::FFmpegSession> ffmpegSession);
175
181 static void ffprobeExecute(const std::shared_ptr<ffmpegkit::FFprobeSession> ffprobeSession);
182
189 static void getMediaInformationExecute(const std::shared_ptr<ffmpegkit::MediaInformationSession> mediaInformationSession, const int waitTimeout);
190
199 static void asyncFFmpegExecute(const std::shared_ptr<ffmpegkit::FFmpegSession> ffmpegSession);
200
209 static void asyncFFprobeExecute(const std::shared_ptr<ffmpegkit::FFprobeSession> ffprobeSession);
210
220 static void asyncGetMediaInformationExecute(const std::shared_ptr<ffmpegkit::MediaInformationSession> mediaInformationSession, int waitTimeout);
221
227 static void enableLogCallback(const ffmpegkit::LogCallback logCallback);
228
234 static void enableStatisticsCallback(const ffmpegkit::StatisticsCallback statisticsCallback);
235
241 static void enableFFmpegSessionCompleteCallback(const FFmpegSessionCompleteCallback ffmpegSessionCompleteCallback);
242
248 static FFmpegSessionCompleteCallback getFFmpegSessionCompleteCallback();
249
255 static void enableFFprobeSessionCompleteCallback(const FFprobeSessionCompleteCallback ffprobeSessionCompleteCallback);
256
262 static FFprobeSessionCompleteCallback getFFprobeSessionCompleteCallback();
263
270 static void enableMediaInformationSessionCompleteCallback(const MediaInformationSessionCompleteCallback mediaInformationSessionCompleteCallback);
271
277 static MediaInformationSessionCompleteCallback getMediaInformationSessionCompleteCallback();
278
284 static ffmpegkit::Level getLogLevel();
285
291 static void setLogLevel(const ffmpegkit::Level level);
292
299 static std::string logLevelToString(const ffmpegkit::Level level);
300
306 static int getSessionHistorySize();
307
313 static void setSessionHistorySize(const int sessionHistorySize);
314
321 static std::shared_ptr<ffmpegkit::Session> getSession(const long sessionId);
322
328 static std::shared_ptr<ffmpegkit::Session> getLastSession();
329
336 static std::shared_ptr<ffmpegkit::Session> getLastCompletedSession();
337
343 static std::shared_ptr<std::list<std::shared_ptr<ffmpegkit::Session>>> getSessions();
344
349 static void clearSessions();
350
356 static std::shared_ptr<std::list<std::shared_ptr<ffmpegkit::FFmpegSession>>> getFFmpegSessions();
357
363 static std::shared_ptr<std::list<std::shared_ptr<ffmpegkit::FFprobeSession>>> getFFprobeSessions();
364
370 static std::shared_ptr<std::list<std::shared_ptr<ffmpegkit::MediaInformationSession>>> getMediaInformationSessions();
371
377 static std::shared_ptr<std::list<std::shared_ptr<ffmpegkit::Session>>> getSessionsByState(const SessionState state);
378
384 static LogRedirectionStrategy getLogRedirectionStrategy();
385
391 static void setLogRedirectionStrategy(const LogRedirectionStrategy logRedirectionStrategy);
392
400 static int messagesInTransmit(const long sessionId);
401
408 static std::string sessionStateToString(SessionState state);
409
417 static std::list<std::string> parseArguments(const std::string& command);
418
425 static std::string argumentsToString(std::shared_ptr<std::list<std::string>> arguments);
426
427 };
428
429}
430
431#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