| FFmpegKit Linux API 6.0

Loading...
Searching...
No Matches
FFmpegSession.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 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 License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General License
17 * along with FFmpegKit. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#ifndef FFMPEG_KIT_FFMPEG_SESSION_H
21#define FFMPEG_KIT_FFMPEG_SESSION_H
22
23#include "AbstractSession.h"
24#include "StatisticsCallback.h"
25#include "FFmpegSessionCompleteCallback.h"
26
27 namespace ffmpegkit {
28
32 class FFmpegSession : public AbstractSession {
33 public:
34
41 static std::shared_ptr<ffmpegkit::FFmpegSession> create(const std::list<std::string>& arguments);
42
50 static std::shared_ptr<ffmpegkit::FFmpegSession> create(const std::list<std::string>& arguments, ffmpegkit::FFmpegSessionCompleteCallback completeCallback);
51
61 static std::shared_ptr<ffmpegkit::FFmpegSession> create(const std::list<std::string>& arguments, ffmpegkit::FFmpegSessionCompleteCallback completeCallback, ffmpegkit::LogCallback logCallback, ffmpegkit::StatisticsCallback statisticsCallback);
62
73 static std::shared_ptr<ffmpegkit::FFmpegSession> create(const std::list<std::string>& arguments, ffmpegkit::FFmpegSessionCompleteCallback completeCallback, ffmpegkit::LogCallback logCallback, ffmpegkit::StatisticsCallback statisticsCallback, ffmpegkit::LogRedirectionStrategy logRedirectionStrategy);
74
80 ffmpegkit::StatisticsCallback getStatisticsCallback();
81
87 ffmpegkit::FFmpegSessionCompleteCallback getCompleteCallback();
88
96 std::shared_ptr<std::list<std::shared_ptr<ffmpegkit::Statistics>>> getAllStatisticsWithTimeout(const int waitTimeout);
97
105 std::shared_ptr<std::list<std::shared_ptr<ffmpegkit::Statistics>>> getAllStatistics();
106
114 std::shared_ptr<std::list<std::shared_ptr<ffmpegkit::Statistics>>> getStatistics();
115
122 std::shared_ptr<ffmpegkit::Statistics> getLastReceivedStatistics();
123
130 void addStatistics(const std::shared_ptr<ffmpegkit::Statistics> statistics);
131
137 bool isFFmpeg() const override;
138
144 bool isFFprobe() const override;
145
151 bool isMediaInformation() const override;
152
153 private:
154
155 struct PublicFFmpegSession;
156
166 FFmpegSession(const std::list<std::string>& arguments, ffmpegkit::FFmpegSessionCompleteCallback completeCallback, ffmpegkit::LogCallback logCallback, ffmpegkit::StatisticsCallback statisticsCallback, ffmpegkit::LogRedirectionStrategy logRedirectionStrategy);
167
168 ffmpegkit::StatisticsCallback _statisticsCallback;
169 FFmpegSessionCompleteCallback _completeCallback;
170 std::shared_ptr<std::list<std::shared_ptr<ffmpegkit::Statistics>>> _statistics;
171 };
172
173}
174
175#endif // FFMPEG_KIT_FFMPEG_SESSION_H
AbstractSession.h
logCallback
static ffmpegkit::LogCallback logCallback
Definition FFmpegKitConfig.cpp:69
statisticsCallback
static ffmpegkit::StatisticsCallback statisticsCallback
Definition FFmpegKitConfig.cpp:72
FFmpegSessionCompleteCallback.h
StatisticsCallback.h
ffmpegkit::AbstractSession
Definition AbstractSession.h:31
ffmpegkit::FFmpegSession
Definition FFmpegSession.h:32
ffmpegkit::FFmpegSession::getStatisticsCallback
ffmpegkit::StatisticsCallback getStatisticsCallback()
Definition FFmpegSession.cpp:61
ffmpegkit::FFmpegSession::isFFprobe
bool isFFprobe() const override
Definition FFmpegSession.cpp:103
ffmpegkit::FFmpegSession::addStatistics
void addStatistics(const std::shared_ptr< ffmpegkit::Statistics > statistics)
Definition FFmpegSession.cpp:95
ffmpegkit::FFmpegSession::_completeCallback
FFmpegSessionCompleteCallback _completeCallback
Definition FFmpegSession.h:169
ffmpegkit::FFmpegSession::_statisticsCallback
ffmpegkit::StatisticsCallback _statisticsCallback
Definition FFmpegSession.h:168
ffmpegkit::FFmpegSession::_statistics
std::shared_ptr< std::list< std::shared_ptr< ffmpegkit::Statistics > > > _statistics
Definition FFmpegSession.h:170
ffmpegkit::FFmpegSession::getAllStatistics
std::shared_ptr< std::list< std::shared_ptr< ffmpegkit::Statistics > > > getAllStatistics()
Definition FFmpegSession.cpp:79
ffmpegkit::FFmpegSession::getCompleteCallback
ffmpegkit::FFmpegSessionCompleteCallback getCompleteCallback()
Definition FFmpegSession.cpp:65
ffmpegkit::FFmpegSession::isFFmpeg
bool isFFmpeg() const override
Definition FFmpegSession.cpp:99
ffmpegkit::FFmpegSession::getLastReceivedStatistics
std::shared_ptr< ffmpegkit::Statistics > getLastReceivedStatistics()
Definition FFmpegSession.cpp:87
ffmpegkit::FFmpegSession::getAllStatisticsWithTimeout
std::shared_ptr< std::list< std::shared_ptr< ffmpegkit::Statistics > > > getAllStatisticsWithTimeout(const int waitTimeout)
Definition FFmpegSession.cpp:69
ffmpegkit::FFmpegSession::isMediaInformation
bool isMediaInformation() const override
Definition FFmpegSession.cpp:107
ffmpegkit::FFmpegSession::getStatistics
std::shared_ptr< std::list< std::shared_ptr< ffmpegkit::Statistics > > > getStatistics()
Definition FFmpegSession.cpp:83
ffmpegkit::FFmpegSession::create
static std::shared_ptr< ffmpegkit::FFmpegSession > create(const std::list< std::string > &arguments)
Definition FFmpegSession.cpp:27
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::LogCallback
std::function< void(const std::shared_ptr< ffmpegkit::Log > log)> LogCallback
Definition LogCallback.h:35
ffmpegkit::FFmpegSessionCompleteCallback
std::function< void(const std::shared_ptr< ffmpegkit::FFmpegSession > session)> FFmpegSessionCompleteCallback
Definition FFmpegSessionCompleteCallback.h:52