| FFmpegKit Linux API 6.0

Loading...
Searching...
No Matches
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
24 extern 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()));
28 addSessionToSessionHistory(session);
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()));
34 addSessionToSessionHistory(session);
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()));
40 addSessionToSessionHistory(session);
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));
46 addSessionToSessionHistory(session);
47 return session;
48}
49
50 struct 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
56 ffmpegkit::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
60 ffmpegkit::FFprobeSessionCompleteCallback ffmpegkit::FFprobeSession::getCompleteCallback() {
61 return _completeCallback;
62}
63
64 bool ffmpegkit::FFprobeSession::isFFmpeg() const {
65 return false;
66}
67
68 bool ffmpegkit::FFprobeSession::isFFprobe() const {
69 return true;
70}
71
72 bool ffmpegkit::FFprobeSession::isMediaInformation() const {
73 return false;
74}
addSessionToSessionHistory
void addSessionToSessionHistory(const std::shared_ptr< ffmpegkit::Session > session)
Definition FFmpegKitConfig.cpp:165
logCallback
static ffmpegkit::LogCallback logCallback
Definition FFmpegKitConfig.cpp:69
FFmpegKitConfig.h
addSessionToSessionHistory
void addSessionToSessionHistory(const std::shared_ptr< ffmpegkit::Session > session)
Definition FFmpegKitConfig.cpp:165
FFprobeSession.h
LogCallback.h
ffmpegkit::AbstractSession
Definition AbstractSession.h:31
ffmpegkit::FFmpegKitConfig::getLogRedirectionStrategy
static LogRedirectionStrategy getLogRedirectionStrategy()
Definition FFmpegKitConfig.cpp:1344
ffmpegkit::FFprobeSession
Definition FFprobeSession.h:31
ffmpegkit::FFprobeSession::isFFmpeg
bool isFFmpeg() const override
Definition FFprobeSession.cpp:64
ffmpegkit::FFprobeSession::getCompleteCallback
ffmpegkit::FFprobeSessionCompleteCallback getCompleteCallback()
Definition FFprobeSession.cpp:60
ffmpegkit::FFprobeSession::isMediaInformation
bool isMediaInformation() const override
Definition FFprobeSession.cpp:72
ffmpegkit::FFprobeSession::isFFprobe
bool isFFprobe() const override
Definition FFprobeSession.cpp:68
ffmpegkit::FFprobeSession::create
static std::shared_ptr< ffmpegkit::FFprobeSession > create(const std::list< std::string > &arguments)
Definition FFprobeSession.cpp:26
ffmpegkit::FFprobeSession::FFprobeSession
FFprobeSession(const std::list< std::string > &arguments, const FFprobeSessionCompleteCallback completeCallback, const ffmpegkit::LogCallback logCallback, const LogRedirectionStrategy logRedirectionStrategy)
Definition FFprobeSession.cpp:56
ffmpegkit
Definition AbstractSession.h:25
ffmpegkit::LogRedirectionStrategy
LogRedirectionStrategy
Definition LogRedirectionStrategy.h:25
ffmpegkit::LogCallback
std::function< void(const std::shared_ptr< ffmpegkit::Log > log)> LogCallback
Definition LogCallback.h:35
ffmpegkit::FFprobeSessionCompleteCallback
std::function< void(const std::shared_ptr< ffmpegkit::FFprobeSession > session)> FFprobeSessionCompleteCallback
Definition FFprobeSessionCompleteCallback.h:52