# FFmpegKit Linux API: FFmpegSession.h Source File

FFmpegSession.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 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 License for more details.
*
* You should have received a copy of the GNU Lesser General License
* along with FFmpegKit. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef FFMPEG_KIT_FFMPEG_SESSION_H
#define FFMPEG_KIT_FFMPEG_SESSION_H
#include "AbstractSession.h"
#include "StatisticsCallback.h"
#include "FFmpegSessionCompleteCallback.h"
namespace ffmpegkit {
class FFmpegSession : public AbstractSession {
public:
static std::shared_ptr<ffmpegkit::FFmpegSession> create(const std::list<std::string>& arguments);
static std::shared_ptr<ffmpegkit::FFmpegSession> create(const std::list<std::string>& arguments, ffmpegkit::FFmpegSessionCompleteCallback completeCallback);
static std::shared_ptr<ffmpegkit::FFmpegSession> create(const std::list<std::string>& arguments, ffmpegkit::FFmpegSessionCompleteCallback completeCallback, ffmpegkit::LogCallback logCallback, ffmpegkit::StatisticsCallback statisticsCallback);
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);
ffmpegkit::StatisticsCallback getStatisticsCallback();
ffmpegkit::FFmpegSessionCompleteCallback getCompleteCallback();
std::shared_ptr<std::list<std::shared_ptr<ffmpegkit::Statistics>>> getAllStatisticsWithTimeout(const int waitTimeout);
std::shared_ptr<std::list<std::shared_ptr<ffmpegkit::Statistics>>> getAllStatistics();
std::shared_ptr<std::list<std::shared_ptr<ffmpegkit::Statistics>>> getStatistics();
std::shared_ptr<ffmpegkit::Statistics> getLastReceivedStatistics();
void addStatistics(const std::shared_ptr<ffmpegkit::Statistics> statistics);
bool isFFmpeg() const override;
bool isFFprobe() const override;
bool isMediaInformation() const override;
private:
struct PublicFFmpegSession;
FFmpegSession(const std::list<std::string>& arguments, ffmpegkit::FFmpegSessionCompleteCallback completeCallback, ffmpegkit::LogCallback logCallback, ffmpegkit::StatisticsCallback statisticsCallback, ffmpegkit::LogRedirectionStrategy logRedirectionStrategy);
ffmpegkit::StatisticsCallback _statisticsCallback;
FFmpegSessionCompleteCallback _completeCallback;
std::shared_ptr<std::list<std::shared_ptr<ffmpegkit::Statistics>>> _statistics;
};
}
#endif // FFMPEG_KIT_FFMPEG_SESSION_H
AbstractSession.h
logCallback
static ffmpegkit::LogCallback logCallback
Definition: FFmpegKitConfig.cpp:64
statisticsCallback
static ffmpegkit::StatisticsCallback statisticsCallback
Definition: FFmpegKitConfig.cpp:67
FFmpegSessionCompleteCallback.h
StatisticsCallback.h
ffmpegkit::AbstractSession
Definition: AbstractSession.h:31
ffmpegkit::FFmpegSession
Definition: FFmpegSession.h:32
ffmpegkit::FFmpegSession::FFmpegSession
FFmpegSession(const std::list< std::string > &arguments, ffmpegkit::FFmpegSessionCompleteCallback completeCallback, ffmpegkit::LogCallback logCallback, ffmpegkit::StatisticsCallback statisticsCallback, ffmpegkit::LogRedirectionStrategy logRedirectionStrategy)
Definition: FFmpegSession.cpp:57
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:165
ffmpegkit::FFmpegSession::_statisticsCallback
ffmpegkit::StatisticsCallback _statisticsCallback
Definition: FFmpegSession.h:164
ffmpegkit::FFmpegSession::_statistics
std::shared_ptr< std::list< std::shared_ptr< ffmpegkit::Statistics > > > _statistics
Definition: FFmpegSession.h:166
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