FFmpegKit Linux API 6.0
Loading...
Searching...
No Matches
MediaInformationSession.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
21#include "LogCallback.h"
22#include "MediaInformation.h"
23
24extern void addSessionToSessionHistory(const std::shared_ptr<ffmpegkit::Session> session);
25
26std::shared_ptr<ffmpegkit::MediaInformationSession> ffmpegkit::MediaInformationSession::create(const std::list<std::string>& arguments) {
27 auto session = std::static_pointer_cast<ffmpegkit::MediaInformationSession>(std::make_shared<ffmpegkit::MediaInformationSession::PublicMediaInformationSession>(arguments, nullptr, nullptr));
29 return session;
30}
31
32std::shared_ptr<ffmpegkit::MediaInformationSession> ffmpegkit::MediaInformationSession::create(const std::list<std::string>& arguments, ffmpegkit::MediaInformationSessionCompleteCallback completeCallback) {
33 auto session = std::static_pointer_cast<ffmpegkit::MediaInformationSession>(std::make_shared<ffmpegkit::MediaInformationSession::PublicMediaInformationSession>(arguments, completeCallback, nullptr));
35 return session;
36}
37
38std::shared_ptr<ffmpegkit::MediaInformationSession> ffmpegkit::MediaInformationSession::create(const std::list<std::string>& arguments, ffmpegkit::MediaInformationSessionCompleteCallback completeCallback, ffmpegkit::LogCallback logCallback) {
39 auto session = std::static_pointer_cast<ffmpegkit::MediaInformationSession>(std::make_shared<ffmpegkit::MediaInformationSession::PublicMediaInformationSession>(arguments, completeCallback, logCallback));
41 return session;
42}
43
44struct ffmpegkit::MediaInformationSession::PublicMediaInformationSession : public ffmpegkit::MediaInformationSession {
45 PublicMediaInformationSession(const std::list<std::string>& arguments, ffmpegkit::MediaInformationSessionCompleteCallback completeCallback, ffmpegkit::LogCallback logCallback) :
46 MediaInformationSession(arguments, completeCallback, logCallback) {
47 }
48};
49
51 ffmpegkit::AbstractSession(arguments, logCallback, ffmpegkit::LogRedirectionStrategyNeverPrintLogs), _completeCallback{completeCallback}, _mediaInformation{nullptr} {
52}
53
54std::shared_ptr<ffmpegkit::MediaInformation> ffmpegkit::MediaInformationSession::getMediaInformation() {
55 return _mediaInformation;
56}
57
58void ffmpegkit::MediaInformationSession::setMediaInformation(const std::shared_ptr<ffmpegkit::MediaInformation> mediaInformation) {
59 _mediaInformation = mediaInformation;
60}
61
63 return _completeCallback;
64}
65
67 return false;
68}
69
71 return false;
72}
73
75 return true;
76}
void addSessionToSessionHistory(const std::shared_ptr< ffmpegkit::Session > session)
static ffmpegkit::LogCallback logCallback
void addSessionToSessionHistory(const std::shared_ptr< ffmpegkit::Session > session)
MediaInformationSession(const std::list< std::string > &arguments, ffmpegkit::MediaInformationSessionCompleteCallback completeCallback, ffmpegkit::LogCallback logCallback)
std::shared_ptr< ffmpegkit::MediaInformation > getMediaInformation()
ffmpegkit::MediaInformationSessionCompleteCallback getCompleteCallback()
void setMediaInformation(const std::shared_ptr< ffmpegkit::MediaInformation > mediaInformation)
static std::shared_ptr< ffmpegkit::MediaInformationSession > create(const std::list< std::string > &arguments)
std::function< void(const std::shared_ptr< ffmpegkit::MediaInformationSession > session)> MediaInformationSessionCompleteCallback
std::function< void(const std::shared_ptr< ffmpegkit::Log > log)> LogCallback
Definition LogCallback.h:35