From b7eba6d709d74cc06b158acc135a778dfa1fd730 Mon Sep 17 00:00:00 2001 From: Taner Sener Date: Wed, 24 Aug 2022 04:21:13 +0100 Subject: [PATCH] update argument list types in linux api --- linux/src/AbstractSession.cpp | 4 ++-- linux/src/AbstractSession.h | 2 +- linux/src/FFmpegKit.cpp | 6 +++--- linux/src/FFmpegKit.h | 6 +++--- linux/src/FFmpegKitConfig.cpp | 8 ++++---- linux/src/FFmpegKitConfig.h | 2 +- linux/src/FFmpegSession.cpp | 12 ++++++------ linux/src/FFmpegSession.h | 10 +++++----- linux/src/FFprobeKit.cpp | 21 +++++---------------- linux/src/FFprobeKit.h | 6 +++--- linux/src/FFprobeSession.cpp | 12 ++++++------ linux/src/FFprobeSession.h | 10 +++++----- linux/src/MediaInformationSession.cpp | 10 +++++----- linux/src/MediaInformationSession.h | 8 ++++---- 14 files changed, 53 insertions(+), 64 deletions(-) diff --git a/linux/src/AbstractSession.cpp b/linux/src/AbstractSession.cpp index a04003a..1588e4d 100644 --- a/linux/src/AbstractSession.cpp +++ b/linux/src/AbstractSession.cpp @@ -33,8 +33,8 @@ static std::atomic sessionIdGenerator(1); extern void addSessionToSessionHistory(const std::shared_ptr session); -ffmpegkit::AbstractSession::AbstractSession(const std::shared_ptr> arguments, const ffmpegkit::LogCallback logCallback, const LogRedirectionStrategy logRedirectionStrategy) : - _arguments{arguments}, +ffmpegkit::AbstractSession::AbstractSession(const std::list& arguments, const ffmpegkit::LogCallback logCallback, const LogRedirectionStrategy logRedirectionStrategy) : + _arguments{std::make_shared>(arguments)}, _sessionId{sessionIdGenerator++}, _logCallback{logCallback}, _createTime{std::chrono::system_clock::now()}, diff --git a/linux/src/AbstractSession.h b/linux/src/AbstractSession.h index b247301..85fc7c1 100644 --- a/linux/src/AbstractSession.h +++ b/linux/src/AbstractSession.h @@ -43,7 +43,7 @@ namespace ffmpegkit { * @param logCallback session specific log callback * @param logRedirectionStrategy session specific log redirection strategy */ - AbstractSession(const std::shared_ptr> arguments, const ffmpegkit::LogCallback logCallback, const LogRedirectionStrategy logRedirectionStrategy); + AbstractSession(const std::list& arguments, const ffmpegkit::LogCallback logCallback, const LogRedirectionStrategy logRedirectionStrategy); /** * Waits for all asynchronous messages to be transmitted until the given timeout. diff --git a/linux/src/FFmpegKit.cpp b/linux/src/FFmpegKit.cpp index 83682e6..d9201db 100644 --- a/linux/src/FFmpegKit.cpp +++ b/linux/src/FFmpegKit.cpp @@ -29,19 +29,19 @@ extern void* ffmpegKitInitialize(); const void* _ffmpegKitInitializeri{ffmpegKitInitialize()}; -std::shared_ptr ffmpegkit::FFmpegKit::executeWithArguments(const std::shared_ptr> arguments) { +std::shared_ptr ffmpegkit::FFmpegKit::executeWithArguments(const std::list& arguments) { auto session = ffmpegkit::FFmpegSession::create(arguments); ffmpegkit::FFmpegKitConfig::ffmpegExecute(session); return session; } -std::shared_ptr ffmpegkit::FFmpegKit::executeWithArgumentsAsync(const std::shared_ptr> arguments, FFmpegSessionCompleteCallback completeCallback) { +std::shared_ptr ffmpegkit::FFmpegKit::executeWithArgumentsAsync(const std::list& arguments, FFmpegSessionCompleteCallback completeCallback) { auto session = ffmpegkit::FFmpegSession::create(arguments, completeCallback); ffmpegkit::FFmpegKitConfig::asyncFFmpegExecute(session); return session; } -std::shared_ptr ffmpegkit::FFmpegKit::executeWithArgumentsAsync(const std::shared_ptr> arguments, FFmpegSessionCompleteCallback completeCallback, ffmpegkit::LogCallback logCallback, ffmpegkit::StatisticsCallback statisticsCallback) { +std::shared_ptr ffmpegkit::FFmpegKit::executeWithArgumentsAsync(const std::list& arguments, FFmpegSessionCompleteCallback completeCallback, ffmpegkit::LogCallback logCallback, ffmpegkit::StatisticsCallback statisticsCallback) { auto session = ffmpegkit::FFmpegSession::create(arguments, completeCallback, logCallback, statisticsCallback); ffmpegkit::FFmpegKitConfig::asyncFFmpegExecute(session); return session; diff --git a/linux/src/FFmpegKit.h b/linux/src/FFmpegKit.h index 2fc892a..f591d44 100644 --- a/linux/src/FFmpegKit.h +++ b/linux/src/FFmpegKit.h @@ -50,7 +50,7 @@ namespace ffmpegkit { * @param arguments FFmpeg command options/arguments as string list * @return FFmpeg session created for this execution */ - static std::shared_ptr executeWithArguments(const std::shared_ptr> arguments); + static std::shared_ptr executeWithArguments(const std::list& arguments); /** *

Starts an asynchronous FFmpeg execution with arguments provided. @@ -62,7 +62,7 @@ namespace ffmpegkit { * @param completeCallback callback that will be called when the execution has completed * @return FFmpeg session created for this execution */ - static std::shared_ptr executeWithArgumentsAsync(const std::shared_ptr> arguments, FFmpegSessionCompleteCallback completeCallback); + static std::shared_ptr executeWithArgumentsAsync(const std::list& arguments, FFmpegSessionCompleteCallback completeCallback); /** *

Starts an asynchronous FFmpeg execution with arguments provided. @@ -76,7 +76,7 @@ namespace ffmpegkit { * @param statisticsCallback callback that will receive statistics * @return FFmpeg session created for this execution */ - static std::shared_ptr executeWithArgumentsAsync(const std::shared_ptr> arguments, FFmpegSessionCompleteCallback completeCallback, ffmpegkit::LogCallback logCallback, ffmpegkit::StatisticsCallback statisticsCallback); + static std::shared_ptr executeWithArgumentsAsync(const std::list& arguments, FFmpegSessionCompleteCallback completeCallback, ffmpegkit::LogCallback logCallback, ffmpegkit::StatisticsCallback statisticsCallback); /** *

Synchronously executes FFmpeg command provided. Space character is used to split command diff --git a/linux/src/FFmpegKitConfig.cpp b/linux/src/FFmpegKitConfig.cpp index 6c23028..300b9ea 100644 --- a/linux/src/FFmpegKitConfig.cpp +++ b/linux/src/FFmpegKitConfig.cpp @@ -1350,8 +1350,8 @@ std::string ffmpegkit::FFmpegKitConfig::sessionStateToString(SessionState state) } } -std::shared_ptr> ffmpegkit::FFmpegKitConfig::parseArguments(const std::string& command) { - auto argumentList = std::make_shared>(); +std::list ffmpegkit::FFmpegKitConfig::parseArguments(const std::string& command) { + std::list argumentList; std::string currentArgument; bool singleQuoteStarted = false; @@ -1370,7 +1370,7 @@ std::shared_ptr> ffmpegkit::FFmpegKitConfig::parseArgumen if (singleQuoteStarted || doubleQuoteStarted) { currentArgument += currentChar; } else if (currentArgument.size() > 0) { - argumentList->push_back(currentArgument); + argumentList.push_back(currentArgument); currentArgument = ""; } } else if (currentChar == '\'' && (previousChar == 0 || previousChar != '\\')) { @@ -1395,7 +1395,7 @@ std::shared_ptr> ffmpegkit::FFmpegKitConfig::parseArgumen } if (currentArgument.size() > 0) { - argumentList->push_back(currentArgument); + argumentList.push_back(currentArgument); } return argumentList; diff --git a/linux/src/FFmpegKitConfig.h b/linux/src/FFmpegKitConfig.h index 62ba68d..f5cd9e8 100644 --- a/linux/src/FFmpegKitConfig.h +++ b/linux/src/FFmpegKitConfig.h @@ -414,7 +414,7 @@ namespace ffmpegkit { * @param command string command * @return list of arguments */ - static std::shared_ptr> parseArguments(const std::string& command); + static std::list parseArguments(const std::string& command); /** *

Concatenates arguments into a string adding a space character between two arguments. diff --git a/linux/src/FFmpegSession.cpp b/linux/src/FFmpegSession.cpp index da36d20..b76103e 100644 --- a/linux/src/FFmpegSession.cpp +++ b/linux/src/FFmpegSession.cpp @@ -24,37 +24,37 @@ extern void addSessionToSessionHistory(const std::shared_ptr session); -std::shared_ptr ffmpegkit::FFmpegSession::create(const std::shared_ptr> arguments) { +std::shared_ptr ffmpegkit::FFmpegSession::create(const std::list& arguments) { std::shared_ptr session = std::static_pointer_cast(std::make_shared(arguments, nullptr, nullptr, nullptr, ffmpegkit::FFmpegKitConfig::getLogRedirectionStrategy())); addSessionToSessionHistory(session); return session; } -std::shared_ptr ffmpegkit::FFmpegSession::create(const std::shared_ptr> arguments, FFmpegSessionCompleteCallback completeCallback) { +std::shared_ptr ffmpegkit::FFmpegSession::create(const std::list& arguments, FFmpegSessionCompleteCallback completeCallback) { std::shared_ptr session = std::static_pointer_cast(std::make_shared(arguments, completeCallback, nullptr, nullptr, ffmpegkit::FFmpegKitConfig::getLogRedirectionStrategy())); addSessionToSessionHistory(session); return session; } -std::shared_ptr ffmpegkit::FFmpegSession::create(const std::shared_ptr> arguments, FFmpegSessionCompleteCallback completeCallback, ffmpegkit::LogCallback logCallback, ffmpegkit::StatisticsCallback statisticsCallback) { +std::shared_ptr ffmpegkit::FFmpegSession::create(const std::list& arguments, FFmpegSessionCompleteCallback completeCallback, ffmpegkit::LogCallback logCallback, ffmpegkit::StatisticsCallback statisticsCallback) { std::shared_ptr session = std::static_pointer_cast(std::make_shared(arguments, completeCallback, logCallback, statisticsCallback, ffmpegkit::FFmpegKitConfig::getLogRedirectionStrategy())); addSessionToSessionHistory(session); return session; } -std::shared_ptr ffmpegkit::FFmpegSession::create(const std::shared_ptr> arguments, FFmpegSessionCompleteCallback completeCallback, ffmpegkit::LogCallback logCallback, ffmpegkit::StatisticsCallback statisticsCallback, LogRedirectionStrategy logRedirectionStrategy) { +std::shared_ptr ffmpegkit::FFmpegSession::create(const std::list& arguments, FFmpegSessionCompleteCallback completeCallback, ffmpegkit::LogCallback logCallback, ffmpegkit::StatisticsCallback statisticsCallback, LogRedirectionStrategy logRedirectionStrategy) { std::shared_ptr session = std::static_pointer_cast(std::make_shared(arguments, completeCallback, logCallback, statisticsCallback, logRedirectionStrategy)); addSessionToSessionHistory(session); return session; } struct ffmpegkit::FFmpegSession::PublicFFmpegSession : public ffmpegkit::FFmpegSession { - PublicFFmpegSession(const std::shared_ptr> arguments, FFmpegSessionCompleteCallback completeCallback, ffmpegkit::LogCallback logCallback, ffmpegkit::StatisticsCallback statisticsCallback, LogRedirectionStrategy logRedirectionStrategy) : + PublicFFmpegSession(const std::list& arguments, FFmpegSessionCompleteCallback completeCallback, ffmpegkit::LogCallback logCallback, ffmpegkit::StatisticsCallback statisticsCallback, LogRedirectionStrategy logRedirectionStrategy) : FFmpegSession(arguments, completeCallback, logCallback, statisticsCallback, logRedirectionStrategy) { } }; -ffmpegkit::FFmpegSession::FFmpegSession(const std::shared_ptr> arguments, FFmpegSessionCompleteCallback completeCallback, ffmpegkit::LogCallback logCallback, ffmpegkit::StatisticsCallback statisticsCallback, LogRedirectionStrategy logRedirectionStrategy) : +ffmpegkit::FFmpegSession::FFmpegSession(const std::list& arguments, FFmpegSessionCompleteCallback completeCallback, ffmpegkit::LogCallback logCallback, ffmpegkit::StatisticsCallback statisticsCallback, LogRedirectionStrategy logRedirectionStrategy) : ffmpegkit::AbstractSession(arguments, logCallback, logRedirectionStrategy), _completeCallback{completeCallback}, _statisticsCallback{statisticsCallback}, _statistics{std::make_shared>>()} { } diff --git a/linux/src/FFmpegSession.h b/linux/src/FFmpegSession.h index 048125d..a684833 100644 --- a/linux/src/FFmpegSession.h +++ b/linux/src/FFmpegSession.h @@ -37,7 +37,7 @@ namespace ffmpegkit { * * @param arguments command arguments */ - static std::shared_ptr create(const std::shared_ptr> arguments); + static std::shared_ptr create(const std::list& arguments); /** * Builds a new FFmpeg session. @@ -45,7 +45,7 @@ namespace ffmpegkit { * @param arguments command arguments * @param completeCallback session specific complete callback */ - static std::shared_ptr create(const std::shared_ptr> arguments, ffmpegkit::FFmpegSessionCompleteCallback completeCallback); + static std::shared_ptr create(const std::list& arguments, ffmpegkit::FFmpegSessionCompleteCallback completeCallback); /** * Builds a new FFmpeg session. @@ -55,7 +55,7 @@ namespace ffmpegkit { * @param logCallback session specific log callback * @param statisticsCallback session specific statistics callback */ - static std::shared_ptr create(const std::shared_ptr> arguments, ffmpegkit::FFmpegSessionCompleteCallback completeCallback, ffmpegkit::LogCallback logCallback, ffmpegkit::StatisticsCallback statisticsCallback); + static std::shared_ptr create(const std::list& arguments, ffmpegkit::FFmpegSessionCompleteCallback completeCallback, ffmpegkit::LogCallback logCallback, ffmpegkit::StatisticsCallback statisticsCallback); /** * Builds a new FFmpeg session. @@ -66,7 +66,7 @@ namespace ffmpegkit { * @param statisticsCallback session specific statistics callback * @param logRedirectionStrategy session specific log redirection strategy */ - static std::shared_ptr create(const std::shared_ptr> arguments, ffmpegkit::FFmpegSessionCompleteCallback completeCallback, ffmpegkit::LogCallback logCallback, ffmpegkit::StatisticsCallback statisticsCallback, ffmpegkit::LogRedirectionStrategy logRedirectionStrategy); + static std::shared_ptr create(const std::list& arguments, ffmpegkit::FFmpegSessionCompleteCallback completeCallback, ffmpegkit::LogCallback logCallback, ffmpegkit::StatisticsCallback statisticsCallback, ffmpegkit::LogRedirectionStrategy logRedirectionStrategy); /** * Returns the session specific statistics callback. @@ -159,7 +159,7 @@ namespace ffmpegkit { * @param statisticsCallback session specific statistics callback * @param logRedirectionStrategy session specific log redirection strategy */ - FFmpegSession(const std::shared_ptr> arguments, ffmpegkit::FFmpegSessionCompleteCallback completeCallback, ffmpegkit::LogCallback logCallback, ffmpegkit::StatisticsCallback statisticsCallback, ffmpegkit::LogRedirectionStrategy logRedirectionStrategy); + FFmpegSession(const std::list& arguments, ffmpegkit::FFmpegSessionCompleteCallback completeCallback, ffmpegkit::LogCallback logCallback, ffmpegkit::StatisticsCallback statisticsCallback, ffmpegkit::LogRedirectionStrategy logRedirectionStrategy); ffmpegkit::StatisticsCallback _statisticsCallback; FFmpegSessionCompleteCallback _completeCallback; diff --git a/linux/src/FFprobeKit.cpp b/linux/src/FFprobeKit.cpp index 5c5771a..a060c6e 100644 --- a/linux/src/FFprobeKit.cpp +++ b/linux/src/FFprobeKit.cpp @@ -26,34 +26,23 @@ extern void* ffmpegKitInitialize(); const void* _ffprobeKitInitializer{ffmpegKitInitialize()}; -static std::shared_ptr> defaultGetMediaInformationCommandArguments(const std::string& path) { - std::shared_ptr> arguments = std::make_shared>(); - arguments->push_back(std::string("-v")); - arguments->push_back(std::string("error")); - arguments->push_back(std::string("-hide_banner")); - arguments->push_back(std::string("-print_format")); - arguments->push_back(std::string("json")); - arguments->push_back(std::string("-show_format")); - arguments->push_back(std::string("-show_streams")); - arguments->push_back(std::string("-show_chapters")); - arguments->push_back(std::string("-i")); - arguments->push_back(path); - return arguments; +static std::list defaultGetMediaInformationCommandArguments(const std::string& path) { + return std::list{"-v", "error", "-hide_banner", "-print_format", "json", "-show_format", "-show_streams", "-show_chapters", "-i", path}; } -std::shared_ptr ffmpegkit::FFprobeKit::executeWithArguments(const std::shared_ptr> arguments) { +std::shared_ptr ffmpegkit::FFprobeKit::executeWithArguments(const std::list& arguments) { auto session = ffmpegkit::FFprobeSession::create(arguments); ffmpegkit::FFmpegKitConfig::ffprobeExecute(session); return session; } -std::shared_ptr ffmpegkit::FFprobeKit::executeWithArgumentsAsync(const std::shared_ptr> arguments, FFprobeSessionCompleteCallback completeCallback) { +std::shared_ptr ffmpegkit::FFprobeKit::executeWithArgumentsAsync(const std::list& arguments, FFprobeSessionCompleteCallback completeCallback) { auto session = ffmpegkit::FFprobeSession::create(arguments, completeCallback); ffmpegkit::FFmpegKitConfig::asyncFFprobeExecute(session); return session; } -std::shared_ptr ffmpegkit::FFprobeKit::executeWithArgumentsAsync(const std::shared_ptr> arguments, FFprobeSessionCompleteCallback completeCallback, ffmpegkit::LogCallback logCallback) { +std::shared_ptr ffmpegkit::FFprobeKit::executeWithArgumentsAsync(const std::list& arguments, FFprobeSessionCompleteCallback completeCallback, ffmpegkit::LogCallback logCallback) { auto session = ffmpegkit::FFprobeSession::create(arguments, completeCallback, logCallback); ffmpegkit::FFmpegKitConfig::asyncFFprobeExecute(session); return session; diff --git a/linux/src/FFprobeKit.h b/linux/src/FFprobeKit.h index 9accd0e..24ecc8b 100644 --- a/linux/src/FFprobeKit.h +++ b/linux/src/FFprobeKit.h @@ -54,7 +54,7 @@ namespace ffmpegkit { * @param arguments FFprobe command options/arguments as string array * @return FFprobe session created for this execution */ - static std::shared_ptr executeWithArguments(const std::shared_ptr> arguments); + static std::shared_ptr executeWithArguments(const std::list& arguments); /** *

Starts an asynchronous FFprobe execution with arguments provided. @@ -66,7 +66,7 @@ namespace ffmpegkit { * @param completeCallback callback that will be called when the execution has completed * @return FFprobe session created for this execution */ - static std::shared_ptr executeWithArgumentsAsync(const std::shared_ptr> arguments, FFprobeSessionCompleteCallback completeCallback); + static std::shared_ptr executeWithArgumentsAsync(const std::list& arguments, FFprobeSessionCompleteCallback completeCallback); /** *

Starts an asynchronous FFprobe execution with arguments provided. @@ -79,7 +79,7 @@ namespace ffmpegkit { * @param logCallback callback that will receive logs * @return FFprobe session created for this execution */ - static std::shared_ptr executeWithArgumentsAsync(const std::shared_ptr> arguments, FFprobeSessionCompleteCallback completeCallback, ffmpegkit::LogCallback logCallback); + static std::shared_ptr executeWithArgumentsAsync(const std::list& arguments, FFprobeSessionCompleteCallback completeCallback, ffmpegkit::LogCallback logCallback); /** *

Synchronously executes FFprobe command provided. Space character is used to split command diff --git a/linux/src/FFprobeSession.cpp b/linux/src/FFprobeSession.cpp index 3e2895c..67ebff0 100644 --- a/linux/src/FFprobeSession.cpp +++ b/linux/src/FFprobeSession.cpp @@ -23,37 +23,37 @@ extern void addSessionToSessionHistory(const std::shared_ptr session); -std::shared_ptr ffmpegkit::FFprobeSession::create(const std::shared_ptr> arguments) { +std::shared_ptr ffmpegkit::FFprobeSession::create(const std::list& arguments) { auto session = std::static_pointer_cast(std::make_shared(arguments, nullptr, nullptr, ffmpegkit::FFmpegKitConfig::getLogRedirectionStrategy())); addSessionToSessionHistory(session); return session; } -std::shared_ptr ffmpegkit::FFprobeSession::create(const std::shared_ptr> arguments, const FFprobeSessionCompleteCallback completeCallback) { +std::shared_ptr ffmpegkit::FFprobeSession::create(const std::list& arguments, const FFprobeSessionCompleteCallback completeCallback) { auto session = std::static_pointer_cast(std::make_shared(arguments, completeCallback, nullptr, ffmpegkit::FFmpegKitConfig::getLogRedirectionStrategy())); addSessionToSessionHistory(session); return session; } -std::shared_ptr ffmpegkit::FFprobeSession::create(const std::shared_ptr> arguments, const FFprobeSessionCompleteCallback completeCallback, const ffmpegkit::LogCallback logCallback) { +std::shared_ptr ffmpegkit::FFprobeSession::create(const std::list& arguments, const FFprobeSessionCompleteCallback completeCallback, const ffmpegkit::LogCallback logCallback) { auto session = std::static_pointer_cast(std::make_shared(arguments, completeCallback, logCallback, ffmpegkit::FFmpegKitConfig::getLogRedirectionStrategy())); addSessionToSessionHistory(session); return session; } -std::shared_ptr ffmpegkit::FFprobeSession::create(const std::shared_ptr> arguments, const FFprobeSessionCompleteCallback completeCallback, const ffmpegkit::LogCallback logCallback, const LogRedirectionStrategy logRedirectionStrategy) { +std::shared_ptr ffmpegkit::FFprobeSession::create(const std::list& arguments, const FFprobeSessionCompleteCallback completeCallback, const ffmpegkit::LogCallback logCallback, const LogRedirectionStrategy logRedirectionStrategy) { auto session = std::static_pointer_cast(std::make_shared(arguments, completeCallback, logCallback, logRedirectionStrategy)); addSessionToSessionHistory(session); return session; } struct ffmpegkit::FFprobeSession::PublicFFprobeSession : public ffmpegkit::FFprobeSession { - PublicFFprobeSession(const std::shared_ptr> arguments, const FFprobeSessionCompleteCallback completeCallback, const ffmpegkit::LogCallback logCallback, const LogRedirectionStrategy logRedirectionStrategy) : + PublicFFprobeSession(const std::list& arguments, const FFprobeSessionCompleteCallback completeCallback, const ffmpegkit::LogCallback logCallback, const LogRedirectionStrategy logRedirectionStrategy) : FFprobeSession(arguments, completeCallback, logCallback, logRedirectionStrategy) { } }; -ffmpegkit::FFprobeSession::FFprobeSession(const std::shared_ptr> arguments, const FFprobeSessionCompleteCallback completeCallback, const ffmpegkit::LogCallback logCallback, const LogRedirectionStrategy logRedirectionStrategy) : +ffmpegkit::FFprobeSession::FFprobeSession(const std::list& arguments, const FFprobeSessionCompleteCallback completeCallback, const ffmpegkit::LogCallback logCallback, const LogRedirectionStrategy logRedirectionStrategy) : ffmpegkit::AbstractSession(arguments, logCallback, logRedirectionStrategy), _completeCallback{completeCallback} { } diff --git a/linux/src/FFprobeSession.h b/linux/src/FFprobeSession.h index 30eeb3d..381747b 100644 --- a/linux/src/FFprobeSession.h +++ b/linux/src/FFprobeSession.h @@ -36,7 +36,7 @@ namespace ffmpegkit { * * @param arguments command arguments */ - static std::shared_ptr create(const std::shared_ptr> arguments); + static std::shared_ptr create(const std::list& arguments); /** * Builds a new FFprobe session. @@ -44,7 +44,7 @@ namespace ffmpegkit { * @param arguments command arguments * @param completeCallback session specific complete callback */ - static std::shared_ptr create(const std::shared_ptr> arguments, const FFprobeSessionCompleteCallback completeCallback); + static std::shared_ptr create(const std::list& arguments, const FFprobeSessionCompleteCallback completeCallback); /** * Builds a new FFprobe session. @@ -53,7 +53,7 @@ namespace ffmpegkit { * @param completeCallback session specific complete callback * @param logCallback session specific log callback */ - static std::shared_ptr create(const std::shared_ptr> arguments, const FFprobeSessionCompleteCallback completeCallback, const ffmpegkit::LogCallback logCallback); + static std::shared_ptr create(const std::list& arguments, const FFprobeSessionCompleteCallback completeCallback, const ffmpegkit::LogCallback logCallback); /** * Builds a new FFprobe session. @@ -63,7 +63,7 @@ namespace ffmpegkit { * @param logCallback session specific log callback * @param logRedirectionStrategy session specific log redirection strategy */ - static std::shared_ptr create(const std::shared_ptr> arguments, const FFprobeSessionCompleteCallback completeCallback, const ffmpegkit::LogCallback logCallback, const LogRedirectionStrategy logRedirectionStrategy); + static std::shared_ptr create(const std::list& arguments, const FFprobeSessionCompleteCallback completeCallback, const ffmpegkit::LogCallback logCallback, const LogRedirectionStrategy logRedirectionStrategy); /** * Returns the session specific complete callback. @@ -105,7 +105,7 @@ namespace ffmpegkit { * @param logCallback session specific log callback * @param logRedirectionStrategy session specific log redirection strategy */ - FFprobeSession(const std::shared_ptr> arguments, const FFprobeSessionCompleteCallback completeCallback, const ffmpegkit::LogCallback logCallback, const LogRedirectionStrategy logRedirectionStrategy); + FFprobeSession(const std::list& arguments, const FFprobeSessionCompleteCallback completeCallback, const ffmpegkit::LogCallback logCallback, const LogRedirectionStrategy logRedirectionStrategy); FFprobeSessionCompleteCallback _completeCallback; }; diff --git a/linux/src/MediaInformationSession.cpp b/linux/src/MediaInformationSession.cpp index 2fe9a59..fd223b2 100644 --- a/linux/src/MediaInformationSession.cpp +++ b/linux/src/MediaInformationSession.cpp @@ -23,31 +23,31 @@ extern void addSessionToSessionHistory(const std::shared_ptr session); -std::shared_ptr ffmpegkit::MediaInformationSession::create(const std::shared_ptr> arguments) { +std::shared_ptr ffmpegkit::MediaInformationSession::create(const std::list& arguments) { auto session = std::static_pointer_cast(std::make_shared(arguments, nullptr, nullptr)); addSessionToSessionHistory(session); return session; } -std::shared_ptr ffmpegkit::MediaInformationSession::create(const std::shared_ptr> arguments, ffmpegkit::MediaInformationSessionCompleteCallback completeCallback) { +std::shared_ptr ffmpegkit::MediaInformationSession::create(const std::list& arguments, ffmpegkit::MediaInformationSessionCompleteCallback completeCallback) { auto session = std::static_pointer_cast(std::make_shared(arguments, completeCallback, nullptr)); addSessionToSessionHistory(session); return session; } -std::shared_ptr ffmpegkit::MediaInformationSession::create(const std::shared_ptr> arguments, ffmpegkit::MediaInformationSessionCompleteCallback completeCallback, ffmpegkit::LogCallback logCallback) { +std::shared_ptr ffmpegkit::MediaInformationSession::create(const std::list& arguments, ffmpegkit::MediaInformationSessionCompleteCallback completeCallback, ffmpegkit::LogCallback logCallback) { auto session = std::static_pointer_cast(std::make_shared(arguments, completeCallback, logCallback)); addSessionToSessionHistory(session); return session; } struct ffmpegkit::MediaInformationSession::PublicMediaInformationSession : public ffmpegkit::MediaInformationSession { - PublicMediaInformationSession(const std::shared_ptr> arguments, ffmpegkit::MediaInformationSessionCompleteCallback completeCallback, ffmpegkit::LogCallback logCallback) : + PublicMediaInformationSession(const std::list& arguments, ffmpegkit::MediaInformationSessionCompleteCallback completeCallback, ffmpegkit::LogCallback logCallback) : MediaInformationSession(arguments, completeCallback, logCallback) { } }; -ffmpegkit::MediaInformationSession::MediaInformationSession(const std::shared_ptr> arguments, ffmpegkit::MediaInformationSessionCompleteCallback completeCallback, ffmpegkit::LogCallback logCallback) : +ffmpegkit::MediaInformationSession::MediaInformationSession(const std::list& arguments, ffmpegkit::MediaInformationSessionCompleteCallback completeCallback, ffmpegkit::LogCallback logCallback) : ffmpegkit::AbstractSession(arguments, logCallback, ffmpegkit::LogRedirectionStrategyNeverPrintLogs), _completeCallback{completeCallback}, _mediaInformation{nullptr} { } diff --git a/linux/src/MediaInformationSession.h b/linux/src/MediaInformationSession.h index b5ab4de..b59a01d 100644 --- a/linux/src/MediaInformationSession.h +++ b/linux/src/MediaInformationSession.h @@ -38,7 +38,7 @@ namespace ffmpegkit { * * @param arguments command arguments */ - static std::shared_ptr create(const std::shared_ptr> arguments); + static std::shared_ptr create(const std::list& arguments); /** * Creates a new media information session. @@ -46,7 +46,7 @@ namespace ffmpegkit { * @param arguments command arguments * @param completeCallback session specific complete callback */ - static std::shared_ptr create(const std::shared_ptr> arguments, ffmpegkit::MediaInformationSessionCompleteCallback completeCallback); + static std::shared_ptr create(const std::list& arguments, ffmpegkit::MediaInformationSessionCompleteCallback completeCallback); /** * Creates a new media information session. @@ -55,7 +55,7 @@ namespace ffmpegkit { * @param completeCallback session specific complete callback * @param logCallback session specific log callback */ - static std::shared_ptr create(const std::shared_ptr> arguments, ffmpegkit::MediaInformationSessionCompleteCallback completeCallback, ffmpegkit::LogCallback logCallback); + static std::shared_ptr create(const std::list& arguments, ffmpegkit::MediaInformationSessionCompleteCallback completeCallback, ffmpegkit::LogCallback logCallback); /** * Returns the media information extracted in this session. @@ -111,7 +111,7 @@ namespace ffmpegkit { * @param completeCallback session specific complete callback * @param logCallback session specific log callback */ - MediaInformationSession(const std::shared_ptr> arguments, ffmpegkit::MediaInformationSessionCompleteCallback completeCallback, ffmpegkit::LogCallback logCallback); + MediaInformationSession(const std::list& arguments, ffmpegkit::MediaInformationSessionCompleteCallback completeCallback, ffmpegkit::LogCallback logCallback); ffmpegkit::MediaInformationSessionCompleteCallback _completeCallback; std::shared_ptr _mediaInformation;