Update to Flutter 3.29 and use LTS version

Min macos 11.0
Min ios 14
Min android 24
pull/1127/head
Roman Laptev 3 months ago
parent 35b99c02f8
commit 6ea164be49
  1. 65
      flutter/flutter/analysis_options.yaml
  2. 4
      flutter/flutter/android/.gitignore
  3. 52
      flutter/flutter/android/build.gradle
  4. 3
      flutter/flutter/android/gradle.properties
  5. 20
      flutter/flutter/android/src/main/java/com/arthenica/ffmpegkit/flutter/FFmpegKitFlutterPlugin.java
  6. 0
      flutter/flutter/ios/Assets/.gitkeep
  7. 34
      flutter/flutter/ios/ffmpeg_kit_flutter.podspec
  8. 133
      flutter/flutter/lib/abstract_session.dart
  9. 37
      flutter/flutter/lib/ffmpeg_kit.dart
  10. 146
      flutter/flutter/lib/ffmpeg_kit_config.dart
  11. 44
      flutter/flutter/lib/ffmpeg_session.dart
  12. 107
      flutter/flutter/lib/ffprobe_kit.dart
  13. 14
      flutter/flutter/lib/ffprobe_session.dart
  14. 2
      flutter/flutter/lib/log_redirection_strategy.dart
  15. 33
      flutter/flutter/lib/media_information.dart
  16. 7
      flutter/flutter/lib/media_information_json_parser.dart
  17. 17
      flutter/flutter/lib/media_information_session.dart
  18. 3
      flutter/flutter/lib/media_information_session_complete_callback.dart
  19. 9
      flutter/flutter/lib/return_code.dart
  20. 89
      flutter/flutter/lib/src/ffmpeg_kit_factory.dart
  21. 46
      flutter/flutter/lib/src/ffmpeg_kit_flutter_initializer.dart
  22. 12
      flutter/flutter/lib/statistics.dart
  23. 39
      flutter/flutter/lib/stream_information.dart
  24. 34
      flutter/flutter/macos/ffmpeg_kit_flutter.podspec
  25. 13
      flutter/flutter/pubspec.yaml
  26. 1
      flutter/flutter_platform_interface/.gitignore
  27. 71
      flutter/flutter_platform_interface/analysis_options.yaml
  28. 267
      flutter/flutter_platform_interface/lib/ffmpeg_kit_flutter_platform_interface.dart
  29. 259
      flutter/flutter_platform_interface/lib/method_channel_ffmpeg_kit_flutter.dart
  30. 9
      flutter/flutter_platform_interface/pubspec.yaml

@ -1,62 +1,3 @@
analyzer:
errors:
missing_required_param: warning
missing_return: warning
linter:
rules:
- avoid_catching_errors
- avoid_function_literals_in_foreach_calls
- avoid_private_typedef_functions
- avoid_renaming_method_parameters
- avoid_returning_null_for_void
- avoid_unused_constructor_parameters
- avoid_void_async
- await_only_futures
- camel_case_types
- cancel_subscriptions
- comment_references
- constant_identifier_names
- control_flow_in_finally
- directives_ordering
- empty_statements
- file_names
- hash_and_equals
- implementation_imports
- join_return_with_assignment
- collection_methods_unrelated_type
- missing_whitespace_between_adjacent_strings
- no_runtimeType_toString
- non_constant_identifier_names
- only_throw_errors
- overridden_fields
- package_api_docs
- package_names
- package_prefixed_library_names
- prefer_asserts_in_initializer_lists
- prefer_const_constructors
- prefer_const_declarations
- prefer_expression_function_bodies
- prefer_final_locals
- prefer_function_declarations_over_variables
- prefer_initializing_formals
- prefer_inlined_adds
- prefer_interpolation_to_compose_strings
- prefer_is_not_operator
- prefer_null_aware_operators
- prefer_relative_imports
- prefer_typing_uninitialized_variables
- prefer_void_to_null
- provide_deprecation_message
- sort_pub_dependencies
- test_types_in_equals
- throw_in_finally
- unnecessary_brace_in_string_interps
- unnecessary_lambdas
- unnecessary_null_aware_assignments
- unnecessary_overrides
- unnecessary_parenthesis
- unnecessary_statements
- unnecessary_string_interpolations
- use_string_buffers
- void_checks
include: package:carapacik_lints/core.yaml
formatter:
page_width: 120

@ -1,9 +1,9 @@
*.iml
.gradle
local.properties
/local.properties
/.idea/workspace.xml
/.idea/libraries
.DS_Store
/build
/captures
gradle
.cxx

@ -1,36 +1,41 @@
group = "com.arthenica.ffmpegkit.flutter"
version = "1.0-SNAPSHOT"
buildscript {
ext.kotlin_version = "2.1.10"
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:8.1.0'
classpath("com.android.tools.build:gradle:8.7.0")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version")
}
}
rootProject.allprojects {
allprojects {
repositories {
google()
mavenCentral()
}
}
apply plugin: 'com.android.library'
apply plugin: "com.android.library"
apply plugin: "kotlin-android"
android {
// Conditional for compatibility with AGP <4.2.
if (project.android.hasProperty("namespace")) {
namespace 'com.arthenica.ffmpegkit.flutter'
}
namespace = "com.arthenica.ffmpegkit.flutter"
compileSdkVersion 33
compileSdk = 35
defaultConfig {
minSdkVersion 24
targetSdkVersion 33
versionCode 603
versionName "6.0.3"
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_17
}
buildTypes {
@ -38,16 +43,19 @@ android {
minifyEnabled false
}
}
lintOptions {
disable 'GradleCompatible'
sourceSets {
main.java.srcDirs += "src/main/kotlin"
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
defaultConfig {
minSdk = 24
versionCode 603
versionName "6.0.3"
}
}
dependencies {
implementation 'androidx.annotation:annotation:1.5.0'
implementation 'com.arthenica:ffmpeg-kit-https:6.0-2'
dependencies {
implementation("androidx.annotation:annotation:1.9.1")
implementation("com.arthenica:ffmpeg-kit-https:6.0-2.LTS")
}
}

@ -1,3 +0,0 @@
org.gradle.jvmargs=-Xmx1536M
android.useAndroidX=true
android.enableJetifier=true

@ -153,17 +153,6 @@ public class FFmpegKitFlutterPlugin implements FlutterPlugin, ActivityAware, Met
Log.d(LIBRARY_NAME, String.format("FFmpegKitFlutterPlugin created %s.", this));
}
@SuppressWarnings("deprecation")
public static void registerWith(final io.flutter.plugin.common.PluginRegistry.Registrar registrar) {
final Context context = (registrar.activity() != null) ? registrar.activity() : registrar.context();
if (context == null) {
Log.w(LIBRARY_NAME, "FFmpegKitFlutterPlugin can not be registered without a context.");
return;
}
FFmpegKitFlutterPlugin plugin = new FFmpegKitFlutterPlugin();
plugin.init(registrar.messenger(), context, registrar.activity(), registrar, null);
}
protected void registerGlobalCallbacks() {
FFmpegKitConfig.enableFFmpegSessionCompleteCallback(this::emitSession);
FFmpegKitConfig.enableFFprobeSessionCompleteCallback(this::emitSession);
@ -195,7 +184,7 @@ public class FFmpegKitFlutterPlugin implements FlutterPlugin, ActivityAware, Met
@Override
public void onAttachedToActivity(@NonNull ActivityPluginBinding activityPluginBinding) {
Log.d(LIBRARY_NAME, String.format("FFmpegKitFlutterPlugin %s attached to activity %s.", this, activityPluginBinding.getActivity()));
init(flutterPluginBinding.getBinaryMessenger(), flutterPluginBinding.getApplicationContext(), activityPluginBinding.getActivity(), null, activityPluginBinding);
init(flutterPluginBinding.getBinaryMessenger(), flutterPluginBinding.getApplicationContext(), activityPluginBinding.getActivity(), activityPluginBinding);
}
@Override
@ -648,7 +637,7 @@ public class FFmpegKitFlutterPlugin implements FlutterPlugin, ActivityAware, Met
}
@SuppressWarnings("deprecation")
protected void init(final BinaryMessenger messenger, final Context context, final Activity activity, final io.flutter.plugin.common.PluginRegistry.Registrar registrar, final ActivityPluginBinding activityBinding) {
protected void init(final BinaryMessenger messenger, final Context context, final Activity activity, final ActivityPluginBinding activityBinding) {
registerGlobalCallbacks();
if (methodChannel == null) {
@ -668,13 +657,8 @@ public class FFmpegKitFlutterPlugin implements FlutterPlugin, ActivityAware, Met
this.context = context;
this.activity = activity;
if (registrar != null) {
// V1 embedding setup for activity listeners.
registrar.addActivityResultListener(this);
} else {
// V2 embedding setup for activity listeners.
activityBinding.addActivityResultListener(this);
}
Log.d(LIBRARY_NAME, String.format("FFmpegKitFlutterPlugin %s initialised with context %s and activity %s.", this, context, activity));
}

@ -15,7 +15,7 @@ Pod::Spec.new do |s|
s.source_files = 'Classes/**/*'
s.public_header_files = 'Classes/**/*.h'
s.default_subspec = 'https'
s.default_subspec = 'https-lts'
s.dependency 'Flutter'
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' }
@ -24,112 +24,112 @@ Pod::Spec.new do |s|
ss.source_files = 'Classes/**/*'
ss.public_header_files = 'Classes/**/*.h'
ss.dependency 'ffmpeg-kit-ios-min', "6.0"
ss.ios.deployment_target = '12.1'
ss.ios.deployment_target = '14.0'
end
s.subspec 'min-lts' do |ss|
ss.source_files = 'Classes/**/*'
ss.public_header_files = 'Classes/**/*.h'
ss.dependency 'ffmpeg-kit-ios-min', "6.0.LTS"
ss.ios.deployment_target = '10'
ss.ios.deployment_target = '14.0'
end
s.subspec 'min-gpl' do |ss|
ss.source_files = 'Classes/**/*'
ss.public_header_files = 'Classes/**/*.h'
ss.dependency 'ffmpeg-kit-ios-min-gpl', "6.0"
ss.ios.deployment_target = '12.1'
ss.ios.deployment_target = '14.0'
end
s.subspec 'min-gpl-lts' do |ss|
ss.source_files = 'Classes/**/*'
ss.public_header_files = 'Classes/**/*.h'
ss.dependency 'ffmpeg-kit-ios-min-gpl', "6.0.LTS"
ss.ios.deployment_target = '10'
ss.ios.deployment_target = '14.0'
end
s.subspec 'https' do |ss|
ss.source_files = 'Classes/**/*'
ss.public_header_files = 'Classes/**/*.h'
ss.dependency 'ffmpeg-kit-ios-https', "6.0"
ss.ios.deployment_target = '12.1'
ss.ios.deployment_target = '14.0'
end
s.subspec 'https-lts' do |ss|
ss.source_files = 'Classes/**/*'
ss.public_header_files = 'Classes/**/*.h'
ss.dependency 'ffmpeg-kit-ios-https', "6.0.LTS"
ss.ios.deployment_target = '10'
ss.ios.deployment_target = '14.0'
end
s.subspec 'https-gpl' do |ss|
ss.source_files = 'Classes/**/*'
ss.public_header_files = 'Classes/**/*.h'
ss.dependency 'ffmpeg-kit-ios-https-gpl', "6.0"
ss.ios.deployment_target = '12.1'
ss.ios.deployment_target = '14.0'
end
s.subspec 'https-gpl-lts' do |ss|
ss.source_files = 'Classes/**/*'
ss.public_header_files = 'Classes/**/*.h'
ss.dependency 'ffmpeg-kit-ios-https-gpl', "6.0.LTS"
ss.ios.deployment_target = '10'
ss.ios.deployment_target = '14.0'
end
s.subspec 'audio' do |ss|
ss.source_files = 'Classes/**/*'
ss.public_header_files = 'Classes/**/*.h'
ss.dependency 'ffmpeg-kit-ios-audio', "6.0"
ss.ios.deployment_target = '12.1'
ss.ios.deployment_target = '14.0'
end
s.subspec 'audio-lts' do |ss|
ss.source_files = 'Classes/**/*'
ss.public_header_files = 'Classes/**/*.h'
ss.dependency 'ffmpeg-kit-ios-audio', "6.0.LTS"
ss.ios.deployment_target = '10'
ss.ios.deployment_target = '14.0'
end
s.subspec 'video' do |ss|
ss.source_files = 'Classes/**/*'
ss.public_header_files = 'Classes/**/*.h'
ss.dependency 'ffmpeg-kit-ios-video', "6.0"
ss.ios.deployment_target = '12.1'
ss.ios.deployment_target = '14.0'
end
s.subspec 'video-lts' do |ss|
ss.source_files = 'Classes/**/*'
ss.public_header_files = 'Classes/**/*.h'
ss.dependency 'ffmpeg-kit-ios-video', "6.0.LTS"
ss.ios.deployment_target = '10'
ss.ios.deployment_target = '14.0'
end
s.subspec 'full' do |ss|
ss.source_files = 'Classes/**/*'
ss.public_header_files = 'Classes/**/*.h'
ss.dependency 'ffmpeg-kit-ios-full', "6.0"
ss.ios.deployment_target = '12.1'
ss.ios.deployment_target = '14.0'
end
s.subspec 'full-lts' do |ss|
ss.source_files = 'Classes/**/*'
ss.public_header_files = 'Classes/**/*.h'
ss.dependency 'ffmpeg-kit-ios-full', "6.0.LTS"
ss.ios.deployment_target = '10'
ss.ios.deployment_target = '14.0'
end
s.subspec 'full-gpl' do |ss|
ss.source_files = 'Classes/**/*'
ss.public_header_files = 'Classes/**/*.h'
ss.dependency 'ffmpeg-kit-ios-full-gpl', "6.0"
ss.ios.deployment_target = '12.1'
ss.ios.deployment_target = '14.0'
end
s.subspec 'full-gpl-lts' do |ss|
ss.source_files = 'Classes/**/*'
ss.public_header_files = 'Classes/**/*.h'
ss.dependency 'ffmpeg-kit-ios-full-gpl', "6.0.LTS"
ss.ios.deployment_target = '10'
ss.ios.deployment_target = '14.0'
end
end

@ -63,27 +63,24 @@ abstract class AbstractSession extends Session {
/// [logRedirectionStrategy].
///
/// Returns FFmpeg session created.
static Future<FFmpegSession> createFFmpegSession(List<String> argumentsArray,
[LogRedirectionStrategy? logRedirectionStrategy]) async {
static Future<FFmpegSession> createFFmpegSession(
List<String> argumentsArray, [
LogRedirectionStrategy? logRedirectionStrategy,
]) async {
try {
await FFmpegKitConfig.init();
final Map<dynamic, dynamic>? nativeSession =
await _platform.abstractSessionCreateFFmpegSession(argumentsArray);
final Map<dynamic, dynamic>? nativeSession = await _platform.abstractSessionCreateFFmpegSession(argumentsArray);
final session = new FFmpegSession();
session._sessionId = nativeSession?["sessionId"];
session._createTime =
FFmpegKitFactory.validDate(nativeSession?["createTime"]);
session._startTime =
FFmpegKitFactory.validDate(nativeSession?["startTime"]);
session._createTime = FFmpegKitFactory.validDate(nativeSession?["createTime"]);
session._startTime = FFmpegKitFactory.validDate(nativeSession?["startTime"]);
session._command = nativeSession?["command"];
session._argumentsArray = argumentsArray;
session._logRedirectionStrategy =
logRedirectionStrategy ?? FFmpegKitConfig.getLogRedirectionStrategy();
session._logRedirectionStrategy = logRedirectionStrategy ?? FFmpegKitConfig.getLogRedirectionStrategy();
FFmpegKitFactory.setLogRedirectionStrategy(
session._sessionId, logRedirectionStrategy);
FFmpegKitFactory.setLogRedirectionStrategy(session._sessionId, logRedirectionStrategy);
return session;
} on PlatformException catch (e, stack) {
@ -96,18 +93,15 @@ abstract class AbstractSession extends Session {
/// fields as map keys.
///
/// Returns FFmpeg session created.
static FFmpegSession createFFmpegSessionFromMap(
Map<dynamic, dynamic> sessionMap) {
static FFmpegSession createFFmpegSessionFromMap(Map<dynamic, dynamic> sessionMap) {
final session = new FFmpegSession();
session._sessionId = sessionMap["sessionId"];
session._createTime = FFmpegKitFactory.validDate(sessionMap["createTime"]);
session._startTime = FFmpegKitFactory.validDate(sessionMap["startTime"]);
session._command = sessionMap["command"];
session._argumentsArray =
FFmpegKitConfig.parseArguments(sessionMap["command"]);
session._logRedirectionStrategy =
FFmpegKitFactory.getLogRedirectionStrategy(session._sessionId);
session._argumentsArray = FFmpegKitConfig.parseArguments(sessionMap["command"]);
session._logRedirectionStrategy = FFmpegKitFactory.getLogRedirectionStrategy(session._sessionId);
return session;
}
@ -117,27 +111,23 @@ abstract class AbstractSession extends Session {
///
/// Returns FFprobe session created.
static Future<FFprobeSession> createFFprobeSession(
List<String> argumentsArray,
[LogRedirectionStrategy? logRedirectionStrategy]) async {
List<String> argumentsArray, [
LogRedirectionStrategy? logRedirectionStrategy,
]) async {
try {
await FFmpegKitConfig.init();
final Map<dynamic, dynamic>? nativeSession =
await _platform.abstractSessionCreateFFprobeSession(argumentsArray);
final Map<dynamic, dynamic>? nativeSession = await _platform.abstractSessionCreateFFprobeSession(argumentsArray);
final session = new FFprobeSession();
session._sessionId = nativeSession?["sessionId"];
session._createTime =
FFmpegKitFactory.validDate(nativeSession?["createTime"]);
session._startTime =
FFmpegKitFactory.validDate(nativeSession?["startTime"]);
session._createTime = FFmpegKitFactory.validDate(nativeSession?["createTime"]);
session._startTime = FFmpegKitFactory.validDate(nativeSession?["startTime"]);
session._command = nativeSession?["command"];
session._argumentsArray = argumentsArray;
session._logRedirectionStrategy =
logRedirectionStrategy ?? FFmpegKitConfig.getLogRedirectionStrategy();
session._logRedirectionStrategy = logRedirectionStrategy ?? FFmpegKitConfig.getLogRedirectionStrategy();
FFmpegKitFactory.setLogRedirectionStrategy(
session._sessionId, logRedirectionStrategy);
FFmpegKitFactory.setLogRedirectionStrategy(session._sessionId, logRedirectionStrategy);
return session;
} on PlatformException catch (e, stack) {
@ -150,18 +140,15 @@ abstract class AbstractSession extends Session {
/// fields as map keys.
///
/// Returns FFprobe session created.
static FFprobeSession createFFprobeSessionFromMap(
Map<dynamic, dynamic> sessionMap) {
static FFprobeSession createFFprobeSessionFromMap(Map<dynamic, dynamic> sessionMap) {
final session = new FFprobeSession();
session._sessionId = sessionMap["sessionId"];
session._createTime = FFmpegKitFactory.validDate(sessionMap["createTime"]);
session._startTime = FFmpegKitFactory.validDate(sessionMap["startTime"]);
session._command = sessionMap["command"];
session._argumentsArray =
FFmpegKitConfig.parseArguments(sessionMap["command"]);
session._logRedirectionStrategy =
FFmpegKitFactory.getLogRedirectionStrategy(session._sessionId);
session._argumentsArray = FFmpegKitConfig.parseArguments(sessionMap["command"]);
session._logRedirectionStrategy = FFmpegKitFactory.getLogRedirectionStrategy(session._sessionId);
return session;
}
@ -169,25 +156,22 @@ abstract class AbstractSession extends Session {
/// Creates a new MediaInformation session using [argumentsArray].
///
/// Returns MediaInformation session created.
static Future<MediaInformationSession> createMediaInformationSession(
List<String> argumentsArray) async {
static Future<MediaInformationSession> createMediaInformationSession(List<String> argumentsArray) async {
try {
await FFmpegKitConfig.init();
final Map<dynamic, dynamic>? nativeSession = await _platform
.abstractSessionCreateMediaInformationSession(argumentsArray);
final Map<dynamic, dynamic>? nativeSession = await _platform.abstractSessionCreateMediaInformationSession(
argumentsArray,
);
final session = new MediaInformationSession();
session._sessionId = nativeSession?["sessionId"];
session._createTime =
FFmpegKitFactory.validDate(nativeSession?["createTime"]);
session._startTime =
FFmpegKitFactory.validDate(nativeSession?["startTime"]);
session._createTime = FFmpegKitFactory.validDate(nativeSession?["createTime"]);
session._startTime = FFmpegKitFactory.validDate(nativeSession?["startTime"]);
session._command = nativeSession?["command"];
session._argumentsArray = argumentsArray;
session._logRedirectionStrategy = LogRedirectionStrategy.neverPrintLogs;
FFmpegKitFactory.setLogRedirectionStrategy(
session._sessionId, LogRedirectionStrategy.neverPrintLogs);
FFmpegKitFactory.setLogRedirectionStrategy(session._sessionId, LogRedirectionStrategy.neverPrintLogs);
return session;
} on PlatformException catch (e, stack) {
@ -200,29 +184,25 @@ abstract class AbstractSession extends Session {
/// session fields as map keys.
///
/// Returns MediaInformation session created.
static MediaInformationSession createMediaInformationSessionFromMap(
Map<dynamic, dynamic> sessionMap) {
static MediaInformationSession createMediaInformationSessionFromMap(Map<dynamic, dynamic> sessionMap) {
final session = new MediaInformationSession();
session._sessionId = sessionMap["sessionId"];
session._createTime = FFmpegKitFactory.validDate(sessionMap["createTime"]);
session._startTime = FFmpegKitFactory.validDate(sessionMap["startTime"]);
session._command = sessionMap["command"];
session._argumentsArray =
FFmpegKitConfig.parseArguments(sessionMap["command"]);
session._argumentsArray = FFmpegKitConfig.parseArguments(sessionMap["command"]);
session._logRedirectionStrategy = LogRedirectionStrategy.neverPrintLogs;
if (sessionMap.containsKey("mediaInformation")) {
session.setMediaInformation(
new MediaInformation(sessionMap["mediaInformation"]));
session.setMediaInformation(new MediaInformation(sessionMap["mediaInformation"]));
}
return session;
}
/// Returns the session specific log callback.
LogCallback? getLogCallback() =>
FFmpegKitFactory.getLogCallback(this.getSessionId());
LogCallback? getLogCallback() => FFmpegKitFactory.getLogCallback(this.getSessionId());
/// Returns the session identifier.
int? getSessionId() => this._sessionId;
@ -236,9 +216,7 @@ abstract class AbstractSession extends Session {
/// Returns session end time.
Future<DateTime?> getEndTime() async {
try {
return _platform
.abstractSessionGetEndTime(this.getSessionId())
.then(FFmpegKitFactory.validDate);
return _platform.abstractSessionGetEndTime(this.getSessionId()).then(FFmpegKitFactory.validDate);
} on PlatformException catch (e, stack) {
print("Plugin getEndTime error: ${e.message}");
return Future.error("getEndTime failed.", stack);
@ -249,9 +227,7 @@ abstract class AbstractSession extends Session {
/// if the session is not over yet.
Future<int> getDuration() async {
try {
return _platform
.abstractSessionGetDuration(this.getSessionId())
.then((duration) => duration ?? 0);
return _platform.abstractSessionGetDuration(this.getSessionId()).then((duration) => duration ?? 0);
} on PlatformException catch (e, stack) {
print("Plugin getDuration error: ${e.message}");
return Future.error("getDuration failed.", stack);
@ -269,15 +245,12 @@ abstract class AbstractSession extends Session {
/// them until [waitTimeout].
Future<List<Log>> getAllLogs([int? waitTimeout = null]) async {
try {
return _platform
.abstractSessionGetAllLogs(this.getSessionId(), waitTimeout)
.then((allLogs) {
return _platform.abstractSessionGetAllLogs(this.getSessionId(), waitTimeout).then((allLogs) {
if (allLogs == null) {
return List.empty();
} else {
return allLogs
.map((dynamic logObject) =>
FFmpegKitFactory.mapToLog(logObject as Map<dynamic, dynamic>))
.map((dynamic logObject) => FFmpegKitFactory.mapToLog(logObject as Map<dynamic, dynamic>))
.toList();
}
});
@ -292,15 +265,12 @@ abstract class AbstractSession extends Session {
/// will not wait for them and will return immediately.
Future<List<Log>> getLogs() async {
try {
return _platform
.abstractSessionGetLogs(this.getSessionId())
.then((allLogs) {
return _platform.abstractSessionGetLogs(this.getSessionId()).then((allLogs) {
if (allLogs == null) {
return List.empty();
} else {
return allLogs
.map((dynamic logObject) =>
FFmpegKitFactory.mapToLog(logObject as Map<dynamic, dynamic>))
.map((dynamic logObject) => FFmpegKitFactory.mapToLog(logObject as Map<dynamic, dynamic>))
.toList();
}
});
@ -315,8 +285,7 @@ abstract class AbstractSession extends Session {
/// this method waits for them until [waitTimeout].
Future<String?> getAllLogsAsString([int? waitTimeout = null]) async {
try {
return _platform.abstractSessionGetAllLogsAsString(
this.getSessionId(), waitTimeout);
return _platform.abstractSessionGetAllLogsAsString(this.getSessionId(), waitTimeout);
} on PlatformException catch (e, stack) {
print("Plugin getAllLogsAsString error: ${e.message}");
return Future.error("getAllLogsAsString failed.", stack);
@ -345,9 +314,7 @@ abstract class AbstractSession extends Session {
/// Returns the state of the session.
Future<SessionState> getState() async {
try {
return _platform
.abstractSessionGetState(this.getSessionId())
.then((state) {
return _platform.abstractSessionGetState(this.getSessionId()).then((state) {
switch (state) {
case 0:
return SessionState.created;
@ -371,9 +338,7 @@ abstract class AbstractSession extends Session {
/// started, still running or failed then this method returns null.
Future<ReturnCode?> getReturnCode() async {
try {
return _platform
.abstractSessionGetReturnCode(this.getSessionId())
.then((returnCode) {
return _platform.abstractSessionGetReturnCode(this.getSessionId()).then((returnCode) {
if (returnCode == null) {
return null;
} else {
@ -401,20 +366,16 @@ abstract class AbstractSession extends Session {
}
/// Returns session specific log redirection strategy.
LogRedirectionStrategy? getLogRedirectionStrategy() =>
this._logRedirectionStrategy;
LogRedirectionStrategy? getLogRedirectionStrategy() => this._logRedirectionStrategy;
/// Returns whether there are still asynchronous messages being transmitted
/// for this session or not.
Future<bool> thereAreAsynchronousMessagesInTransmit() async {
try {
return _platform.abstractSessionThereAreAsynchronousMessagesInTransmit(
this.getSessionId());
return _platform.abstractSessionThereAreAsynchronousMessagesInTransmit(this.getSessionId());
} on PlatformException catch (e, stack) {
print(
"Plugin thereAreAsynchronousMessagesInTransmit error: ${e.message}");
return Future.error(
"thereAreAsynchronousMessagesInTransmit failed.", stack);
print("Plugin thereAreAsynchronousMessagesInTransmit error: ${e.message}");
return Future.error("thereAreAsynchronousMessagesInTransmit failed.", stack);
}
}

@ -38,10 +38,8 @@ class FFmpegKit {
FFmpegKit.executeWithArguments(FFmpegKitConfig.parseArguments(command));
/// Synchronously executes FFmpeg with arguments provided.
static Future<FFmpegSession> executeWithArguments(
List<String> commandArguments) async {
final session =
await FFmpegSession.create(commandArguments, null, null, null, null);
static Future<FFmpegSession> executeWithArguments(List<String> commandArguments) async {
final session = await FFmpegSession.create(commandArguments, null, null, null, null);
await FFmpegKitConfig.ffmpegExecute(session);
@ -53,27 +51,35 @@ class FFmpegKit {
///
/// Note that this method returns immediately and does not wait the execution to complete. You must use an
/// [FFmpegSessionCompleteCallback] if you want to be notified about the result.
static Future<FFmpegSession> executeAsync(String command,
[FFmpegSessionCompleteCallback? completeCallback = null,
static Future<FFmpegSession> executeAsync(
String command, [
FFmpegSessionCompleteCallback? completeCallback = null,
LogCallback? logCallback = null,
StatisticsCallback? statisticsCallback = null]) async =>
FFmpegKit.executeWithArgumentsAsync(
StatisticsCallback? statisticsCallback = null,
]) async => FFmpegKit.executeWithArgumentsAsync(
FFmpegKitConfig.parseArguments(command),
completeCallback,
logCallback,
statisticsCallback);
statisticsCallback,
);
/// Starts an asynchronous FFmpeg execution with arguments provided.
///
/// Note that this method returns immediately and does not wait the execution to complete. You must use an
/// [FFmpegSessionCompleteCallback] if you want to be notified about the result.
static Future<FFmpegSession> executeWithArgumentsAsync(
List<String> commandArguments,
[FFmpegSessionCompleteCallback? completeCallback = null,
List<String> commandArguments, [
FFmpegSessionCompleteCallback? completeCallback = null,
LogCallback? logCallback = null,
StatisticsCallback? statisticsCallback = null]) async {
final session = await FFmpegSession.create(commandArguments,
completeCallback, logCallback, statisticsCallback, null);
StatisticsCallback? statisticsCallback = null,
]) async {
final session = await FFmpegSession.create(
commandArguments,
completeCallback,
logCallback,
statisticsCallback,
null,
);
await FFmpegKitConfig.asyncFFmpegExecute(session);
@ -104,8 +110,7 @@ class FFmpegKit {
return List.empty();
} else {
return sessions
.map((dynamic sessionObject) => FFmpegKitFactory.mapToSession(
sessionObject as Map<dynamic, dynamic>))
.map((dynamic sessionObject) => FFmpegKitFactory.mapToSession(sessionObject as Map<dynamic, dynamic>))
.map((session) => session as FFmpegSession)
.toList();
}

@ -40,8 +40,7 @@ import 'statistics_callback.dart';
class FFmpegKitConfig {
static FFmpegKitPlatform _platform = FFmpegKitPlatform.instance;
static LogRedirectionStrategy _globalLogRedirectionStrategy =
LogRedirectionStrategy.printLogsWhenNoCallbacksDefined;
static LogRedirectionStrategy _globalLogRedirectionStrategy = LogRedirectionStrategy.printLogsWhenNoCallbacksDefined;
static int _activeLogLevel = Level.avLogTrace;
@ -100,8 +99,7 @@ class FFmpegKitConfig {
///
/// Note that you need to use a package with "fontconfig" inside to be able
/// to use fonts in "FFmpeg".
static Future<void> setFontDirectory(String path,
[Map<String, String>? mapping = null]) async {
static Future<void> setFontDirectory(String path, [Map<String, String>? mapping = null]) async {
try {
await init();
return _platform.ffmpegKitConfigSetFontDirectory(path, mapping);
@ -116,12 +114,13 @@ class FFmpegKitConfig {
///
/// Note that you need to use a package with "fontconfig" inside to be able
/// to use fonts in "FFmpeg".
static Future<void> setFontDirectoryList(List<String> fontDirectoryList,
[Map<String, String>? mapping = null]) async {
static Future<void> setFontDirectoryList(
List<String> fontDirectoryList, [
Map<String, String>? mapping = null,
]) async {
try {
await init();
return _platform.ffmpegKitConfigSetFontDirectoryList(
fontDirectoryList, mapping);
return _platform.ffmpegKitConfigSetFontDirectoryList(fontDirectoryList, mapping);
} on PlatformException catch (e, stack) {
print("Plugin setFontDirectoryList error: ${e.message}");
return Future.error("setFontDirectoryList failed.", stack);
@ -221,8 +220,7 @@ class FFmpegKitConfig {
static Future<void> ffmpegExecute(FFmpegSession ffmpegSession) async {
try {
await init();
return _platform
.ffmpegKitConfigFFmpegExecute(ffmpegSession.getSessionId());
return _platform.ffmpegKitConfigFFmpegExecute(ffmpegSession.getSessionId());
} on PlatformException catch (e, stack) {
print("Plugin ffmpegExecute error: ${e.message}");
return Future.error("ffmpegExecute failed.", stack);
@ -233,8 +231,7 @@ class FFmpegKitConfig {
static Future<void> ffprobeExecute(FFprobeSession ffprobeSession) async {
try {
await init();
return _platform
.ffmpegKitConfigFFprobeExecute(ffprobeSession.getSessionId());
return _platform.ffmpegKitConfigFFprobeExecute(ffprobeSession.getSessionId());
} on PlatformException catch (e, stack) {
print("Plugin ffprobeExecute error: ${e.message}");
return Future.error("ffprobeExecute failed.", stack);
@ -243,12 +240,12 @@ class FFmpegKitConfig {
/// Synchronously executes the media information session provided.
static Future<void> getMediaInformationExecute(
MediaInformationSession mediaInformationSession,
[int? waitTimeout = null]) async {
MediaInformationSession mediaInformationSession, [
int? waitTimeout = null,
]) async {
try {
await init();
return _platform.ffmpegKitConfigGetMediaInformationExecute(
mediaInformationSession.getSessionId(), waitTimeout);
return _platform.ffmpegKitConfigGetMediaInformationExecute(mediaInformationSession.getSessionId(), waitTimeout);
} on PlatformException catch (e, stack) {
print("Plugin getMediaInformationExecute error: ${e.message}");
return Future.error("getMediaInformationExecute failed.", stack);
@ -262,8 +259,7 @@ class FFmpegKitConfig {
static Future<void> asyncFFmpegExecute(FFmpegSession ffmpegSession) async {
try {
await init();
return _platform
.ffmpegKitConfigAsyncFFmpegExecute(ffmpegSession.getSessionId());
return _platform.ffmpegKitConfigAsyncFFmpegExecute(ffmpegSession.getSessionId());
} on PlatformException catch (e, stack) {
print("Plugin asyncFFmpegExecute error: ${e.message}");
return Future.error("asyncFFmpegExecute failed.", stack);
@ -277,8 +273,7 @@ class FFmpegKitConfig {
static Future<void> asyncFFprobeExecute(FFprobeSession ffprobeSession) async {
try {
await init();
return _platform
.ffmpegKitConfigAsyncFFprobeExecute(ffprobeSession.getSessionId());
return _platform.ffmpegKitConfigAsyncFFprobeExecute(ffprobeSession.getSessionId());
} on PlatformException catch (e, stack) {
print("Plugin asyncFFprobeExecute error: ${e.message}");
return Future.error("asyncFFprobeExecute failed.", stack);
@ -290,12 +285,15 @@ class FFmpegKitConfig {
/// Note that this method returns immediately and does not wait the execution to complete. You must use an
/// [MediaInformationSessionCompleteCallback] if you want to be notified about the result.
static Future<void> asyncGetMediaInformationExecute(
MediaInformationSession mediaInformationSession,
[int? waitTimeout = null]) async {
MediaInformationSession mediaInformationSession, [
int? waitTimeout = null,
]) async {
try {
await init();
return _platform.ffmpegKitConfigAsyncGetMediaInformationExecute(
mediaInformationSession.getSessionId(), waitTimeout);
mediaInformationSession.getSessionId(),
waitTimeout,
);
} on PlatformException catch (e, stack) {
print("Plugin asyncGetMediaInformationExecute error: ${e.message}");
return Future.error("asyncGetMediaInformationExecute failed.", stack);
@ -308,17 +306,16 @@ class FFmpegKitConfig {
}
/// Sets a global callback to redirect FFmpeg statistics.
static void enableStatisticsCallback(
[StatisticsCallback? statisticsCallback = null]) {
static void enableStatisticsCallback([StatisticsCallback? statisticsCallback = null]) {
FFmpegKitFactory.setGlobalStatisticsCallback(statisticsCallback);
}
/// Sets a global FFmpegSessionCompleteCallback to receive execution results
/// for FFmpeg sessions.
static void enableFFmpegSessionCompleteCallback(
[FFmpegSessionCompleteCallback? ffmpegSessionCompleteCallback = null]) {
FFmpegKitFactory.setGlobalFFmpegSessionCompleteCallback(
ffmpegSessionCompleteCallback);
static void enableFFmpegSessionCompleteCallback([
FFmpegSessionCompleteCallback? ffmpegSessionCompleteCallback = null,
]) {
FFmpegKitFactory.setGlobalFFmpegSessionCompleteCallback(ffmpegSessionCompleteCallback);
}
/// Returns the global FFmpegSessionCompleteCallback set.
@ -327,10 +324,10 @@ class FFmpegKitConfig {
/// Sets a global FFprobeSessionCompleteCallback to receive execution results
/// for FFprobe sessions.
static void enableFFprobeSessionCompleteCallback(
[FFprobeSessionCompleteCallback? ffprobeSessionCompleteCallback = null]) {
FFmpegKitFactory.setGlobalFFprobeSessionCompleteCallback(
ffprobeSessionCompleteCallback);
static void enableFFprobeSessionCompleteCallback([
FFprobeSessionCompleteCallback? ffprobeSessionCompleteCallback = null,
]) {
FFmpegKitFactory.setGlobalFFprobeSessionCompleteCallback(ffprobeSessionCompleteCallback);
}
/// Returns the global FFprobeSessionCompleteCallback set.
@ -339,16 +336,14 @@ class FFmpegKitConfig {
/// Sets a global MediaInformationSessionCompleteCallback to receive
/// execution results for MediaInformation sessions.
static void enableMediaInformationSessionCompleteCallback(
[MediaInformationSessionCompleteCallback?
mediaInformationSessionCompleteCallback = null]) {
FFmpegKitFactory.setGlobalMediaInformationSessionCompleteCallback(
mediaInformationSessionCompleteCallback);
static void enableMediaInformationSessionCompleteCallback([
MediaInformationSessionCompleteCallback? mediaInformationSessionCompleteCallback = null,
]) {
FFmpegKitFactory.setGlobalMediaInformationSessionCompleteCallback(mediaInformationSessionCompleteCallback);
}
/// Returns the global MediaInformationSessionCompleteCallback set.
static MediaInformationSessionCompleteCallback?
getMediaInformationSessionCompleteCallback() =>
static MediaInformationSessionCompleteCallback? getMediaInformationSessionCompleteCallback() =>
FFmpegKitFactory.getGlobalMediaInformationSessionCompleteCallback();
/// Returns the current log level.
@ -404,8 +399,7 @@ class FFmpegKitConfig {
/// Note that this method is Android only. It will fail if called on other
/// platforms. It also requires API Level &ge; 19. On older API levels it
/// returns an empty url.
static Future<String?> getSafParameter(
String uriString, String openMode) async {
static Future<String?> getSafParameter(String uriString, String openMode) async {
try {
await init();
return _platform.ffmpegKitConfigGetSafParameter(uriString, openMode);
@ -441,9 +435,7 @@ class FFmpegKitConfig {
static Future<Session?> getSession(int sessionId) async {
try {
await init();
return _platform
.ffmpegKitConfigGetSession(sessionId)
.then(FFmpegKitFactory.mapToNullableSession);
return _platform.ffmpegKitConfigGetSession(sessionId).then(FFmpegKitFactory.mapToNullableSession);
} on PlatformException catch (e, stack) {
print("Plugin getSession error: ${e.message}");
return Future.error("getSession failed.", stack);
@ -454,9 +446,7 @@ class FFmpegKitConfig {
static Future<Session?> getLastSession() async {
try {
await init();
return _platform
.ffmpegKitConfigGetLastSession()
.then(FFmpegKitFactory.mapToNullableSession);
return _platform.ffmpegKitConfigGetLastSession().then(FFmpegKitFactory.mapToNullableSession);
} on PlatformException catch (e, stack) {
print("Plugin getLastSession error: ${e.message}");
return Future.error("getLastSession failed.", stack);
@ -467,9 +457,7 @@ class FFmpegKitConfig {
static Future<Session?> getLastCompletedSession() async {
try {
await init();
return _platform
.ffmpegKitConfigGetLastCompletedSession()
.then(FFmpegKitFactory.mapToNullableSession);
return _platform.ffmpegKitConfigGetLastCompletedSession().then(FFmpegKitFactory.mapToNullableSession);
} on PlatformException catch (e, stack) {
print("Plugin getLastCompletedSession error: ${e.message}");
return Future.error("getLastCompletedSession failed.", stack);
@ -485,8 +473,7 @@ class FFmpegKitConfig {
return List.empty();
} else {
return sessions
.map((dynamic sessionObject) => FFmpegKitFactory.mapToSession(
sessionObject as Map<dynamic, dynamic>))
.map((dynamic sessionObject) => FFmpegKitFactory.mapToSession(sessionObject as Map<dynamic, dynamic>))
.toList();
}
});
@ -517,8 +504,7 @@ class FFmpegKitConfig {
return List.empty();
} else {
return sessions
.map((dynamic sessionObject) => FFmpegKitFactory.mapToSession(
sessionObject as Map<dynamic, dynamic>))
.map((dynamic sessionObject) => FFmpegKitFactory.mapToSession(sessionObject as Map<dynamic, dynamic>))
.map((session) => session as FFmpegSession)
.toList();
}
@ -538,8 +524,7 @@ class FFmpegKitConfig {
return List.empty();
} else {
return sessions
.map((dynamic sessionObject) => FFmpegKitFactory.mapToSession(
sessionObject as Map<dynamic, dynamic>))
.map((dynamic sessionObject) => FFmpegKitFactory.mapToSession(sessionObject as Map<dynamic, dynamic>))
.map((session) => session as FFprobeSession)
.toList();
}
@ -551,19 +536,15 @@ class FFmpegKitConfig {
}
/// Returns all MediaInformation sessions in the session history.
static Future<List<MediaInformationSession>>
getMediaInformationSessions() async {
static Future<List<MediaInformationSession>> getMediaInformationSessions() async {
try {
await FFmpegKitConfig.init();
return _platform
.ffprobeKitListMediaInformationSessions()
.then((sessions) {
return _platform.ffprobeKitListMediaInformationSessions().then((sessions) {
if (sessions == null) {
return List.empty();
} else {
return sessions
.map((dynamic sessionObject) => FFmpegKitFactory.mapToSession(
sessionObject as Map<dynamic, dynamic>))
.map((dynamic sessionObject) => FFmpegKitFactory.mapToSession(sessionObject as Map<dynamic, dynamic>))
.map((session) => session as MediaInformationSession)
.toList();
}
@ -575,19 +556,15 @@ class FFmpegKitConfig {
}
/// Returns sessions that have [sessionState].
static Future<List<Session>> getSessionsByState(
SessionState sessionState) async {
static Future<List<Session>> getSessionsByState(SessionState sessionState) async {
try {
await init();
return _platform
.ffmpegKitConfigGetSessionsByState(sessionState.index)
.then((sessions) {
return _platform.ffmpegKitConfigGetSessionsByState(sessionState.index).then((sessions) {
if (sessions == null) {
return List.empty();
} else {
return sessions
.map((dynamic sessionObject) => FFmpegKitFactory.mapToSession(
sessionObject as Map<dynamic, dynamic>))
.map((dynamic sessionObject) => FFmpegKitFactory.mapToSession(sessionObject as Map<dynamic, dynamic>))
.toList();
}
});
@ -598,12 +575,10 @@ class FFmpegKitConfig {
}
/// Returns the active log redirection strategy.
static LogRedirectionStrategy getLogRedirectionStrategy() =>
_globalLogRedirectionStrategy;
static LogRedirectionStrategy getLogRedirectionStrategy() => _globalLogRedirectionStrategy;
/// Sets the log redirection strategy.
static void setLogRedirectionStrategy(
LogRedirectionStrategy logRedirectionStrategy) {
static void setLogRedirectionStrategy(LogRedirectionStrategy logRedirectionStrategy) {
_globalLogRedirectionStrategy = logRedirectionStrategy;
}
@ -630,8 +605,6 @@ class FFmpegKitConfig {
return "FAILED";
case SessionState.completed:
return "COMPLETED";
default:
return "";
}
}
@ -660,8 +633,7 @@ class FFmpegKitConfig {
argumentList.add(currentArgument.toString());
currentArgument = new StringBuffer();
}
} else if (currentChar == '\''.codeUnitAt(0) &&
(previousChar == null || previousChar != '\\'.codeUnitAt(0))) {
} else if (currentChar == '\''.codeUnitAt(0) && (previousChar == null || previousChar != '\\'.codeUnitAt(0))) {
if (singleQuoteStarted) {
singleQuoteStarted = false;
} else if (doubleQuoteStarted) {
@ -669,8 +641,7 @@ class FFmpegKitConfig {
} else {
singleQuoteStarted = true;
}
} else if (currentChar == '\"'.codeUnitAt(0) &&
(previousChar == null || previousChar != '\\'.codeUnitAt(0))) {
} else if (currentChar == '\"'.codeUnitAt(0) && (previousChar == null || previousChar != '\\'.codeUnitAt(0))) {
if (doubleQuoteStarted) {
doubleQuoteStarted = false;
} else if (singleQuoteStarted) {
@ -782,8 +753,7 @@ class FFmpegKitConfig {
///
/// Note that this method is Android only. It will fail if called on other
/// platforms.
static Future<String?> selectDocumentForRead(
[String? type = null, List<String>? extraTypes = null]) async {
static Future<String?> selectDocumentForRead([String? type = null, List<String>? extraTypes = null]) async {
try {
await init();
return _platform.ffmpegKitConfigSelectDocumentForRead(type, extraTypes);
@ -799,14 +769,14 @@ class FFmpegKitConfig {
///
/// Note that this method is Android only. It will fail if called on other
/// platforms.
static Future<String?> selectDocumentForWrite(
[String? title = null,
static Future<String?> selectDocumentForWrite([
String? title = null,
String? type = null,
List<String>? extraTypes = null]) async {
List<String>? extraTypes = null,
]) async {
try {
await init();
return _platform.ffmpegKitConfigSelectDocumentForWrite(
title, type, extraTypes);
return _platform.ffmpegKitConfigSelectDocumentForWrite(title, type, extraTypes);
} on PlatformException catch (e, stack) {
print("Plugin selectDocumentForWrite error: ${e.message}");
return Future.error("selectDocumentForWrite failed.", stack);

@ -32,17 +32,17 @@ import 'statistics_callback.dart';
/// An FFmpeg session.
class FFmpegSession extends AbstractSession {
/// Creates a new FFmpeg session with [argumentsArray].
static Future<FFmpegSession> create(List<String> argumentsArray,
[FFmpegSessionCompleteCallback? completeCallback = null,
static Future<FFmpegSession> create(
List<String> argumentsArray, [
FFmpegSessionCompleteCallback? completeCallback = null,
LogCallback? logCallback = null,
StatisticsCallback? statisticsCallback = null,
LogRedirectionStrategy? logRedirectionStrategy = null]) async {
final session = await AbstractSession.createFFmpegSession(
argumentsArray, logRedirectionStrategy);
LogRedirectionStrategy? logRedirectionStrategy = null,
]) async {
final session = await AbstractSession.createFFmpegSession(argumentsArray, logRedirectionStrategy);
final sessionId = session.getSessionId();
FFmpegKitFactory.setFFmpegSessionCompleteCallback(
sessionId, completeCallback);
FFmpegKitFactory.setFFmpegSessionCompleteCallback(sessionId, completeCallback);
FFmpegKitFactory.setLogCallback(sessionId, logCallback);
FFmpegKitFactory.setStatisticsCallback(sessionId, statisticsCallback);
@ -50,8 +50,7 @@ class FFmpegSession extends AbstractSession {
}
/// Returns the session specific statistics callback.
StatisticsCallback? getStatisticsCallback() =>
FFmpegKitFactory.getStatisticsCallback(this.getSessionId());
StatisticsCallback? getStatisticsCallback() => FFmpegKitFactory.getStatisticsCallback(this.getSessionId());
/// Returns the session specific complete callback.
FFmpegSessionCompleteCallback? getCompleteCallback() =>
@ -63,16 +62,17 @@ class FFmpegSession extends AbstractSession {
Future<List<Statistics>> getAllStatistics([int? waitTimeout]) async {
try {
await FFmpegKitConfig.init();
return FFmpegKitPlatform.instance
.ffmpegSessionGetAllStatistics(this.getSessionId(), waitTimeout)
.then((allStatistics) {
return FFmpegKitPlatform.instance.ffmpegSessionGetAllStatistics(this.getSessionId(), waitTimeout).then((
allStatistics,
) {
if (allStatistics == null) {
return List.empty();
} else {
return allStatistics
.map((dynamic statisticsObject) =>
FFmpegKitFactory.mapToStatistics(
statisticsObject as Map<dynamic, dynamic>))
.map(
(dynamic statisticsObject) =>
FFmpegKitFactory.mapToStatistics(statisticsObject as Map<dynamic, dynamic>),
)
.toList();
}
});
@ -88,16 +88,15 @@ class FFmpegSession extends AbstractSession {
Future<List<Statistics>> getStatistics() async {
try {
await FFmpegKitConfig.init();
return FFmpegKitPlatform.instance
.ffmpegSessionGetStatistics(this.getSessionId())
.then((statistics) {
return FFmpegKitPlatform.instance.ffmpegSessionGetStatistics(this.getSessionId()).then((statistics) {
if (statistics == null) {
return List.empty();
} else {
return statistics
.map((dynamic statisticsObject) =>
FFmpegKitFactory.mapToStatistics(
statisticsObject as Map<dynamic, dynamic>))
.map(
(dynamic statisticsObject) =>
FFmpegKitFactory.mapToStatistics(statisticsObject as Map<dynamic, dynamic>),
)
.toList();
}
});
@ -108,8 +107,7 @@ class FFmpegSession extends AbstractSession {
}
/// Returns the last received statistics entry.
Future<Statistics?> getLastReceivedStatistics() async =>
this.getStatistics().then((statistics) {
Future<Statistics?> getLastReceivedStatistics() async => this.getStatistics().then((statistics) {
if (statistics.length > 0) {
return statistics[statistics.length - 1];
} else {

@ -39,10 +39,8 @@ class FFprobeKit {
FFprobeKit.executeWithArguments(FFmpegKitConfig.parseArguments(command));
/// Synchronously executes FFprobe with arguments provided.
static Future<FFprobeSession> executeWithArguments(
List<String> commandArguments) async {
final session =
await FFprobeSession.create(commandArguments, null, null, null);
static Future<FFprobeSession> executeWithArguments(List<String> commandArguments) async {
final session = await FFprobeSession.create(commandArguments, null, null, null);
await FFmpegKitConfig.ffprobeExecute(session);
@ -54,24 +52,23 @@ class FFprobeKit {
///
/// Note that this method returns immediately and does not wait the execution to complete. You must use an
/// [FFprobeSessionCompleteCallback] if you want to be notified about the result.
static Future<FFprobeSession> executeAsync(String command,
[FFprobeSessionCompleteCallback? completeCallback = null,
LogCallback? logCallback = null]) async =>
FFprobeKit.executeWithArgumentsAsync(
FFmpegKitConfig.parseArguments(command),
completeCallback,
logCallback);
static Future<FFprobeSession> executeAsync(
String command, [
FFprobeSessionCompleteCallback? completeCallback = null,
LogCallback? logCallback = null,
]) async =>
FFprobeKit.executeWithArgumentsAsync(FFmpegKitConfig.parseArguments(command), completeCallback, logCallback);
/// Starts an asynchronous FFprobe execution with arguments provided.
///
/// Note that this method returns immediately and does not wait the execution to complete. You must use an
/// [FFprobeSessionCompleteCallback] if you want to be notified about the result.
static Future<FFprobeSession> executeWithArgumentsAsync(
List<String> commandArguments,
[FFprobeSessionCompleteCallback? completeCallback = null,
LogCallback? logCallback = null]) async {
final session = await FFprobeSession.create(
commandArguments, completeCallback, logCallback, null);
List<String> commandArguments, [
FFprobeSessionCompleteCallback? completeCallback = null,
LogCallback? logCallback = null,
]) async {
final session = await FFprobeSession.create(commandArguments, completeCallback, logCallback, null);
await FFmpegKitConfig.asyncFFprobeExecute(session);
@ -79,8 +76,7 @@ class FFprobeKit {
}
/// Extracts media information for the file specified with path.
static Future<MediaInformationSession> getMediaInformation(String path,
[int? waitTimeout = null]) async {
static Future<MediaInformationSession> getMediaInformation(String path, [int? waitTimeout = null]) async {
final commandArguments = [
"-v",
"error",
@ -91,29 +87,27 @@ class FFprobeKit {
"-show_streams",
"-show_chapters",
"-i",
path
path,
];
return FFprobeKit.getMediaInformationFromCommandArguments(
commandArguments, waitTimeout);
return FFprobeKit.getMediaInformationFromCommandArguments(commandArguments, waitTimeout);
}
/// Extracts media information using the command provided. The command
/// passed to this method must generate the output in JSON format in order to
/// successfully extract media information from it.
static Future<MediaInformationSession> getMediaInformationFromCommand(
String command,
[int? waitTimeout = null]) async =>
FFprobeKit.getMediaInformationFromCommandArguments(
FFmpegKitConfig.parseArguments(command), waitTimeout);
String command, [
int? waitTimeout = null,
]) async => FFprobeKit.getMediaInformationFromCommandArguments(FFmpegKitConfig.parseArguments(command), waitTimeout);
/// Extracts media information using the command arguments provided. The
/// command passed to this method must generate the output in JSON format in
/// order to successfully extract media information from it.
static Future<MediaInformationSession>
getMediaInformationFromCommandArguments(List<String> commandArguments,
[int? waitTimeout = null]) async {
final session =
await MediaInformationSession.create(commandArguments, null, null);
static Future<MediaInformationSession> getMediaInformationFromCommandArguments(
List<String> commandArguments, [
int? waitTimeout = null,
]) async {
final session = await MediaInformationSession.create(commandArguments, null, null);
await FFmpegKitConfig.getMediaInformationExecute(session, waitTimeout);
@ -131,10 +125,12 @@ class FFprobeKit {
///
/// Note that this method returns immediately and does not wait the execution to complete. You must use an
/// [MediaInformationSessionCompleteCallback] if you want to be notified about the result.
static Future<MediaInformationSession> getMediaInformationAsync(String path,
[MediaInformationSessionCompleteCallback? completeCallback = null,
static Future<MediaInformationSession> getMediaInformationAsync(
String path, [
MediaInformationSessionCompleteCallback? completeCallback = null,
LogCallback? logCallback = null,
int? waitTimeout = null]) async {
int? waitTimeout = null,
]) async {
final commandArguments = [
"-v",
"error",
@ -145,10 +141,14 @@ class FFprobeKit {
"-show_streams",
"-show_chapters",
"-i",
path
path,
];
return FFprobeKit.getMediaInformationFromCommandArgumentsAsync(
commandArguments, completeCallback, logCallback, waitTimeout);
commandArguments,
completeCallback,
logCallback,
waitTimeout,
);
}
/// Starts an asynchronous FFprobe execution to extract media information using a command. The command passed to
@ -157,15 +157,16 @@ class FFprobeKit {
/// Note that this method returns immediately and does not wait the execution to complete. You must use an
/// [MediaInformationSessionCompleteCallback] if you want to be notified about the result.
static Future<MediaInformationSession> getMediaInformationFromCommandAsync(
String command,
[MediaInformationSessionCompleteCallback? completeCallback = null,
String command, [
MediaInformationSessionCompleteCallback? completeCallback = null,
LogCallback? logCallback = null,
int? waitTimeout = null]) async =>
FFprobeKit.getMediaInformationFromCommandArgumentsAsync(
int? waitTimeout = null,
]) async => FFprobeKit.getMediaInformationFromCommandArgumentsAsync(
FFmpegKitConfig.parseArguments(command),
completeCallback,
logCallback,
waitTimeout);
waitTimeout,
);
/// Starts an asynchronous FFprobe execution to extract media information
/// using command arguments. The command passed to this method must generate
@ -175,14 +176,13 @@ class FFprobeKit {
/// Note that this method returns immediately and does not wait the execution
/// to complete. You must use an [MediaInformationSessionCompleteCallback] if you want to be
/// notified about the result.
static Future<MediaInformationSession>
getMediaInformationFromCommandArgumentsAsync(
List<String> commandArguments,
[MediaInformationSessionCompleteCallback? completeCallback = null,
static Future<MediaInformationSession> getMediaInformationFromCommandArgumentsAsync(
List<String> commandArguments, [
MediaInformationSessionCompleteCallback? completeCallback = null,
LogCallback? logCallback = null,
int? waitTimeout = null]) async {
final session = await MediaInformationSession.create(
commandArguments, completeCallback, logCallback);
int? waitTimeout = null,
]) async {
final session = await MediaInformationSession.create(commandArguments, completeCallback, logCallback);
await FFmpegKitConfig.asyncGetMediaInformationExecute(session, waitTimeout);
@ -205,8 +205,7 @@ class FFprobeKit {
return List.empty();
} else {
return sessions
.map((dynamic sessionObject) => FFmpegKitFactory.mapToSession(
sessionObject as Map<dynamic, dynamic>))
.map((dynamic sessionObject) => FFmpegKitFactory.mapToSession(sessionObject as Map<dynamic, dynamic>))
.map((session) => session as FFprobeSession)
.toList();
}
@ -218,19 +217,15 @@ class FFprobeKit {
}
/// Lists all MediaInformation sessions in the session history.
static Future<List<MediaInformationSession>>
listMediaInformationSessions() async {
static Future<List<MediaInformationSession>> listMediaInformationSessions() async {
try {
await FFmpegKitConfig.init();
return _platform
.ffprobeKitListMediaInformationSessions()
.then((sessions) {
return _platform.ffprobeKitListMediaInformationSessions().then((sessions) {
if (sessions == null) {
return List.empty();
} else {
return sessions
.map((dynamic sessionObject) => FFmpegKitFactory.mapToSession(
sessionObject as Map<dynamic, dynamic>))
.map((dynamic sessionObject) => FFmpegKitFactory.mapToSession(sessionObject as Map<dynamic, dynamic>))
.map((session) => session as MediaInformationSession)
.toList();
}

@ -26,16 +26,16 @@ import 'src/ffmpeg_kit_factory.dart';
/// An FFprobe session.
class FFprobeSession extends AbstractSession {
/// Creates a new FFprobe session with [argumentsArray].
static Future<FFprobeSession> create(List<String> argumentsArray,
[FFprobeSessionCompleteCallback? completeCallback = null,
static Future<FFprobeSession> create(
List<String> argumentsArray, [
FFprobeSessionCompleteCallback? completeCallback = null,
LogCallback? logCallback = null,
LogRedirectionStrategy? logRedirectionStrategy = null]) async {
final session = await AbstractSession.createFFprobeSession(
argumentsArray, logRedirectionStrategy);
LogRedirectionStrategy? logRedirectionStrategy = null,
]) async {
final session = await AbstractSession.createFFprobeSession(argumentsArray, logRedirectionStrategy);
final sessionId = session.getSessionId();
FFmpegKitFactory.setFFprobeSessionCompleteCallback(
sessionId, completeCallback);
FFmpegKitFactory.setFFprobeSessionCompleteCallback(sessionId, completeCallback);
FFmpegKitFactory.setLogCallback(sessionId, logCallback);
return session;

@ -22,5 +22,5 @@ enum LogRedirectionStrategy {
printLogsWhenNoCallbacksDefined,
printLogsWhenGlobalCallbackNotDefined,
printLogsWhenSessionCallbackNotDefined,
neverPrintLogs
neverPrintLogs,
}

@ -38,35 +38,28 @@ class MediaInformation {
MediaInformation(this._allProperties);
/// Returns file name.
String? getFilename() =>
this.getStringFormatProperty(MediaInformation.keyFilename);
String? getFilename() => this.getStringFormatProperty(MediaInformation.keyFilename);
/// Returns format.
String? getFormat() =>
this.getStringFormatProperty(MediaInformation.keyFormat);
String? getFormat() => this.getStringFormatProperty(MediaInformation.keyFormat);
/// Returns long format.
String? getLongFormat() =>
this.getStringFormatProperty(MediaInformation.keyFormatLong);
String? getLongFormat() => this.getStringFormatProperty(MediaInformation.keyFormatLong);
/// Returns duration.
String? getDuration() =>
this.getStringFormatProperty(MediaInformation.keyDuration);
String? getDuration() => this.getStringFormatProperty(MediaInformation.keyDuration);
/// Returns start time.
String? getStartTime() =>
this.getStringFormatProperty(MediaInformation.keyStartTime);
String? getStartTime() => this.getStringFormatProperty(MediaInformation.keyStartTime);
/// Returns size.
String? getSize() => this.getStringFormatProperty(MediaInformation.keySize);
/// Returns bitrate.
String? getBitrate() =>
this.getStringFormatProperty(MediaInformation.keyBitRate);
String? getBitrate() => this.getStringFormatProperty(MediaInformation.keyBitRate);
/// Returns all tags.
Map<dynamic, dynamic>? getTags() =>
this.getFormatProperty(StreamInformation.keyTags);
Map<dynamic, dynamic>? getTags() => this.getFormatProperty(StreamInformation.keyTags);
/// Returns the property associated with the key.
String? getStringProperty(String key) => this.getAllProperties()?[key];
@ -78,8 +71,7 @@ class MediaInformation {
dynamic getProperty(String key) => this.getAllProperties()?[key];
/// Returns the format property associated with the key.
String? getStringFormatProperty(String key) =>
this.getFormatProperties()?[key];
String? getStringFormatProperty(String key) => this.getFormatProperties()?[key];
/// Returns the format property associated with the key.
num? getNumberFormatProperty(String key) => this.getFormatProperties()?[key];
@ -89,8 +81,7 @@ class MediaInformation {
/// Returns all streams found as a list.
List<StreamInformation> getStreams() {
final List<StreamInformation> list =
List<StreamInformation>.empty(growable: true);
final List<StreamInformation> list = List<StreamInformation>.empty(growable: true);
dynamic createStreamInformation(Map<dynamic, dynamic> streamProperties) =>
list.add(new StreamInformation(streamProperties));
@ -106,8 +97,7 @@ class MediaInformation {
List<Chapter> getChapters() {
final List<Chapter> list = List<Chapter>.empty(growable: true);
dynamic createChapter(Map<dynamic, dynamic> chapterProperties) =>
list.add(new Chapter(chapterProperties));
dynamic createChapter(Map<dynamic, dynamic> chapterProperties) => list.add(new Chapter(chapterProperties));
this._allProperties?["chapters"]?.forEach((Object? chapter) {
createChapter(chapter as Map<dynamic, dynamic>);
@ -117,8 +107,7 @@ class MediaInformation {
}
/// Returns all format properties found.
Map<dynamic, dynamic>? getFormatProperties() =>
this._allProperties?[keyFormatProperties];
Map<dynamic, dynamic>? getFormatProperties() => this._allProperties?[keyFormatProperties];
/// Returns all properties found, including stream properties.
Map<dynamic, dynamic>? getAllProperties() => this._allProperties;

@ -33,9 +33,7 @@ class MediaInformationJsonParser {
static Future<MediaInformation?> from(String ffprobeJsonOutput) async {
try {
await FFmpegKitConfig.init();
return _platform
.mediaInformationJsonParserFrom(ffprobeJsonOutput)
.then((properties) {
return _platform.mediaInformationJsonParserFrom(ffprobeJsonOutput).then((properties) {
if (properties == null || properties.length == 0) {
return null;
} else {
@ -49,8 +47,7 @@ class MediaInformationJsonParser {
}
/// Extracts MediaInformation from the given FFprobe json output.
static Future<MediaInformation> fromWithError(
String ffprobeJsonOutput) async {
static Future<MediaInformation> fromWithError(String ffprobeJsonOutput) async {
try {
await FFmpegKitConfig.init();
return _platform

@ -29,15 +29,15 @@ class MediaInformationSession extends AbstractSession {
MediaInformation? _mediaInformation;
/// Creates a new MediaInformation session with [argumentsArray].
static Future<MediaInformationSession> create(List<String> argumentsArray,
[MediaInformationSessionCompleteCallback? completeCallback = null,
LogCallback? logCallback = null]) async {
final session =
await AbstractSession.createMediaInformationSession(argumentsArray);
static Future<MediaInformationSession> create(
List<String> argumentsArray, [
MediaInformationSessionCompleteCallback? completeCallback = null,
LogCallback? logCallback = null,
]) async {
final session = await AbstractSession.createMediaInformationSession(argumentsArray);
final sessionId = session.getSessionId();
FFmpegKitFactory.setMediaInformationSessionCompleteCallback(
sessionId, completeCallback);
FFmpegKitFactory.setMediaInformationSessionCompleteCallback(sessionId, completeCallback);
FFmpegKitFactory.setLogCallback(sessionId, logCallback);
return session;
@ -53,8 +53,7 @@ class MediaInformationSession extends AbstractSession {
/// Returns the session specific complete callback.
MediaInformationSessionCompleteCallback? getCompleteCallback() =>
FFmpegKitFactory.getMediaInformationSessionCompleteCallback(
this.getSessionId());
FFmpegKitFactory.getMediaInformationSessionCompleteCallback(this.getSessionId());
bool isFFmpeg() => false;

@ -26,5 +26,4 @@ import 'media_information_session.dart';
/// see the execution result.
/// If "getState" returns SessionState.failed then "getFailStackTrace" should
/// be used to get the failure reason.
typedef MediaInformationSessionCompleteCallback = void Function(
MediaInformationSession session);
typedef MediaInformationSessionCompleteCallback = void Function(MediaInformationSession session);

@ -25,18 +25,15 @@ class ReturnCode {
ReturnCode(this._value);
static bool isSuccess(ReturnCode? returnCode) =>
returnCode?.getValue() == ReturnCode.success;
static bool isSuccess(ReturnCode? returnCode) => returnCode?.getValue() == ReturnCode.success;
static bool isCancel(ReturnCode? returnCode) =>
returnCode?.getValue() == ReturnCode.cancel;
static bool isCancel(ReturnCode? returnCode) => returnCode?.getValue() == ReturnCode.cancel;
int getValue() => this._value;
bool isValueSuccess() => this._value == ReturnCode.success;
bool isValueError() =>
(this._value != ReturnCode.success) && (this._value != ReturnCode.cancel);
bool isValueError() => (this._value != ReturnCode.success) && (this._value != ReturnCode.cancel);
bool isValueCancel() => this._value == ReturnCode.cancel;

@ -29,12 +29,9 @@ import '../session.dart';
import '../statistics.dart';
import '../statistics_callback.dart';
final ffmpegSessionCompleteCallbackMap =
new Map<int, FFmpegSessionCompleteCallback>();
final ffprobeSessionCompleteCallbackMap =
new Map<int, FFprobeSessionCompleteCallback>();
final mediaInformationSessionCompleteCallbackMap =
new Map<int, MediaInformationSessionCompleteCallback>();
final ffmpegSessionCompleteCallbackMap = new Map<int, FFmpegSessionCompleteCallback>();
final ffprobeSessionCompleteCallbackMap = new Map<int, FFprobeSessionCompleteCallback>();
final mediaInformationSessionCompleteCallbackMap = new Map<int, MediaInformationSessionCompleteCallback>();
final logCallbackMap = new Map<int, LogCallback>();
final statisticsCallbackMap = new Map<int, StatisticsCallback>();
final logRedirectionStrategyMap = new Map<int, LogRedirectionStrategy>();
@ -44,11 +41,9 @@ class FFmpegKitFactory {
static StatisticsCallback? _statisticsCallback;
static FFmpegSessionCompleteCallback? _ffmpegSessionCompleteCallback;
static FFprobeSessionCompleteCallback? _ffprobeSessionCompleteCallback;
static MediaInformationSessionCompleteCallback?
_mediaInformationSessionCompleteCallback;
static MediaInformationSessionCompleteCallback? _mediaInformationSessionCompleteCallback;
static Statistics mapToStatistics(Map<dynamic, dynamic> statisticsMap) =>
new Statistics(
static Statistics mapToStatistics(Map<dynamic, dynamic> statisticsMap) => new Statistics(
statisticsMap["sessionId"],
statisticsMap["videoFrameNumber"],
statisticsMap["videoFps"],
@ -56,10 +51,10 @@ class FFmpegKitFactory {
statisticsMap["size"],
statisticsMap["time"],
statisticsMap["bitrate"],
statisticsMap["speed"]);
statisticsMap["speed"],
);
static Log mapToLog(Map<dynamic, dynamic> logMap) =>
new Log(logMap["sessionId"], logMap["level"], logMap["message"]);
static Log mapToLog(Map<dynamic, dynamic> logMap) => new Log(logMap["sessionId"], logMap["level"], logMap["message"]);
static Session mapToSession(Map<dynamic, dynamic> sessionMap) {
switch (sessionMap["type"]) {
@ -79,8 +74,7 @@ class FFmpegKitFactory {
case 2:
return AbstractSession.createFFprobeSessionFromMap(sessionMap);
case 3:
return AbstractSession.createMediaInformationSessionFromMap(
sessionMap);
return AbstractSession.createMediaInformationSessionFromMap(sessionMap);
case 1:
default:
return AbstractSession.createFFmpegSessionFromMap(sessionMap);
@ -90,8 +84,7 @@ class FFmpegKitFactory {
}
}
static MediaInformation? mapToNullableMediaInformation(
Map<dynamic, dynamic>? mediaInformationMap) {
static MediaInformation? mapToNullableMediaInformation(Map<dynamic, dynamic>? mediaInformationMap) {
if (mediaInformationMap != null) {
return new MediaInformation(mediaInformationMap);
} else {
@ -101,18 +94,15 @@ class FFmpegKitFactory {
static String getVersion() => "6.0.3";
static LogRedirectionStrategy? getLogRedirectionStrategy(int? sessionId) =>
logRedirectionStrategyMap[sessionId];
static LogRedirectionStrategy? getLogRedirectionStrategy(int? sessionId) => logRedirectionStrategyMap[sessionId];
static void setLogRedirectionStrategy(
int? sessionId, LogRedirectionStrategy? logRedirectionStrategy) {
static void setLogRedirectionStrategy(int? sessionId, LogRedirectionStrategy? logRedirectionStrategy) {
if (sessionId != null && logRedirectionStrategy != null) {
logRedirectionStrategyMap[sessionId] = logRedirectionStrategy;
}
}
static LogCallback? getLogCallback(int? sessionId) =>
logCallbackMap[sessionId];
static LogCallback? getLogCallback(int? sessionId) => logCallbackMap[sessionId];
static void setLogCallback(int? sessionId, LogCallback? logCallback) {
if (sessionId != null && logCallback != null) {
@ -126,81 +116,68 @@ class FFmpegKitFactory {
_logCallback = logCallback;
}
static StatisticsCallback? getStatisticsCallback(int? sessionId) =>
statisticsCallbackMap[sessionId];
static StatisticsCallback? getStatisticsCallback(int? sessionId) => statisticsCallbackMap[sessionId];
static void setStatisticsCallback(
int? sessionId, StatisticsCallback? statisticsCallback) {
static void setStatisticsCallback(int? sessionId, StatisticsCallback? statisticsCallback) {
if (sessionId != null && statisticsCallback != null) {
statisticsCallbackMap[sessionId] = statisticsCallback;
}
}
static StatisticsCallback? getGlobalStatisticsCallback() =>
_statisticsCallback;
static StatisticsCallback? getGlobalStatisticsCallback() => _statisticsCallback;
static void setGlobalStatisticsCallback(
StatisticsCallback? statisticsCallback) {
static void setGlobalStatisticsCallback(StatisticsCallback? statisticsCallback) {
_statisticsCallback = statisticsCallback;
}
static FFmpegSessionCompleteCallback? getFFmpegSessionCompleteCallback(
int? sessionId) =>
static FFmpegSessionCompleteCallback? getFFmpegSessionCompleteCallback(int? sessionId) =>
ffmpegSessionCompleteCallbackMap[sessionId];
static void setFFmpegSessionCompleteCallback(
int? sessionId, FFmpegSessionCompleteCallback? completeCallback) {
static void setFFmpegSessionCompleteCallback(int? sessionId, FFmpegSessionCompleteCallback? completeCallback) {
if (sessionId != null && completeCallback != null) {
ffmpegSessionCompleteCallbackMap[sessionId] = completeCallback;
}
}
static FFmpegSessionCompleteCallback?
getGlobalFFmpegSessionCompleteCallback() =>
_ffmpegSessionCompleteCallback;
static FFmpegSessionCompleteCallback? getGlobalFFmpegSessionCompleteCallback() => _ffmpegSessionCompleteCallback;
static void setGlobalFFmpegSessionCompleteCallback(
FFmpegSessionCompleteCallback? completeCallback) {
static void setGlobalFFmpegSessionCompleteCallback(FFmpegSessionCompleteCallback? completeCallback) {
_ffmpegSessionCompleteCallback = completeCallback;
}
static FFprobeSessionCompleteCallback? getFFprobeSessionCompleteCallback(
int? sessionId) =>
static FFprobeSessionCompleteCallback? getFFprobeSessionCompleteCallback(int? sessionId) =>
ffprobeSessionCompleteCallbackMap[sessionId];
static void setFFprobeSessionCompleteCallback(
int? sessionId, FFprobeSessionCompleteCallback? completeCallback) {
static void setFFprobeSessionCompleteCallback(int? sessionId, FFprobeSessionCompleteCallback? completeCallback) {
if (sessionId != null && completeCallback != null) {
ffprobeSessionCompleteCallbackMap[sessionId] = completeCallback;
}
}
static FFprobeSessionCompleteCallback?
getGlobalFFprobeSessionCompleteCallback() =>
_ffprobeSessionCompleteCallback;
static FFprobeSessionCompleteCallback? getGlobalFFprobeSessionCompleteCallback() => _ffprobeSessionCompleteCallback;
static void setGlobalFFprobeSessionCompleteCallback(
FFprobeSessionCompleteCallback? completeCallback) {
static void setGlobalFFprobeSessionCompleteCallback(FFprobeSessionCompleteCallback? completeCallback) {
_ffprobeSessionCompleteCallback = completeCallback;
}
static MediaInformationSessionCompleteCallback?
getMediaInformationSessionCompleteCallback(int? sessionId) =>
static MediaInformationSessionCompleteCallback? getMediaInformationSessionCompleteCallback(int? sessionId) =>
mediaInformationSessionCompleteCallbackMap[sessionId];
static void setMediaInformationSessionCompleteCallback(int? sessionId,
MediaInformationSessionCompleteCallback? completeCallback) {
static void setMediaInformationSessionCompleteCallback(
int? sessionId,
MediaInformationSessionCompleteCallback? completeCallback,
) {
if (sessionId != null && completeCallback != null) {
mediaInformationSessionCompleteCallbackMap[sessionId] = completeCallback;
}
}
static MediaInformationSessionCompleteCallback?
getGlobalMediaInformationSessionCompleteCallback() =>
static MediaInformationSessionCompleteCallback? getGlobalMediaInformationSessionCompleteCallback() =>
_mediaInformationSessionCompleteCallback;
static void setGlobalMediaInformationSessionCompleteCallback(
MediaInformationSessionCompleteCallback? completeCallback) {
MediaInformationSessionCompleteCallback? completeCallback,
) {
_mediaInformationSessionCompleteCallback = completeCallback;
}

@ -41,8 +41,7 @@ import 'ffmpeg_kit_factory.dart';
class FFmpegKitInitializer {
static FFmpegKitPlatform _platform = FFmpegKitPlatform.instance;
static const EventChannel _eventChannel =
const EventChannel('flutter.arthenica.com/ffmpeg_kit_event');
static const EventChannel _eventChannel = const EventChannel('flutter.arthenica.com/ffmpeg_kit_event');
static FFmpegKitInitializer _instance = new FFmpegKitInitializer();
@ -59,12 +58,9 @@ class FFmpegKitInitializer {
void _onEvent(dynamic event) {
if (event is Map<dynamic, dynamic>) {
final Map<String, dynamic> eventMap = event.cast<String, dynamic>();
final Map<dynamic, dynamic>? logEvent =
eventMap['FFmpegKitLogCallbackEvent'];
final Map<dynamic, dynamic>? statisticsEvent =
eventMap['FFmpegKitStatisticsCallbackEvent'];
final Map<dynamic, dynamic>? completeEvent =
eventMap['FFmpegKitCompleteCallbackEvent'];
final Map<dynamic, dynamic>? logEvent = eventMap['FFmpegKitLogCallbackEvent'];
final Map<dynamic, dynamic>? statisticsEvent = eventMap['FFmpegKitStatisticsCallbackEvent'];
final Map<dynamic, dynamic>? completeEvent = eventMap['FFmpegKitCompleteCallbackEvent'];
if (logEvent != null) {
_processLogCallbackEvent(logEvent);
@ -92,19 +88,16 @@ class FFmpegKitInitializer {
final int activeLogLevel = FFmpegKitConfig.getLogLevel();
var globalCallbackDefined = false;
var sessionCallbackDefined = false;
LogRedirectionStrategy activeLogRedirectionStrategy =
FFmpegKitConfig.getLogRedirectionStrategy();
LogRedirectionStrategy activeLogRedirectionStrategy = FFmpegKitConfig.getLogRedirectionStrategy();
// avLogStderr logs are always redirected
if ((activeLogLevel == Level.avLogQuiet && level != Level.avLogStderr) ||
level > activeLogLevel) {
if ((activeLogLevel == Level.avLogQuiet && level != Level.avLogStderr) || level > activeLogLevel) {
// LOG NEITHER PRINTED NOR FORWARDED
return;
}
activeLogRedirectionStrategy =
FFmpegKitFactory.getLogRedirectionStrategy(sessionId) ??
activeLogRedirectionStrategy;
FFmpegKitFactory.getLogRedirectionStrategy(sessionId) ?? activeLogRedirectionStrategy;
final LogCallback? logCallback = FFmpegKitFactory.getLogCallback(sessionId);
if (logCallback != null) {
@ -182,8 +175,7 @@ class FFmpegKitInitializer {
final Statistics statistics = FFmpegKitFactory.mapToStatistics(event);
final int sessionId = event["sessionId"];
final StatisticsCallback? statisticsCallback =
FFmpegKitFactory.getStatisticsCallback(sessionId);
final StatisticsCallback? statisticsCallback = FFmpegKitFactory.getStatisticsCallback(sessionId);
if (statisticsCallback != null) {
try {
// NOTIFY SESSION CALLBACK DEFINED
@ -194,8 +186,7 @@ class FFmpegKitInitializer {
}
}
final globalStatisticsCallbackFunction =
FFmpegKitFactory.getGlobalStatisticsCallback();
final globalStatisticsCallbackFunction = FFmpegKitFactory.getGlobalStatisticsCallback();
if (globalStatisticsCallbackFunction != null) {
try {
// NOTIFY GLOBAL CALLBACK DEFINED
@ -214,8 +205,7 @@ class FFmpegKitInitializer {
if (session != null) {
if (session.isFFmpeg()) {
final ffmpegSession = session as FFmpegSession;
final FFmpegSessionCompleteCallback? completeCallback =
ffmpegSession.getCompleteCallback();
final FFmpegSessionCompleteCallback? completeCallback = ffmpegSession.getCompleteCallback();
if (completeCallback != null) {
try {
@ -227,8 +217,7 @@ class FFmpegKitInitializer {
}
}
final globalFFmpegSessionCompleteCallback =
FFmpegKitFactory.getGlobalFFmpegSessionCompleteCallback();
final globalFFmpegSessionCompleteCallback = FFmpegKitFactory.getGlobalFFmpegSessionCompleteCallback();
if (globalFFmpegSessionCompleteCallback != null) {
try {
// NOTIFY GLOBAL CALLBACK DEFINED
@ -240,8 +229,7 @@ class FFmpegKitInitializer {
}
} else if (session.isFFprobe()) {
final ffprobeSession = session as FFprobeSession;
final FFprobeSessionCompleteCallback? completeCallback =
ffprobeSession.getCompleteCallback();
final FFprobeSessionCompleteCallback? completeCallback = ffprobeSession.getCompleteCallback();
if (completeCallback != null) {
try {
@ -253,8 +241,7 @@ class FFmpegKitInitializer {
}
}
final globalFFprobeSessionCompleteCallback =
FFmpegKitFactory.getGlobalFFprobeSessionCompleteCallback();
final globalFFprobeSessionCompleteCallback = FFmpegKitFactory.getGlobalFFprobeSessionCompleteCallback();
if (globalFFprobeSessionCompleteCallback != null) {
try {
// NOTIFY GLOBAL CALLBACK DEFINED
@ -279,13 +266,12 @@ class FFmpegKitInitializer {
}
}
final globalMediaInformationSessionCompleteCallback = FFmpegKitFactory
.getGlobalMediaInformationSessionCompleteCallback();
final globalMediaInformationSessionCompleteCallback =
FFmpegKitFactory.getGlobalMediaInformationSessionCompleteCallback();
if (globalMediaInformationSessionCompleteCallback != null) {
try {
// NOTIFY GLOBAL CALLBACK DEFINED
globalMediaInformationSessionCompleteCallback(
mediaInformationSession);
globalMediaInformationSessionCompleteCallback(mediaInformationSession);
} on Exception catch (e, stack) {
print("Exception thrown inside global complete callback. $e");
print(stack);

@ -28,8 +28,16 @@ class Statistics {
double _bitrate;
double _speed;
Statistics(this._sessionId, this._videoFrameNumber, this._videoFps,
this._videoQuality, this._size, this._time, this._bitrate, this._speed);
Statistics(
this._sessionId,
this._videoFrameNumber,
this._videoFps,
this._videoQuality,
this._size,
this._time,
this._bitrate,
this._speed,
);
int getSessionId() => this._sessionId;

@ -53,62 +53,49 @@ class StreamInformation {
String? getCodec() => this.getStringProperty(StreamInformation.keyCodec);
/// Returns stream codec in long format.
String? getCodecLong() =>
this.getStringProperty(StreamInformation.keyCodecLong);
String? getCodecLong() => this.getStringProperty(StreamInformation.keyCodecLong);
/// Returns stream format.
String? getFormat() => this.getStringProperty(StreamInformation.keyFormat);
/// Returns width.
int? getWidth() =>
this.getNumberProperty(StreamInformation.keyWidth)?.toInt();
int? getWidth() => this.getNumberProperty(StreamInformation.keyWidth)?.toInt();
/// Returns height.
int? getHeight() =>
this.getNumberProperty(StreamInformation.keyHeight)?.toInt();
int? getHeight() => this.getNumberProperty(StreamInformation.keyHeight)?.toInt();
/// Returns bitrate.
String? getBitrate() => this.getStringProperty(StreamInformation.keyBitRate);
/// Returns sample rate.
String? getSampleRate() =>
this.getStringProperty(StreamInformation.keySampleRate);
String? getSampleRate() => this.getStringProperty(StreamInformation.keySampleRate);
/// Returns sample format.
String? getSampleFormat() =>
this.getStringProperty(StreamInformation.keySampleFormat);
String? getSampleFormat() => this.getStringProperty(StreamInformation.keySampleFormat);
/// Returns channel layout.
String? getChannelLayout() =>
this.getStringProperty(StreamInformation.keyChannelLayout);
String? getChannelLayout() => this.getStringProperty(StreamInformation.keyChannelLayout);
/// Returns sample aspect ratio.
String? getSampleAspectRatio() =>
this.getStringProperty(StreamInformation.keySampleAspectRatio);
String? getSampleAspectRatio() => this.getStringProperty(StreamInformation.keySampleAspectRatio);
/// Returns display aspect ratio.
String? getDisplayAspectRatio() =>
this.getStringProperty(StreamInformation.keyDisplayAspectRatio);
String? getDisplayAspectRatio() => this.getStringProperty(StreamInformation.keyDisplayAspectRatio);
/// Returns average frame rate.
String? getAverageFrameRate() =>
this.getStringProperty(StreamInformation.keyAverageFrameRate);
String? getAverageFrameRate() => this.getStringProperty(StreamInformation.keyAverageFrameRate);
/// Returns real frame rate.
String? getRealFrameRate() =>
this.getStringProperty(StreamInformation.keyRealFrameRate);
String? getRealFrameRate() => this.getStringProperty(StreamInformation.keyRealFrameRate);
/// Returns time base.
String? getTimeBase() =>
this.getStringProperty(StreamInformation.keyTimeBase);
String? getTimeBase() => this.getStringProperty(StreamInformation.keyTimeBase);
/// Returns codec time base.
String? getCodecTimeBase() =>
this.getStringProperty(StreamInformation.keyCodecTimeBase);
String? getCodecTimeBase() => this.getStringProperty(StreamInformation.keyCodecTimeBase);
/// Returns all tags.
Map<dynamic, dynamic>? getTags() =>
this.getProperty(StreamInformation.keyTags);
Map<dynamic, dynamic>? getTags() => this.getProperty(StreamInformation.keyTags);
/// Returns the stream property associated with the key.
String? getStringProperty(String key) => this._allProperties?[key];

@ -15,7 +15,7 @@ Pod::Spec.new do |s|
s.source_files = 'Classes/**/*'
s.public_header_files = 'Classes/**/*.h'
s.default_subspec = 'https'
s.default_subspec = 'https-lts'
s.dependency 'FlutterMacOS'
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' }
@ -24,112 +24,112 @@ Pod::Spec.new do |s|
ss.source_files = 'Classes/**/*'
ss.public_header_files = 'Classes/**/*.h'
ss.dependency 'ffmpeg-kit-macos-min', "6.0"
ss.osx.deployment_target = '10.15'
ss.osx.deployment_target = '11.0'
end
s.subspec 'min-lts' do |ss|
ss.source_files = 'Classes/**/*'
ss.public_header_files = 'Classes/**/*.h'
ss.dependency 'ffmpeg-kit-macos-min', "6.0.LTS"
ss.osx.deployment_target = '10.12'
ss.osx.deployment_target = '11.0'
end
s.subspec 'min-gpl' do |ss|
ss.source_files = 'Classes/**/*'
ss.public_header_files = 'Classes/**/*.h'
ss.dependency 'ffmpeg-kit-macos-min-gpl', "6.0"
ss.osx.deployment_target = '10.15'
ss.osx.deployment_target = '11.0'
end
s.subspec 'min-gpl-lts' do |ss|
ss.source_files = 'Classes/**/*'
ss.public_header_files = 'Classes/**/*.h'
ss.dependency 'ffmpeg-kit-macos-min-gpl', "6.0.LTS"
ss.osx.deployment_target = '10.12'
ss.osx.deployment_target = '11.0'
end
s.subspec 'https' do |ss|
ss.source_files = 'Classes/**/*'
ss.public_header_files = 'Classes/**/*.h'
ss.dependency 'ffmpeg-kit-macos-https', "6.0"
ss.osx.deployment_target = '10.15'
ss.osx.deployment_target = '11.0'
end
s.subspec 'https-lts' do |ss|
ss.source_files = 'Classes/**/*'
ss.public_header_files = 'Classes/**/*.h'
ss.dependency 'ffmpeg-kit-macos-https', "6.0.LTS"
ss.osx.deployment_target = '10.12'
ss.osx.deployment_target = '11.0'
end
s.subspec 'https-gpl' do |ss|
ss.source_files = 'Classes/**/*'
ss.public_header_files = 'Classes/**/*.h'
ss.dependency 'ffmpeg-kit-macos-https-gpl', "6.0"
ss.osx.deployment_target = '10.15'
ss.osx.deployment_target = '11.0'
end
s.subspec 'https-gpl-lts' do |ss|
ss.source_files = 'Classes/**/*'
ss.public_header_files = 'Classes/**/*.h'
ss.dependency 'ffmpeg-kit-macos-https-gpl', "6.0.LTS"
ss.osx.deployment_target = '10.12'
ss.osx.deployment_target = '11.0'
end
s.subspec 'audio' do |ss|
ss.source_files = 'Classes/**/*'
ss.public_header_files = 'Classes/**/*.h'
ss.dependency 'ffmpeg-kit-macos-audio', "6.0"
ss.osx.deployment_target = '10.15'
ss.osx.deployment_target = '11.0'
end
s.subspec 'audio-lts' do |ss|
ss.source_files = 'Classes/**/*'
ss.public_header_files = 'Classes/**/*.h'
ss.dependency 'ffmpeg-kit-macos-audio', "6.0.LTS"
ss.osx.deployment_target = '10.12'
ss.osx.deployment_target = '11.0'
end
s.subspec 'video' do |ss|
ss.source_files = 'Classes/**/*'
ss.public_header_files = 'Classes/**/*.h'
ss.dependency 'ffmpeg-kit-macos-video', "6.0"
ss.osx.deployment_target = '10.15'
ss.osx.deployment_target = '11.0'
end
s.subspec 'video-lts' do |ss|
ss.source_files = 'Classes/**/*'
ss.public_header_files = 'Classes/**/*.h'
ss.dependency 'ffmpeg-kit-macos-video', "6.0.LTS"
ss.osx.deployment_target = '10.12'
ss.osx.deployment_target = '11.0'
end
s.subspec 'full' do |ss|
ss.source_files = 'Classes/**/*'
ss.public_header_files = 'Classes/**/*.h'
ss.dependency 'ffmpeg-kit-macos-full', "6.0"
ss.osx.deployment_target = '10.15'
ss.osx.deployment_target = '11.0'
end
s.subspec 'full-lts' do |ss|
ss.source_files = 'Classes/**/*'
ss.public_header_files = 'Classes/**/*.h'
ss.dependency 'ffmpeg-kit-macos-full', "6.0.LTS"
ss.osx.deployment_target = '10.12'
ss.osx.deployment_target = '11.0'
end
s.subspec 'full-gpl' do |ss|
ss.source_files = 'Classes/**/*'
ss.public_header_files = 'Classes/**/*.h'
ss.dependency 'ffmpeg-kit-macos-full-gpl', "6.0"
ss.osx.deployment_target = '10.15'
ss.osx.deployment_target = '11.0'
end
s.subspec 'full-gpl-lts' do |ss|
ss.source_files = 'Classes/**/*'
ss.public_header_files = 'Classes/**/*.h'
ss.dependency 'ffmpeg-kit-macos-full-gpl', "6.0.LTS"
ss.osx.deployment_target = '10.12'
ss.osx.deployment_target = '11.0'
end
end

@ -6,8 +6,8 @@ homepage: https://github.com/arthenica/ffmpeg-kit
version: 6.0.3
environment:
sdk: ">=2.12.0 <4.0.0"
flutter: ">=2.0.0"
sdk: ">=3.7.0 <4.0.0"
flutter: ">=3.29.0"
flutter:
plugin:
@ -21,11 +21,12 @@ flutter:
pluginClass: FFmpegKitFlutterPlugin
dependencies:
ffmpeg_kit_flutter_platform_interface: ^0.2.1
ffmpeg_kit_flutter_platform_interface:
git:
url: https://github.com/Carapacik/ffmpeg-kit
path: flutter/flutter_platform_interface
flutter:
sdk: flutter
dev_dependencies:
flutter_test:
sdk: flutter
plugin_platform_interface: ^2.1.5
carapacik_lints: ^1.11.1

@ -3,3 +3,4 @@
.packages
.pub/
build/
pubspec.lock

@ -1,68 +1,3 @@
analyzer:
enable-experiment:
- non-nullable
strong-mode:
implicit-dynamic: false
errors:
missing_required_param: warning
missing_return: warning
linter:
rules:
- avoid_catching_errors
- avoid_function_literals_in_foreach_calls
- avoid_private_typedef_functions
- avoid_renaming_method_parameters
- avoid_returning_null_for_void
- avoid_unused_constructor_parameters
- avoid_void_async
- await_only_futures
- camel_case_types
- cancel_subscriptions
- comment_references
- constant_identifier_names
- control_flow_in_finally
- directives_ordering
- empty_statements
- file_names
- hash_and_equals
- implementation_imports
- iterable_contains_unrelated_type
- join_return_with_assignment
- lines_longer_than_80_chars
- list_remove_unrelated_type
- missing_whitespace_between_adjacent_strings
- no_runtimeType_toString
- non_constant_identifier_names
- only_throw_errors
- overridden_fields
- package_api_docs
- package_names
- package_prefixed_library_names
- prefer_asserts_in_initializer_lists
- prefer_const_constructors
- prefer_const_declarations
- prefer_expression_function_bodies
- prefer_final_locals
- prefer_function_declarations_over_variables
- prefer_initializing_formals
- prefer_inlined_adds
- prefer_interpolation_to_compose_strings
- prefer_is_not_operator
- prefer_null_aware_operators
- prefer_relative_imports
- prefer_typing_uninitialized_variables
- prefer_void_to_null
- provide_deprecation_message
- sort_pub_dependencies
- test_types_in_equals
- throw_in_finally
- unnecessary_brace_in_string_interps
- unnecessary_lambdas
- unnecessary_null_aware_assignments
- unnecessary_overrides
- unnecessary_parenthesis
- unnecessary_statements
- unnecessary_string_interpolations
- use_string_buffers
- void_checks
include: package:carapacik_lints/core.yaml
formatter:
page_width: 120

@ -20,10 +20,9 @@
* SOFTWARE.
*/
import 'package:ffmpeg_kit_flutter_platform_interface/method_channel_ffmpeg_kit_flutter.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';
import 'method_channel_ffmpeg_kit_flutter.dart';
abstract class FFmpegKitPlatform extends PlatformInterface {
/// Constructs a FFmpegKitPlatform.
FFmpegKitPlatform() : super(token: _token);
@ -47,71 +46,58 @@ abstract class FFmpegKitPlatform extends PlatformInterface {
// AbstractSession
Future<Map<dynamic, dynamic>?> abstractSessionCreateFFmpegSession(
List<String> argumentsArray) async {
throw UnimplementedError(
'abstractSessionCreateFFmpegSession() has not been implemented!');
Future<Map<dynamic, dynamic>?> abstractSessionCreateFFmpegSession(List<String> argumentsArray) async {
throw UnimplementedError('abstractSessionCreateFFmpegSession() has not been implemented!');
}
Future<Map<dynamic, dynamic>?> abstractSessionCreateFFprobeSession(
List<String> argumentsArray) async {
throw UnimplementedError(
'abstractSessionCreateFFprobeSession() has not been implemented!');
Future<Map<dynamic, dynamic>?> abstractSessionCreateFFprobeSession(List<String> argumentsArray) async {
throw UnimplementedError('abstractSessionCreateFFprobeSession() has not been implemented!');
}
Future<Map<dynamic, dynamic>?> abstractSessionCreateMediaInformationSession(
List<String> argumentsArray) async {
throw UnimplementedError('abstractSessionCreateMediaInformationSession()'
' has not been implemented!');
Future<Map<dynamic, dynamic>?> abstractSessionCreateMediaInformationSession(List<String> argumentsArray) async {
throw UnimplementedError(
'abstractSessionCreateMediaInformationSession()'
' has not been implemented!',
);
}
Future<int?> abstractSessionGetEndTime(int? sessionId) async {
throw UnimplementedError(
'abstractSessionGetEndTime() has not been implemented!');
throw UnimplementedError('abstractSessionGetEndTime() has not been implemented!');
}
Future<int?> abstractSessionGetDuration(int? sessionId) async {
throw UnimplementedError(
'abstractSessionGetDuration() has not been implemented!');
throw UnimplementedError('abstractSessionGetDuration() has not been implemented!');
}
Future<List<dynamic>?> abstractSessionGetAllLogs(
int? sessionId, int? waitTimeout) async {
throw UnimplementedError(
'abstractSessionGetAllLogs() has not been implemented!');
Future<List<dynamic>?> abstractSessionGetAllLogs(int? sessionId, int? waitTimeout) async {
throw UnimplementedError('abstractSessionGetAllLogs() has not been implemented!');
}
Future<List<dynamic>?> abstractSessionGetLogs(int? sessionId) async {
throw UnimplementedError(
'abstractSessionGetLogs() has not been implemented!');
throw UnimplementedError('abstractSessionGetLogs() has not been implemented!');
}
Future<String?> abstractSessionGetAllLogsAsString(
int? sessionId, int? waitTimeout) async {
throw UnimplementedError(
'abstractSessionGetAllLogsAsString() has not been implemented!');
Future<String?> abstractSessionGetAllLogsAsString(int? sessionId, int? waitTimeout) async {
throw UnimplementedError('abstractSessionGetAllLogsAsString() has not been implemented!');
}
Future<int?> abstractSessionGetState(int? sessionId) async {
throw UnimplementedError(
'abstractSessionGetState() has not been implemented!');
throw UnimplementedError('abstractSessionGetState() has not been implemented!');
}
Future<int?> abstractSessionGetReturnCode(int? sessionId) async {
throw UnimplementedError(
'abstractSessionGetReturnCode() has not been implemented!');
throw UnimplementedError('abstractSessionGetReturnCode() has not been implemented!');
}
Future<String?> abstractSessionGetFailStackTrace(int? sessionId) async {
throw UnimplementedError(
'abstractSessionGetFailStackTrace() has not been implemented!');
throw UnimplementedError('abstractSessionGetFailStackTrace() has not been implemented!');
}
Future<bool> abstractSessionThereAreAsynchronousMessagesInTransmit(
int? sessionId) async {
Future<bool> abstractSessionThereAreAsynchronousMessagesInTransmit(int? sessionId) async {
throw UnimplementedError(
'abstractSessionThereAreAsynchronousMessagesInTransmit()'
' has not been implemented!');
' has not been implemented!',
);
}
// ArchDetect
@ -127,265 +113,213 @@ abstract class FFmpegKitPlatform extends PlatformInterface {
}
Future<void> ffmpegKitCancelSession(int sessionId) async {
throw UnimplementedError(
'ffmpegKitCancelSession() has not been implemented!');
throw UnimplementedError('ffmpegKitCancelSession() has not been implemented!');
}
Future<List<dynamic>?> ffmpegKitListSessions() async {
throw UnimplementedError(
'ffmpegKitListSessions() has not been implemented!');
throw UnimplementedError('ffmpegKitListSessions() has not been implemented!');
}
// FFmpegKitConfig
Future<void> ffmpegKitConfigEnableRedirection() async {
throw UnimplementedError(
'ffmpegKitConfigEnableRedirection() has not been implemented!');
throw UnimplementedError('ffmpegKitConfigEnableRedirection() has not been implemented!');
}
Future<void> ffmpegKitConfigDisableRedirection() async {
throw UnimplementedError(
'ffmpegKitConfigDisableRedirection() has not been implemented!');
throw UnimplementedError('ffmpegKitConfigDisableRedirection() has not been implemented!');
}
Future<void> ffmpegKitConfigSetFontconfigConfigurationPath(
String path) async {
throw UnimplementedError('ffmpegKitConfigSetFontconfigConfigurationPath()'
' has not been implemented!');
Future<void> ffmpegKitConfigSetFontconfigConfigurationPath(String path) async {
throw UnimplementedError(
'ffmpegKitConfigSetFontconfigConfigurationPath()'
' has not been implemented!',
);
}
Future<void> ffmpegKitConfigSetFontDirectory(
String path, Map<String, String>? mapping) async {
throw UnimplementedError(
'ffmpegKitConfigSetFontDirectory() has not been implemented!');
Future<void> ffmpegKitConfigSetFontDirectory(String path, Map<String, String>? mapping) async {
throw UnimplementedError('ffmpegKitConfigSetFontDirectory() has not been implemented!');
}
Future<void> ffmpegKitConfigSetFontDirectoryList(
List<String> fontDirectoryList, Map<String, String>? mapping) async {
throw UnimplementedError(
'ffmpegKitConfigSetFontDirectoryList() has not been implemented!');
Future<void> ffmpegKitConfigSetFontDirectoryList(List<String> fontDirectoryList, Map<String, String>? mapping) async {
throw UnimplementedError('ffmpegKitConfigSetFontDirectoryList() has not been implemented!');
}
Future<String?> ffmpegKitConfigRegisterNewFFmpegPipe() async {
throw UnimplementedError(
'ffmpegKitConfigRegisterNewFFmpegPipe() has not been implemented!');
throw UnimplementedError('ffmpegKitConfigRegisterNewFFmpegPipe() has not been implemented!');
}
Future<void> ffmpegKitConfigCloseFFmpegPipe(String ffmpegPipePath) async {
throw UnimplementedError(
'ffmpegKitConfigCloseFFmpegPipe() has not been implemented!');
throw UnimplementedError('ffmpegKitConfigCloseFFmpegPipe() has not been implemented!');
}
Future<String?> ffmpegKitConfigGetFFmpegVersion() async {
throw UnimplementedError(
'ffmpegKitConfigGetFFmpegVersion() has not been implemented!');
throw UnimplementedError('ffmpegKitConfigGetFFmpegVersion() has not been implemented!');
}
Future<bool?> ffmpegKitConfigIsLTSBuild() async {
throw UnimplementedError(
'ffmpegKitConfigIsLTSBuild() has not been implemented!');
throw UnimplementedError('ffmpegKitConfigIsLTSBuild() has not been implemented!');
}
Future<String?> ffmpegKitConfigGetBuildDate() async {
throw UnimplementedError(
'ffmpegKitConfigGetBuildDate() has not been implemented!');
throw UnimplementedError('ffmpegKitConfigGetBuildDate() has not been implemented!');
}
Future<void> ffmpegKitConfigSetEnvironmentVariable(
String name, String value) async {
throw UnimplementedError(
'ffmpegKitConfigSetEnvironmentVariable() has not been implemented!');
Future<void> ffmpegKitConfigSetEnvironmentVariable(String name, String value) async {
throw UnimplementedError('ffmpegKitConfigSetEnvironmentVariable() has not been implemented!');
}
Future<void> ffmpegKitConfigIgnoreSignal(int signal) async {
throw UnimplementedError(
'ffmpegKitConfigIgnoreSignal() has not been implemented!');
throw UnimplementedError('ffmpegKitConfigIgnoreSignal() has not been implemented!');
}
Future<void> ffmpegKitConfigAsyncFFmpegExecute(int? sessionId) async {
throw UnimplementedError(
'ffmpegKitConfigAsyncFFmpegExecute() has not been implemented!');
throw UnimplementedError('ffmpegKitConfigAsyncFFmpegExecute() has not been implemented!');
}
Future<void> ffmpegKitConfigAsyncFFprobeExecute(int? sessionId) async {
throw UnimplementedError(
'ffmpegKitConfigAsyncFFprobeExecute() has not been implemented!');
throw UnimplementedError('ffmpegKitConfigAsyncFFprobeExecute() has not been implemented!');
}
Future<void> ffmpegKitConfigAsyncGetMediaInformationExecute(
int? sessionId, int? waitTimeout) async {
throw UnimplementedError('ffmpegKitConfigAsyncGetMediaInformationExecute()'
' has not been implemented!');
Future<void> ffmpegKitConfigAsyncGetMediaInformationExecute(int? sessionId, int? waitTimeout) async {
throw UnimplementedError(
'ffmpegKitConfigAsyncGetMediaInformationExecute()'
' has not been implemented!',
);
}
Future<void> ffmpegKitConfigFFmpegExecute(int? sessionId) async {
throw UnimplementedError(
'ffmpegKitConfigFFmpegExecute() has not been implemented!');
throw UnimplementedError('ffmpegKitConfigFFmpegExecute() has not been implemented!');
}
Future<void> ffmpegKitConfigFFprobeExecute(int? sessionId) async {
throw UnimplementedError(
'ffmpegKitConfigFFprobeExecute() has not been implemented!');
throw UnimplementedError('ffmpegKitConfigFFprobeExecute() has not been implemented!');
}
Future<void> ffmpegKitConfigGetMediaInformationExecute(
int? sessionId, int? waitTimeout) async {
throw UnimplementedError('ffmpegKitConfigGetMediaInformationExecute()'
' has not been implemented!');
Future<void> ffmpegKitConfigGetMediaInformationExecute(int? sessionId, int? waitTimeout) async {
throw UnimplementedError(
'ffmpegKitConfigGetMediaInformationExecute()'
' has not been implemented!',
);
}
Future<void> ffmpegKitConfigSetLogLevel(int logLevel) async {
throw UnimplementedError(
'ffmpegKitConfigSetLogLevel() has not been implemented!');
throw UnimplementedError('ffmpegKitConfigSetLogLevel() has not been implemented!');
}
Future<int?> ffmpegKitConfigGetSessionHistorySize() async {
throw UnimplementedError(
'ffmpegKitConfigGetSessionHistorySize() has not been implemented!');
throw UnimplementedError('ffmpegKitConfigGetSessionHistorySize() has not been implemented!');
}
Future<void> ffmpegKitConfigSetSessionHistorySize(
int sessionHistorySize) async {
throw UnimplementedError(
'ffmpegKitConfigSetSessionHistorySize() has not been implemented!');
Future<void> ffmpegKitConfigSetSessionHistorySize(int sessionHistorySize) async {
throw UnimplementedError('ffmpegKitConfigSetSessionHistorySize() has not been implemented!');
}
Future<Map<dynamic, dynamic>?> ffmpegKitConfigGetSession(
int sessionId) async {
throw UnimplementedError(
'ffmpegKitConfigGetSession() has not been implemented!');
Future<Map<dynamic, dynamic>?> ffmpegKitConfigGetSession(int sessionId) async {
throw UnimplementedError('ffmpegKitConfigGetSession() has not been implemented!');
}
Future<Map<dynamic, dynamic>?> ffmpegKitConfigGetLastSession() async {
throw UnimplementedError(
'ffmpegKitConfigGetLastSession() has not been implemented!');
throw UnimplementedError('ffmpegKitConfigGetLastSession() has not been implemented!');
}
Future<Map<dynamic, dynamic>?>
ffmpegKitConfigGetLastCompletedSession() async {
throw UnimplementedError(
'ffmpegKitConfigGetLastCompletedSession() has not been implemented!');
Future<Map<dynamic, dynamic>?> ffmpegKitConfigGetLastCompletedSession() async {
throw UnimplementedError('ffmpegKitConfigGetLastCompletedSession() has not been implemented!');
}
Future<List<dynamic>?> ffmpegKitConfigGetSessions() async {
throw UnimplementedError(
'ffmpegKitConfigGetSessions() has not been implemented!');
throw UnimplementedError('ffmpegKitConfigGetSessions() has not been implemented!');
}
Future<void> clearSessions() async {
throw UnimplementedError('clearSessions() has not been implemented!');
}
Future<List<dynamic>?> ffmpegKitConfigGetSessionsByState(
int sessionState) async {
throw UnimplementedError(
'ffmpegKitConfigGetSessionsByState() has not been implemented!');
Future<List<dynamic>?> ffmpegKitConfigGetSessionsByState(int sessionState) async {
throw UnimplementedError('ffmpegKitConfigGetSessionsByState() has not been implemented!');
}
Future<int?> ffmpegKitConfigMessagesInTransmit(int sessionId) async {
throw UnimplementedError(
'ffmpegKitConfigMessagesInTransmit() has not been implemented!');
throw UnimplementedError('ffmpegKitConfigMessagesInTransmit() has not been implemented!');
}
Future<void> ffmpegKitConfigEnableLogs() async {
throw UnimplementedError(
'ffmpegKitConfigEnableLogs() has not been implemented!');
throw UnimplementedError('ffmpegKitConfigEnableLogs() has not been implemented!');
}
Future<void> ffmpegKitConfigDisableLogs() async {
throw UnimplementedError(
'ffmpegKitConfigDisableLogs() has not been implemented!');
throw UnimplementedError('ffmpegKitConfigDisableLogs() has not been implemented!');
}
Future<void> ffmpegKitConfigEnableStatistics() async {
throw UnimplementedError(
'ffmpegKitConfigEnableStatistics() has not been implemented!');
throw UnimplementedError('ffmpegKitConfigEnableStatistics() has not been implemented!');
}
Future<void> ffmpegKitConfigDisableStatistics() async {
throw UnimplementedError(
'ffmpegKitConfigDisableStatistics() has not been implemented!');
throw UnimplementedError('ffmpegKitConfigDisableStatistics() has not been implemented!');
}
Future<String?> ffmpegKitConfigGetPlatform() async {
throw UnimplementedError(
'ffmpegKitConfigGetPlatform() has not been implemented!');
throw UnimplementedError('ffmpegKitConfigGetPlatform() has not been implemented!');
}
Future<int?> ffmpegKitConfigWriteToPipe(
String inputPath, String pipePath) async {
throw UnimplementedError(
'ffmpegKitConfigWriteToPipe() has not been implemented!');
Future<int?> ffmpegKitConfigWriteToPipe(String inputPath, String pipePath) async {
throw UnimplementedError('ffmpegKitConfigWriteToPipe() has not been implemented!');
}
Future<String?> ffmpegKitConfigSelectDocumentForRead(
String? type, List<String>? extraTypes) async {
throw UnimplementedError(
'ffmpegKitConfigSelectDocumentForRead() has not been implemented!');
Future<String?> ffmpegKitConfigSelectDocumentForRead(String? type, List<String>? extraTypes) async {
throw UnimplementedError('ffmpegKitConfigSelectDocumentForRead() has not been implemented!');
}
Future<String?> ffmpegKitConfigSelectDocumentForWrite(
String? title, String? type, List<String>? extraTypes) async {
throw UnimplementedError(
'ffmpegKitConfigSelectDocumentForWrite() has not been implemented!');
Future<String?> ffmpegKitConfigSelectDocumentForWrite(String? title, String? type, List<String>? extraTypes) async {
throw UnimplementedError('ffmpegKitConfigSelectDocumentForWrite() has not been implemented!');
}
Future<String?> ffmpegKitConfigGetSafParameter(
String uriString, String openMode) async {
throw UnimplementedError(
'ffmpegKitConfigGetSafParameter() has not been implemented!');
Future<String?> ffmpegKitConfigGetSafParameter(String uriString, String openMode) async {
throw UnimplementedError('ffmpegKitConfigGetSafParameter() has not been implemented!');
}
// FFmpegKitFlutterInitializer
Future<int?> ffmpegKitFlutterInitializerGetLogLevel() async {
throw UnimplementedError(
'ffmpegKitFlutterInitializerGetLogLevel() has not been implemented!');
throw UnimplementedError('ffmpegKitFlutterInitializerGetLogLevel() has not been implemented!');
}
// FFmpegSession
Future<List<dynamic>?> ffmpegSessionGetAllStatistics(
int? sessionId, int? waitTimeout) async {
throw UnimplementedError(
'ffmpegSessionGetAllStatistics() has not been implemented!');
Future<List<dynamic>?> ffmpegSessionGetAllStatistics(int? sessionId, int? waitTimeout) async {
throw UnimplementedError('ffmpegSessionGetAllStatistics() has not been implemented!');
}
Future<List<dynamic>?> ffmpegSessionGetStatistics(int? sessionId) async {
throw UnimplementedError(
'ffmpegSessionGetStatistics() has not been implemented!');
throw UnimplementedError('ffmpegSessionGetStatistics() has not been implemented!');
}
// FFprobeKit
Future<List<dynamic>?> ffprobeKitListFFprobeSessions() async {
throw UnimplementedError(
'ffprobeKitListFFprobeSessions() has not been implemented!');
throw UnimplementedError('ffprobeKitListFFprobeSessions() has not been implemented!');
}
Future<List<dynamic>?> ffprobeKitListMediaInformationSessions() async {
throw UnimplementedError(
'ffprobeKitListMediaInformationSessions() has not been implemented!');
throw UnimplementedError('ffprobeKitListMediaInformationSessions() has not been implemented!');
}
// MediaInformationJsonParser
Future<Map<dynamic, dynamic>?> mediaInformationJsonParserFrom(
String ffprobeJsonOutput) async {
throw UnimplementedError(
'mediaInformationJsonParserFrom() has not been implemented!');
Future<Map<dynamic, dynamic>?> mediaInformationJsonParserFrom(String ffprobeJsonOutput) async {
throw UnimplementedError('mediaInformationJsonParserFrom() has not been implemented!');
}
Future<Map<dynamic, dynamic>?> mediaInformationJsonParserFromWithError(
String ffprobeJsonOutput) async {
throw UnimplementedError(
'mediaInformationJsonParserFromWithError() has not been implemented!');
Future<Map<dynamic, dynamic>?> mediaInformationJsonParserFromWithError(String ffprobeJsonOutput) async {
throw UnimplementedError('mediaInformationJsonParserFromWithError() has not been implemented!');
}
Future<Map<dynamic, dynamic>?> mediaInformationSessionGetMediaInformation(
int? sessionId) async {
throw UnimplementedError('mediaInformationSessionGetMediaInformation() '
'has not been implemented!');
Future<Map<dynamic, dynamic>?> mediaInformationSessionGetMediaInformation(int? sessionId) async {
throw UnimplementedError(
'mediaInformationSessionGetMediaInformation() '
'has not been implemented!',
);
}
Future<String?> getPackageName() async {
@ -393,7 +327,6 @@ abstract class FFmpegKitPlatform extends PlatformInterface {
}
Future<List<dynamic>?> getExternalLibraries() async {
throw UnimplementedError(
'getExternalLibraries() has not been implemented!');
throw UnimplementedError('getExternalLibraries() has not been implemented!');
}
}

@ -20,13 +20,11 @@
* SOFTWARE.
*/
import 'package:ffmpeg_kit_flutter_platform_interface/ffmpeg_kit_flutter_platform_interface.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/services.dart';
import 'ffmpeg_kit_flutter_platform_interface.dart';
const MethodChannel _channel =
const MethodChannel('flutter.arthenica.com/ffmpeg_kit');
const MethodChannel _channel = MethodChannel('flutter.arthenica.com/ffmpeg_kit');
/// An implementation of [FFmpegKitPlatform] that uses method channels.
class MethodChannelFFmpegKit extends FFmpegKitPlatform {
@ -37,76 +35,58 @@ class MethodChannelFFmpegKit extends FFmpegKitPlatform {
// AbstractSession
@override
Future<Map<dynamic, dynamic>?> abstractSessionCreateFFmpegSession(
List<String> argumentsArray) async =>
_channel.invokeMethod<Map<dynamic, dynamic>>(
'ffmpegSession', {'arguments': argumentsArray});
Future<Map<dynamic, dynamic>?> abstractSessionCreateFFmpegSession(List<String> argumentsArray) async =>
_channel.invokeMethod<Map<dynamic, dynamic>>('ffmpegSession', {'arguments': argumentsArray});
@override
Future<Map<dynamic, dynamic>?> abstractSessionCreateFFprobeSession(
List<String> argumentsArray) async =>
_channel.invokeMethod<Map<dynamic, dynamic>>(
'ffprobeSession', {'arguments': argumentsArray});
Future<Map<dynamic, dynamic>?> abstractSessionCreateFFprobeSession(List<String> argumentsArray) async =>
_channel.invokeMethod<Map<dynamic, dynamic>>('ffprobeSession', {'arguments': argumentsArray});
@override
Future<Map<dynamic, dynamic>?> abstractSessionCreateMediaInformationSession(
List<String> argumentsArray) async =>
_channel.invokeMethod<Map<dynamic, dynamic>>(
'mediaInformationSession', {'arguments': argumentsArray});
Future<Map<dynamic, dynamic>?> abstractSessionCreateMediaInformationSession(List<String> argumentsArray) async =>
_channel.invokeMethod<Map<dynamic, dynamic>>('mediaInformationSession', {'arguments': argumentsArray});
@override
Future<int?> abstractSessionGetEndTime(int? sessionId) async => _channel
.invokeMethod<int>('abstractSessionGetEndTime', {'sessionId': sessionId});
Future<int?> abstractSessionGetEndTime(int? sessionId) async =>
_channel.invokeMethod<int>('abstractSessionGetEndTime', {'sessionId': sessionId});
@override
Future<int?> abstractSessionGetDuration(int? sessionId) async =>
_channel.invokeMethod<int>(
'abstractSessionGetDuration', {'sessionId': sessionId});
_channel.invokeMethod<int>('abstractSessionGetDuration', {'sessionId': sessionId});
@override
Future<List<dynamic>?> abstractSessionGetAllLogs(
int? sessionId, int? waitTimeout) async =>
_channel.invokeMethod<List<dynamic>>('abstractSessionGetAllLogs',
{'sessionId': sessionId, 'waitTimeout': waitTimeout});
Future<List<dynamic>?> abstractSessionGetAllLogs(int? sessionId, int? waitTimeout) async => _channel
.invokeMethod<List<dynamic>>('abstractSessionGetAllLogs', {'sessionId': sessionId, 'waitTimeout': waitTimeout});
@override
Future<List<dynamic>?> abstractSessionGetLogs(int? sessionId) async =>
_channel.invokeMethod<List<dynamic>>(
'abstractSessionGetLogs', {'sessionId': sessionId});
_channel.invokeMethod<List<dynamic>>('abstractSessionGetLogs', {'sessionId': sessionId});
@override
Future<String?> abstractSessionGetAllLogsAsString(
int? sessionId, int? waitTimeout) async =>
_channel.invokeMethod<String>('abstractSessionGetAllLogsAsString',
{'sessionId': sessionId, 'waitTimeout': waitTimeout});
Future<String?> abstractSessionGetAllLogsAsString(int? sessionId, int? waitTimeout) async => _channel
.invokeMethod<String>('abstractSessionGetAllLogsAsString', {'sessionId': sessionId, 'waitTimeout': waitTimeout});
@override
Future<int?> abstractSessionGetState(int? sessionId) async => _channel
.invokeMethod<int>('abstractSessionGetState', {'sessionId': sessionId});
Future<int?> abstractSessionGetState(int? sessionId) async =>
_channel.invokeMethod<int>('abstractSessionGetState', {'sessionId': sessionId});
@override
Future<int?> abstractSessionGetReturnCode(int? sessionId) async =>
_channel.invokeMethod<int>(
'abstractSessionGetReturnCode', {'sessionId': sessionId});
_channel.invokeMethod<int>('abstractSessionGetReturnCode', {'sessionId': sessionId});
@override
Future<String?> abstractSessionGetFailStackTrace(int? sessionId) async =>
_channel.invokeMethod<String>(
'abstractSessionGetFailStackTrace', {'sessionId': sessionId});
_channel.invokeMethod<String>('abstractSessionGetFailStackTrace', {'sessionId': sessionId});
@override
Future<bool> abstractSessionThereAreAsynchronousMessagesInTransmit(
int? sessionId) async =>
_channel.invokeMethod<bool>(
'abstractSessionThereAreAsynchronousMessagesInTransmit',
{'sessionId': sessionId}).then((bool? value) => value ?? false);
Future<bool> abstractSessionThereAreAsynchronousMessagesInTransmit(int? sessionId) async => _channel
.invokeMethod<bool>('abstractSessionThereAreAsynchronousMessagesInTransmit', {'sessionId': sessionId})
.then((value) => value ?? false);
// ArchDetect
@override
Future<String> archDetectGetArch() async => _channel
.invokeMethod<String>('getArch')
.then((String? value) => value ?? "");
Future<String> archDetectGetArch() async => _channel.invokeMethod<String>('getArch').then((value) => value ?? '');
// FFmpegKit
@ -118,36 +98,32 @@ class MethodChannelFFmpegKit extends FFmpegKitPlatform {
_channel.invokeMethod<void>('cancelSession', {'sessionId': sessionId});
@override
Future<List<dynamic>?> ffmpegKitListSessions() async =>
_channel.invokeMethod<List<dynamic>>('getFFmpegSessions');
Future<List<dynamic>?> ffmpegKitListSessions() async => _channel.invokeMethod<List<dynamic>>('getFFmpegSessions');
// FFmpegKitConfig
@override
Future<void> ffmpegKitConfigEnableRedirection() async =>
_channel.invokeMethod<void>('enableRedirection');
Future<void> ffmpegKitConfigEnableRedirection() async => _channel.invokeMethod<void>('enableRedirection');
@override
Future<void> ffmpegKitConfigDisableRedirection() async =>
_channel.invokeMethod<void>('disableRedirection');
Future<void> ffmpegKitConfigDisableRedirection() async => _channel.invokeMethod<void>('disableRedirection');
@override
Future<void> ffmpegKitConfigSetFontconfigConfigurationPath(
String path) async =>
_channel
.invokeMethod<void>('setFontconfigConfigurationPath', {'path': path});
Future<void> ffmpegKitConfigSetFontconfigConfigurationPath(String path) async =>
_channel.invokeMethod<void>('setFontconfigConfigurationPath', {'path': path});
@override
Future<void> ffmpegKitConfigSetFontDirectory(
String path, Map<String, String>? mapping) async =>
_channel.invokeMethod<void>(
'setFontDirectory', {'fontDirectory': path, 'fontNameMap': mapping});
Future<void> ffmpegKitConfigSetFontDirectory(String path, Map<String, String>? mapping) async =>
_channel.invokeMethod<void>('setFontDirectory', {'fontDirectory': path, 'fontNameMap': mapping});
@override
Future<void> ffmpegKitConfigSetFontDirectoryList(
List<String> fontDirectoryList, Map<String, String>? mapping) async =>
_channel.invokeMethod<void>('setFontDirectoryList',
{'fontDirectoryList': fontDirectoryList, 'fontNameMap': mapping});
List<String> fontDirectoryList,
Map<String, String>? mapping,
) async => _channel.invokeMethod<void>('setFontDirectoryList', {
'fontDirectoryList': fontDirectoryList,
'fontNameMap': mapping,
});
@override
Future<String?> ffmpegKitConfigRegisterNewFFmpegPipe() async =>
@ -155,174 +131,139 @@ class MethodChannelFFmpegKit extends FFmpegKitPlatform {
@override
Future<void> ffmpegKitConfigCloseFFmpegPipe(String ffmpegPipePath) async =>
_channel.invokeMethod<void>(
'closeFFmpegPipe', {'ffmpegPipePath': ffmpegPipePath});
_channel.invokeMethod<void>('closeFFmpegPipe', {'ffmpegPipePath': ffmpegPipePath});
@override
Future<String?> ffmpegKitConfigGetFFmpegVersion() async =>
_channel.invokeMethod<String>('getFFmpegVersion');
Future<String?> ffmpegKitConfigGetFFmpegVersion() async => _channel.invokeMethod<String>('getFFmpegVersion');
@override
Future<bool?> ffmpegKitConfigIsLTSBuild() async =>
_channel.invokeMethod<bool>('isLTSBuild');
Future<bool?> ffmpegKitConfigIsLTSBuild() async => _channel.invokeMethod<bool>('isLTSBuild');
@override
Future<String?> ffmpegKitConfigGetBuildDate() async =>
_channel.invokeMethod<String>('getBuildDate');
Future<String?> ffmpegKitConfigGetBuildDate() async => _channel.invokeMethod<String>('getBuildDate');
@override
Future<void> ffmpegKitConfigSetEnvironmentVariable(
String name, String value) async =>
_channel.invokeMethod<void>('setEnvironmentVariable',
{'variableName': name, 'variableValue': value});
Future<void> ffmpegKitConfigSetEnvironmentVariable(String name, String value) async =>
_channel.invokeMethod<void>('setEnvironmentVariable', {'variableName': name, 'variableValue': value});
@override
Future<void> ffmpegKitConfigIgnoreSignal(int signal) async =>
_channel.invokeMethod<void>('ignoreSignal', {'signal': signal});
@override
Future<void> ffmpegKitConfigFFmpegExecute(int? sessionId) async => _channel
.invokeMethod<void>('ffmpegSessionExecute', {'sessionId': sessionId});
Future<void> ffmpegKitConfigFFmpegExecute(int? sessionId) async =>
_channel.invokeMethod<void>('ffmpegSessionExecute', {'sessionId': sessionId});
@override
Future<void> ffmpegKitConfigFFprobeExecute(int? sessionId) async => _channel
.invokeMethod<void>('ffprobeSessionExecute', {'sessionId': sessionId});
Future<void> ffmpegKitConfigFFprobeExecute(int? sessionId) async =>
_channel.invokeMethod<void>('ffprobeSessionExecute', {'sessionId': sessionId});
@override
Future<void> ffmpegKitConfigGetMediaInformationExecute(
int? sessionId, int? waitTimeout) async =>
_channel.invokeMethod<void>('mediaInformationSessionExecute',
{'sessionId': sessionId, 'waitTimeout': waitTimeout});
Future<void> ffmpegKitConfigGetMediaInformationExecute(int? sessionId, int? waitTimeout) async => _channel
.invokeMethod<void>('mediaInformationSessionExecute', {'sessionId': sessionId, 'waitTimeout': waitTimeout});
@override
Future<void> ffmpegKitConfigAsyncFFmpegExecute(int? sessionId) async =>
_channel.invokeMethod<void>(
'asyncFFmpegSessionExecute', {'sessionId': sessionId});
_channel.invokeMethod<void>('asyncFFmpegSessionExecute', {'sessionId': sessionId});
@override
Future<void> ffmpegKitConfigAsyncFFprobeExecute(int? sessionId) async =>
_channel.invokeMethod<void>(
'asyncFFprobeSessionExecute', {'sessionId': sessionId});
_channel.invokeMethod<void>('asyncFFprobeSessionExecute', {'sessionId': sessionId});
@override
Future<void> ffmpegKitConfigAsyncGetMediaInformationExecute(
int? sessionId, int? waitTimeout) async =>
_channel.invokeMethod<void>('asyncMediaInformationSessionExecute',
{'sessionId': sessionId, 'waitTimeout': waitTimeout});
Future<void> ffmpegKitConfigAsyncGetMediaInformationExecute(int? sessionId, int? waitTimeout) async => _channel
.invokeMethod<void>('asyncMediaInformationSessionExecute', {'sessionId': sessionId, 'waitTimeout': waitTimeout});
@override
Future<void> ffmpegKitConfigSetLogLevel(int logLevel) async =>
_channel.invokeMethod<void>('setLogLevel', {'level': logLevel});
@override
Future<int?> ffmpegKitConfigGetSessionHistorySize() async =>
_channel.invokeMethod<int>('getSessionHistorySize');
Future<int?> ffmpegKitConfigGetSessionHistorySize() async => _channel.invokeMethod<int>('getSessionHistorySize');
@override
Future<void> ffmpegKitConfigSetSessionHistorySize(
int sessionHistorySize) async =>
_channel.invokeMethod<void>(
'setSessionHistorySize', {'sessionHistorySize': sessionHistorySize});
Future<void> ffmpegKitConfigSetSessionHistorySize(int sessionHistorySize) async =>
_channel.invokeMethod<void>('setSessionHistorySize', {'sessionHistorySize': sessionHistorySize});
@override
Future<Map<dynamic, dynamic>?> ffmpegKitConfigGetSession(
int sessionId) async =>
_channel.invokeMethod<Map<dynamic, dynamic>>(
'getSession', {'sessionId': sessionId});
Future<Map<dynamic, dynamic>?> ffmpegKitConfigGetSession(int sessionId) async =>
_channel.invokeMethod<Map<dynamic, dynamic>>('getSession', {'sessionId': sessionId});
@override
Future<Map<dynamic, dynamic>?> ffmpegKitConfigGetLastSession() async =>
_channel.invokeMethod<Map<dynamic, dynamic>>('getLastSession');
@override
Future<Map<dynamic, dynamic>?>
ffmpegKitConfigGetLastCompletedSession() async => _channel
.invokeMethod<Map<dynamic, dynamic>>('getLastCompletedSession');
Future<Map<dynamic, dynamic>?> ffmpegKitConfigGetLastCompletedSession() async =>
_channel.invokeMethod<Map<dynamic, dynamic>>('getLastCompletedSession');
@override
Future<List<dynamic>?> ffmpegKitConfigGetSessions() async =>
_channel.invokeMethod<List<dynamic>>('getSessions');
Future<List<dynamic>?> ffmpegKitConfigGetSessions() async => _channel.invokeMethod<List<dynamic>>('getSessions');
@override
Future<void> clearSessions() async =>
_channel.invokeMethod<void>('clearSessions');
Future<void> clearSessions() async => _channel.invokeMethod<void>('clearSessions');
@override
Future<List<dynamic>?> ffmpegKitConfigGetSessionsByState(
int sessionState) async =>
_channel.invokeMethod<List<dynamic>>(
'getSessionsByState', {'state': sessionState});
Future<List<dynamic>?> ffmpegKitConfigGetSessionsByState(int sessionState) async =>
_channel.invokeMethod<List<dynamic>>('getSessionsByState', {'state': sessionState});
@override
Future<int?> ffmpegKitConfigMessagesInTransmit(int sessionId) async =>
_channel
.invokeMethod<int>('messagesInTransmit', {'sessionId': sessionId});
_channel.invokeMethod<int>('messagesInTransmit', {'sessionId': sessionId});
@override
Future<void> ffmpegKitConfigEnableLogs() async =>
_channel.invokeMethod<void>('enableLogs');
Future<void> ffmpegKitConfigEnableLogs() async => _channel.invokeMethod<void>('enableLogs');
@override
Future<void> ffmpegKitConfigDisableLogs() async =>
_channel.invokeMethod<void>('disableLogs');
Future<void> ffmpegKitConfigDisableLogs() async => _channel.invokeMethod<void>('disableLogs');
@override
Future<void> ffmpegKitConfigEnableStatistics() async =>
_channel.invokeMethod<void>('enableStatistics');
Future<void> ffmpegKitConfigEnableStatistics() async => _channel.invokeMethod<void>('enableStatistics');
@override
Future<void> ffmpegKitConfigDisableStatistics() async =>
_channel.invokeMethod<void>('disableStatistics');
Future<void> ffmpegKitConfigDisableStatistics() async => _channel.invokeMethod<void>('disableStatistics');
@override
Future<String?> ffmpegKitConfigGetPlatform() async =>
_channel.invokeMethod<String>('getPlatform');
Future<String?> ffmpegKitConfigGetPlatform() async => _channel.invokeMethod<String>('getPlatform');
@override
Future<int?> ffmpegKitConfigWriteToPipe(
String inputPath, String pipePath) async =>
_channel.invokeMethod<int>(
'writeToPipe', {'input': inputPath, 'pipe': pipePath});
Future<int?> ffmpegKitConfigWriteToPipe(String inputPath, String pipePath) async =>
_channel.invokeMethod<int>('writeToPipe', {'input': inputPath, 'pipe': pipePath});
@override
Future<String?> ffmpegKitConfigSelectDocumentForRead(
String? type, List<String>? extraTypes) async =>
_channel.invokeMethod<String>('selectDocument',
{'writable': false, 'type': type, 'extraTypes': extraTypes});
Future<String?> ffmpegKitConfigSelectDocumentForRead(String? type, List<String>? extraTypes) async =>
_channel.invokeMethod<String>('selectDocument', {'writable': false, 'type': type, 'extraTypes': extraTypes});
@override
Future<String?> ffmpegKitConfigSelectDocumentForWrite(
String? title, String? type, List<String>? extraTypes) async =>
Future<String?> ffmpegKitConfigSelectDocumentForWrite(String? title, String? type, List<String>? extraTypes) async =>
_channel.invokeMethod<String>('selectDocument', {
'writable': true,
'title': title,
'type': type,
'extraTypes': extraTypes
'extraTypes': extraTypes,
});
@override
Future<String?> ffmpegKitConfigGetSafParameter(
String uriString, String openMode) async =>
_channel.invokeMethod<String>(
'getSafParameter', {'uri': uriString, 'openMode': openMode});
Future<String?> ffmpegKitConfigGetSafParameter(String uriString, String openMode) async =>
_channel.invokeMethod<String>('getSafParameter', {'uri': uriString, 'openMode': openMode});
// FFmpegKitFlutterInitializer
Future<int?> ffmpegKitFlutterInitializerGetLogLevel() async =>
_channel.invokeMethod<int>('getLogLevel');
@override
Future<int?> ffmpegKitFlutterInitializerGetLogLevel() async => _channel.invokeMethod<int>('getLogLevel');
// FFmpegSession
@override
Future<List<dynamic>?> ffmpegSessionGetAllStatistics(
int? sessionId, int? waitTimeout) async =>
_channel.invokeMethod<List<dynamic>>('ffmpegSessionGetAllStatistics',
{'sessionId': sessionId, 'waitTimeout': waitTimeout});
Future<List<dynamic>?> ffmpegSessionGetAllStatistics(int? sessionId, int? waitTimeout) async =>
_channel.invokeMethod<List<dynamic>>('ffmpegSessionGetAllStatistics', {
'sessionId': sessionId,
'waitTimeout': waitTimeout,
});
@override
Future<List<dynamic>?> ffmpegSessionGetStatistics(int? sessionId) async =>
_channel.invokeMethod<List<dynamic>>(
'ffmpegSessionGetStatistics', {'sessionId': sessionId});
_channel.invokeMethod<List<dynamic>>('ffmpegSessionGetStatistics', {'sessionId': sessionId});
// FFprobeKit
@ -337,32 +278,24 @@ class MethodChannelFFmpegKit extends FFmpegKitPlatform {
// MediaInformationJsonParser
@override
Future<Map<dynamic, dynamic>?> mediaInformationJsonParserFrom(
String ffprobeJsonOutput) async =>
_channel.invokeMethod<Map<dynamic, dynamic>>(
'mediaInformationJsonParserFrom',
{'ffprobeJsonOutput': ffprobeJsonOutput});
Future<Map<dynamic, dynamic>?> mediaInformationJsonParserFrom(String ffprobeJsonOutput) async => _channel
.invokeMethod<Map<dynamic, dynamic>>('mediaInformationJsonParserFrom', {'ffprobeJsonOutput': ffprobeJsonOutput});
@override
Future<Map<dynamic, dynamic>?> mediaInformationJsonParserFromWithError(
String ffprobeJsonOutput) async =>
_channel.invokeMethod<Map<dynamic, dynamic>>(
'mediaInformationJsonParserFromWithError',
{'ffprobeJsonOutput': ffprobeJsonOutput});
Future<Map<dynamic, dynamic>?> mediaInformationJsonParserFromWithError(String ffprobeJsonOutput) async =>
_channel.invokeMethod<Map<dynamic, dynamic>>('mediaInformationJsonParserFromWithError', {
'ffprobeJsonOutput': ffprobeJsonOutput,
});
// MediaInformationSession
@override
Future<Map<dynamic, dynamic>?> mediaInformationSessionGetMediaInformation(
int? sessionId) async =>
_channel.invokeMethod<Map<dynamic, dynamic>>(
'getMediaInformation', {'sessionId': sessionId});
Future<Map<dynamic, dynamic>?> mediaInformationSessionGetMediaInformation(int? sessionId) async =>
_channel.invokeMethod<Map<dynamic, dynamic>>('getMediaInformation', {'sessionId': sessionId});
@override
Future<String?> getPackageName() async =>
_channel.invokeMethod<String>('getPackageName');
Future<String?> getPackageName() async => _channel.invokeMethod<String>('getPackageName');
@override
Future<List<dynamic>?> getExternalLibraries() async =>
_channel.invokeMethod<List<dynamic>>('getExternalLibraries');
Future<List<dynamic>?> getExternalLibraries() async => _channel.invokeMethod<List<dynamic>>('getExternalLibraries');
}

@ -8,14 +8,13 @@ homepage: https://github.com/arthenica/ffmpeg-kit
version: 0.2.1
environment:
sdk: ">=2.12.0 <3.0.0"
flutter: ">=2.0.0"
sdk: ">=3.7.0 <4.0.0"
flutter: ">=3.29.0"
dependencies:
flutter:
sdk: flutter
plugin_platform_interface: ^2.0.2
plugin_platform_interface: ^2.1.8
dev_dependencies:
flutter_test:
sdk: flutter
carapacik_lints: ^1.11.1

Loading…
Cancel
Save