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"
31#include "Signal.h"
32#include "StatisticsCallback.h"
33#include <map>
34
35namespace ffmpegkit {
36
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
228
235
242
249
256
263
271
278
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
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
static int sessionHistorySize
static ffmpegkit::FFmpegSessionCompleteCallback ffmpegSessionCompleteCallback
static ffmpegkit::LogCallback logCallback
static ffmpegkit::StatisticsCallback statisticsCallback
static ffmpegkit::FFprobeSessionCompleteCallback ffprobeSessionCompleteCallback
static ffmpegkit::MediaInformationSessionCompleteCallback mediaInformationSessionCompleteCallback
static std::string getVersion()
static std::shared_ptr< std::list< std::shared_ptr< ffmpegkit::MediaInformationSession > > > getMediaInformationSessions()
static void enableFFmpegSessionCompleteCallback(const FFmpegSessionCompleteCallback ffmpegSessionCompleteCallback)
static std::shared_ptr< ffmpegkit::Session > getLastSession()
static constexpr const char * FFmpegKitNamedPipePrefix
static void enableLogCallback(const ffmpegkit::LogCallback logCallback)
static std::shared_ptr< std::string > registerNewFFmpegPipe()
static constexpr const char * FFmpegKitVersion
static LogRedirectionStrategy getLogRedirectionStrategy()
static std::shared_ptr< std::list< std::shared_ptr< ffmpegkit::FFprobeSession > > > getFFprobeSessions()
static int messagesInTransmit(const long sessionId)
static void closeFFmpegPipe(const std::string &ffmpegPipePath)
static void asyncFFprobeExecute(const std::shared_ptr< ffmpegkit::FFprobeSession > ffprobeSession)
static ffmpegkit::Level getLogLevel()
static std::shared_ptr< ffmpegkit::Session > getSession(const long sessionId)
static void asyncGetMediaInformationExecute(const std::shared_ptr< ffmpegkit::MediaInformationSession > mediaInformationSession, int waitTimeout)
static void setLogRedirectionStrategy(const LogRedirectionStrategy logRedirectionStrategy)
static void getMediaInformationExecute(const std::shared_ptr< ffmpegkit::MediaInformationSession > mediaInformationSession, const int waitTimeout)
static int setEnvironmentVariable(const std::string &variableName, const std::string &variableValue)
static std::shared_ptr< std::list< std::shared_ptr< ffmpegkit::Session > > > getSessionsByState(const SessionState state)
static void enableStatisticsCallback(const ffmpegkit::StatisticsCallback statisticsCallback)
static std::list< std::string > parseArguments(const std::string &command)
static void ffprobeExecute(const std::shared_ptr< ffmpegkit::FFprobeSession > ffprobeSession)
static void setSessionHistorySize(const int sessionHistorySize)
static void setLogLevel(const ffmpegkit::Level level)
static void setFontDirectory(const std::string &fontDirectoryPath, const std::map< std::string, std::string > &fontNameMapping)
static void asyncFFmpegExecute(const std::shared_ptr< ffmpegkit::FFmpegSession > ffmpegSession)
static FFmpegSessionCompleteCallback getFFmpegSessionCompleteCallback()
static void ignoreSignal(const ffmpegkit::Signal signal)
static FFprobeSessionCompleteCallback getFFprobeSessionCompleteCallback()
static std::shared_ptr< ffmpegkit::Session > getLastCompletedSession()
static std::string sessionStateToString(SessionState state)
static std::shared_ptr< std::list< std::shared_ptr< ffmpegkit::FFmpegSession > > > getFFmpegSessions()
static int setFontconfigConfigurationPath(const std::string &path)
static std::string argumentsToString(std::shared_ptr< std::list< std::string > > arguments)
static std::string logLevelToString(const ffmpegkit::Level level)
static void setFontDirectoryList(const std::list< std::string > &fontDirectoryList, const std::map< std::string, std::string > &fontNameMapping)
static void enableMediaInformationSessionCompleteCallback(const MediaInformationSessionCompleteCallback mediaInformationSessionCompleteCallback)
static void enableFFprobeSessionCompleteCallback(const FFprobeSessionCompleteCallback ffprobeSessionCompleteCallback)
static std::string getFFmpegVersion()
static std::shared_ptr< std::list< std::shared_ptr< ffmpegkit::Session > > > getSessions()
static std::string getBuildDate()
static void ffmpegExecute(const std::shared_ptr< ffmpegkit::FFmpegSession > ffmpegSession)
static MediaInformationSessionCompleteCallback getMediaInformationSessionCompleteCallback()
std::function< void(const std::shared_ptr< ffmpegkit::Statistics > statistics)> StatisticsCallback
std::function< void(const std::shared_ptr< ffmpegkit::MediaInformationSession > session)> MediaInformationSessionCompleteCallback
std::function< void(const std::shared_ptr< ffmpegkit::Log > log)> LogCallback
Definition LogCallback.h:35
std::function< void(const std::shared_ptr< ffmpegkit::FFprobeSession > session)> FFprobeSessionCompleteCallback
std::function< void(const std::shared_ptr< ffmpegkit::FFmpegSession > session)> FFmpegSessionCompleteCallback