FFmpegKit Linux API 5.1
FFmpegKit.cpp
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
20extern "C" {
21 #include "fftools_ffmpeg.h"
22}
23#include "ArchDetect.h"
24#include "FFmpegKit.h"
25#include "FFmpegKitConfig.h"
26#include "Packages.h"
27
28extern void* ffmpegKitInitialize();
29
31
32std::shared_ptr<ffmpegkit::FFmpegSession> ffmpegkit::FFmpegKit::executeWithArguments(const std::list<std::string>& arguments) {
33 auto session = ffmpegkit::FFmpegSession::create(arguments);
35 return session;
36}
37
38std::shared_ptr<ffmpegkit::FFmpegSession> ffmpegkit::FFmpegKit::executeWithArgumentsAsync(const std::list<std::string>& arguments, FFmpegSessionCompleteCallback completeCallback) {
39 auto session = ffmpegkit::FFmpegSession::create(arguments, completeCallback);
41 return session;
42}
43
44std::shared_ptr<ffmpegkit::FFmpegSession> ffmpegkit::FFmpegKit::executeWithArgumentsAsync(const std::list<std::string>& arguments, FFmpegSessionCompleteCallback completeCallback, ffmpegkit::LogCallback logCallback, ffmpegkit::StatisticsCallback statisticsCallback) {
45 auto session = ffmpegkit::FFmpegSession::create(arguments, completeCallback, logCallback, statisticsCallback);
47 return session;
48}
49
50std::shared_ptr<ffmpegkit::FFmpegSession> ffmpegkit::FFmpegKit::execute(const std::string command) {
53 return session;
54}
55
56std::shared_ptr<ffmpegkit::FFmpegSession> ffmpegkit::FFmpegKit::executeAsync(const std::string command, FFmpegSessionCompleteCallback completeCallback) {
57 auto session = ffmpegkit::FFmpegSession::create(FFmpegKitConfig::parseArguments(command.c_str()), completeCallback);
59 return session;
60}
61
65 return session;
66}
67
69
70 /*
71 * ZERO (0) IS A SPECIAL SESSION ID
72 * WHEN IT IS PASSED TO THIS METHOD, A SIGINT IS GENERATED WHICH CANCELS ALL ONGOING SESSIONS
73 */
75}
76
77void ffmpegkit::FFmpegKit::cancel(const long sessionId) {
78 cancel_operation(sessionId);
79}
80
81std::shared_ptr<std::list<std::shared_ptr<ffmpegkit::FFmpegSession>>> ffmpegkit::FFmpegKit::listSessions() {
83}
const void * _ffmpegKitInitializeri
Definition: FFmpegKit.cpp:30
void * ffmpegKitInitialize()
static ffmpegkit::LogCallback logCallback
static ffmpegkit::StatisticsCallback statisticsCallback
static std::list< std::string > parseArguments(const std::string &command)
static void asyncFFmpegExecute(const std::shared_ptr< ffmpegkit::FFmpegSession > ffmpegSession)
static std::shared_ptr< std::list< std::shared_ptr< ffmpegkit::FFmpegSession > > > getFFmpegSessions()
static void ffmpegExecute(const std::shared_ptr< ffmpegkit::FFmpegSession > ffmpegSession)
static std::shared_ptr< std::list< std::shared_ptr< ffmpegkit::FFmpegSession > > > listSessions()
Definition: FFmpegKit.cpp:81
static std::shared_ptr< ffmpegkit::FFmpegSession > executeWithArgumentsAsync(const std::list< std::string > &arguments, FFmpegSessionCompleteCallback completeCallback)
Definition: FFmpegKit.cpp:38
static std::shared_ptr< ffmpegkit::FFmpegSession > executeWithArguments(const std::list< std::string > &arguments)
Definition: FFmpegKit.cpp:32
static std::shared_ptr< ffmpegkit::FFmpegSession > executeAsync(const std::string command, FFmpegSessionCompleteCallback completeCallback)
Definition: FFmpegKit.cpp:56
static void cancel()
Definition: FFmpegKit.cpp:68
static std::shared_ptr< ffmpegkit::FFmpegSession > execute(const std::string command)
Definition: FFmpegKit.cpp:50
static std::shared_ptr< ffmpegkit::FFmpegSession > create(const std::list< std::string > &arguments)
void cancel_operation(long id)
std::function< void(const std::shared_ptr< ffmpegkit::Statistics > statistics)> StatisticsCallback
std::function< void(const std::shared_ptr< ffmpegkit::Log > log)> LogCallback
Definition: LogCallback.h:35
std::function< void(const std::shared_ptr< ffmpegkit::FFmpegSession > session)> FFmpegSessionCompleteCallback