FFmpegKit Linux API 5.1
FFprobeSession.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 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#include "FFprobeSession.h"
21#include "FFmpegKitConfig.h"
22#include "LogCallback.h"
23
24extern void addSessionToSessionHistory(const std::shared_ptr<ffmpegkit::Session> session);
25
26std::shared_ptr<ffmpegkit::FFprobeSession> ffmpegkit::FFprobeSession::create(const std::list<std::string>& arguments) {
27 auto session = std::static_pointer_cast<ffmpegkit::FFprobeSession>(std::make_shared<ffmpegkit::FFprobeSession::PublicFFprobeSession>(arguments, nullptr, nullptr, ffmpegkit::FFmpegKitConfig::getLogRedirectionStrategy()));
29 return session;
30}
31
32std::shared_ptr<ffmpegkit::FFprobeSession> ffmpegkit::FFprobeSession::create(const std::list<std::string>& arguments, const FFprobeSessionCompleteCallback completeCallback) {
33 auto session = std::static_pointer_cast<ffmpegkit::FFprobeSession>(std::make_shared<ffmpegkit::FFprobeSession::PublicFFprobeSession>(arguments, completeCallback, nullptr, ffmpegkit::FFmpegKitConfig::getLogRedirectionStrategy()));
35 return session;
36}
37
38std::shared_ptr<ffmpegkit::FFprobeSession> ffmpegkit::FFprobeSession::create(const std::list<std::string>& arguments, const FFprobeSessionCompleteCallback completeCallback, const ffmpegkit::LogCallback logCallback) {
39 auto session = std::static_pointer_cast<ffmpegkit::FFprobeSession>(std::make_shared<ffmpegkit::FFprobeSession::PublicFFprobeSession>(arguments, completeCallback, logCallback, ffmpegkit::FFmpegKitConfig::getLogRedirectionStrategy()));
41 return session;
42}
43
44std::shared_ptr<ffmpegkit::FFprobeSession> ffmpegkit::FFprobeSession::create(const std::list<std::string>& arguments, const FFprobeSessionCompleteCallback completeCallback, const ffmpegkit::LogCallback logCallback, const LogRedirectionStrategy logRedirectionStrategy) {
45 auto session = std::static_pointer_cast<ffmpegkit::FFprobeSession>(std::make_shared<ffmpegkit::FFprobeSession::PublicFFprobeSession>(arguments, completeCallback, logCallback, logRedirectionStrategy));
47 return session;
48}
49
50struct ffmpegkit::FFprobeSession::PublicFFprobeSession : public ffmpegkit::FFprobeSession {
51 PublicFFprobeSession(const std::list<std::string>& arguments, const FFprobeSessionCompleteCallback completeCallback, const ffmpegkit::LogCallback logCallback, const LogRedirectionStrategy logRedirectionStrategy) :
52 FFprobeSession(arguments, completeCallback, logCallback, logRedirectionStrategy) {
53 }
54};
55
56ffmpegkit::FFprobeSession::FFprobeSession(const std::list<std::string>& arguments, const FFprobeSessionCompleteCallback completeCallback, const ffmpegkit::LogCallback logCallback, const LogRedirectionStrategy logRedirectionStrategy) :
57 ffmpegkit::AbstractSession(arguments, logCallback, logRedirectionStrategy), _completeCallback{completeCallback} {
58}
59
61 return _completeCallback;
62}
63
65 return false;
66}
67
69 return true;
70}
71
73 return false;
74}
static ffmpegkit::LogCallback logCallback
void addSessionToSessionHistory(const std::shared_ptr< ffmpegkit::Session > session)
static LogRedirectionStrategy getLogRedirectionStrategy()
bool isFFmpeg() const override
ffmpegkit::FFprobeSessionCompleteCallback getCompleteCallback()
bool isMediaInformation() const override
bool isFFprobe() const override
static std::shared_ptr< ffmpegkit::FFprobeSession > create(const std::list< std::string > &arguments)
FFprobeSession(const std::list< std::string > &arguments, const FFprobeSessionCompleteCallback completeCallback, const ffmpegkit::LogCallback logCallback, const LogRedirectionStrategy logRedirectionStrategy)
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