From 7e16723cc4cea10bff83b4847e90626524c89155 Mon Sep 17 00:00:00 2001 From: Callum Moffat Date: Tue, 11 Jan 2022 13:42:42 -0500 Subject: [PATCH 01/15] Run callbacks on main queue --- .../ios/Classes/FFmpegKitFlutterPlugin.m | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/flutter/flutter/ios/Classes/FFmpegKitFlutterPlugin.m b/flutter/flutter/ios/Classes/FFmpegKitFlutterPlugin.m index c7b5f8a..22381a2 100644 --- a/flutter/flutter/ios/Classes/FFmpegKitFlutterPlugin.m +++ b/flutter/flutter/ios/Classes/FFmpegKitFlutterPlugin.m @@ -112,30 +112,40 @@ extern int const AbstractSessionDefaultTimeoutForAsynchronousMessagesInTransmit; - (void)registerGlobalCallbacks { [FFmpegKitConfig enableFFmpegSessionCompleteCallback:^(FFmpegSession* session){ NSDictionary *dictionary = [FFmpegKitFlutterPlugin toSessionDictionary:session]; - self->_eventSink([FFmpegKitFlutterPlugin toStringDictionary:EVENT_COMPLETE_CALLBACK_EVENT withDictionary:dictionary]); + dispatch_async(dispatch_get_main_queue(), ^() { + self->_eventSink([FFmpegKitFlutterPlugin toStringDictionary:EVENT_COMPLETE_CALLBACK_EVENT withDictionary:dictionary]); + }); }]; [FFmpegKitConfig enableFFprobeSessionCompleteCallback:^(FFprobeSession* session){ NSDictionary *dictionary = [FFmpegKitFlutterPlugin toSessionDictionary:session]; - self->_eventSink([FFmpegKitFlutterPlugin toStringDictionary:EVENT_COMPLETE_CALLBACK_EVENT withDictionary:dictionary]); + dispatch_async(dispatch_get_main_queue(), ^() { + self->_eventSink([FFmpegKitFlutterPlugin toStringDictionary:EVENT_COMPLETE_CALLBACK_EVENT withDictionary:dictionary]); + }); }]; [FFmpegKitConfig enableMediaInformationSessionCompleteCallback:^(MediaInformationSession* session){ NSDictionary *dictionary = [FFmpegKitFlutterPlugin toSessionDictionary:session]; - self->_eventSink([FFmpegKitFlutterPlugin toStringDictionary:EVENT_COMPLETE_CALLBACK_EVENT withDictionary:dictionary]); + dispatch_async(dispatch_get_main_queue(), ^() { + self->_eventSink([FFmpegKitFlutterPlugin toStringDictionary:EVENT_COMPLETE_CALLBACK_EVENT withDictionary:dictionary]); + }); }]; [FFmpegKitConfig enableLogCallback: ^(Log* log){ if (self->logsEnabled) { NSDictionary *dictionary = [FFmpegKitFlutterPlugin toLogDictionary:log]; - self->_eventSink([FFmpegKitFlutterPlugin toStringDictionary:EVENT_LOG_CALLBACK_EVENT withDictionary:dictionary]); + dispatch_async(dispatch_get_main_queue(), ^() { + self->_eventSink([FFmpegKitFlutterPlugin toStringDictionary:EVENT_LOG_CALLBACK_EVENT withDictionary:dictionary]); + }); } }]; [FFmpegKitConfig enableStatisticsCallback:^(Statistics* statistics){ if (self->statisticsEnabled) { NSDictionary *dictionary = [FFmpegKitFlutterPlugin toStatisticsDictionary:statistics]; - self->_eventSink([FFmpegKitFlutterPlugin toStringDictionary:EVENT_STATISTICS_CALLBACK_EVENT withDictionary:dictionary]); + dispatch_async(dispatch_get_main_queue(), ^() { + self->_eventSink([FFmpegKitFlutterPlugin toStringDictionary:EVENT_STATISTICS_CALLBACK_EVENT withDictionary:dictionary]); + }); } }]; } From 10ef18ab6b28790b7a7d31683f3ca3f529f999db Mon Sep 17 00:00:00 2001 From: Taner Sener Date: Fri, 20 May 2022 19:58:41 +0100 Subject: [PATCH 02/15] run flutter macos callbacks on main queue, applies pr 312 on macos --- .../macos/Classes/FFmpegKitFlutterPlugin.m | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/flutter/flutter/macos/Classes/FFmpegKitFlutterPlugin.m b/flutter/flutter/macos/Classes/FFmpegKitFlutterPlugin.m index f9f557e..edaf6e7 100644 --- a/flutter/flutter/macos/Classes/FFmpegKitFlutterPlugin.m +++ b/flutter/flutter/macos/Classes/FFmpegKitFlutterPlugin.m @@ -112,30 +112,40 @@ extern int const AbstractSessionDefaultTimeoutForAsynchronousMessagesInTransmit; - (void)registerGlobalCallbacks { [FFmpegKitConfig enableFFmpegSessionCompleteCallback:^(FFmpegSession* session){ NSDictionary *dictionary = [FFmpegKitFlutterPlugin toSessionDictionary:session]; - self->_eventSink([FFmpegKitFlutterPlugin toStringDictionary:EVENT_COMPLETE_CALLBACK_EVENT withDictionary:dictionary]); + dispatch_async(dispatch_get_main_queue(), ^() { + self->_eventSink([FFmpegKitFlutterPlugin toStringDictionary:EVENT_COMPLETE_CALLBACK_EVENT withDictionary:dictionary]); + }); }]; [FFmpegKitConfig enableFFprobeSessionCompleteCallback:^(FFprobeSession* session){ NSDictionary *dictionary = [FFmpegKitFlutterPlugin toSessionDictionary:session]; - self->_eventSink([FFmpegKitFlutterPlugin toStringDictionary:EVENT_COMPLETE_CALLBACK_EVENT withDictionary:dictionary]); + dispatch_async(dispatch_get_main_queue(), ^() { + self->_eventSink([FFmpegKitFlutterPlugin toStringDictionary:EVENT_COMPLETE_CALLBACK_EVENT withDictionary:dictionary]); + }); }]; [FFmpegKitConfig enableMediaInformationSessionCompleteCallback:^(MediaInformationSession* session){ NSDictionary *dictionary = [FFmpegKitFlutterPlugin toSessionDictionary:session]; - self->_eventSink([FFmpegKitFlutterPlugin toStringDictionary:EVENT_COMPLETE_CALLBACK_EVENT withDictionary:dictionary]); + dispatch_async(dispatch_get_main_queue(), ^() { + self->_eventSink([FFmpegKitFlutterPlugin toStringDictionary:EVENT_COMPLETE_CALLBACK_EVENT withDictionary:dictionary]); + }); }]; [FFmpegKitConfig enableLogCallback: ^(Log* log){ if (self->logsEnabled) { NSDictionary *dictionary = [FFmpegKitFlutterPlugin toLogDictionary:log]; - self->_eventSink([FFmpegKitFlutterPlugin toStringDictionary:EVENT_LOG_CALLBACK_EVENT withDictionary:dictionary]); + dispatch_async(dispatch_get_main_queue(), ^() { + self->_eventSink([FFmpegKitFlutterPlugin toStringDictionary:EVENT_LOG_CALLBACK_EVENT withDictionary:dictionary]); + }); } }]; [FFmpegKitConfig enableStatisticsCallback:^(Statistics* statistics){ if (self->statisticsEnabled) { NSDictionary *dictionary = [FFmpegKitFlutterPlugin toStatisticsDictionary:statistics]; - self->_eventSink([FFmpegKitFlutterPlugin toStringDictionary:EVENT_STATISTICS_CALLBACK_EVENT withDictionary:dictionary]); + dispatch_async(dispatch_get_main_queue(), ^() { + self->_eventSink([FFmpegKitFlutterPlugin toStringDictionary:EVENT_STATISTICS_CALLBACK_EVENT withDictionary:dictionary]); + }); } }]; } From c3d1bff355702cb85bf0a04167c02533447c4ba6 Mon Sep 17 00:00:00 2001 From: Taner Sener Date: Fri, 20 May 2022 23:18:00 +0100 Subject: [PATCH 03/15] implement AbstractSession.cancel method on flutter --- flutter/flutter/lib/abstract_session.dart | 15 ++++++++++++++- flutter/flutter/lib/session.dart | 2 +- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/flutter/flutter/lib/abstract_session.dart b/flutter/flutter/lib/abstract_session.dart index 4667569..36d717d 100644 --- a/flutter/flutter/lib/abstract_session.dart +++ b/flutter/flutter/lib/abstract_session.dart @@ -428,5 +428,18 @@ class AbstractSession extends Session { bool isMediaInformation() => false; /// Cancels running the session. - void cancel() {} + Future cancel() async { + try { + final int? sessionId = getSessionId(); + await FFmpegKitConfig.init(); + if (sessionId == null) { + return _platform.ffmpegKitCancel(); + } else { + return _platform.ffmpegKitCancelSession(sessionId); + } + } on PlatformException catch (e, stack) { + print("Plugin cancel error: ${e.message}"); + return Future.error("cancel failed.", stack); + } + } } diff --git a/flutter/flutter/lib/session.dart b/flutter/flutter/lib/session.dart index 7fe16ae..a4796d8 100644 --- a/flutter/flutter/lib/session.dart +++ b/flutter/flutter/lib/session.dart @@ -106,5 +106,5 @@ abstract class Session { bool isMediaInformation(); /// Cancels running the session. - void cancel(); + Future cancel(); } From afe83f4d98c274bf5f9cb0de4bad725fd5c46d8a Mon Sep 17 00:00:00 2001 From: Patrick Weisensee Date: Fri, 5 Aug 2022 14:16:00 -0700 Subject: [PATCH 04/15] Update React Native README.md Fixes link to Packages --- react-native/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/react-native/README.md b/react-native/README.md index c178125..d2fdcdc 100644 --- a/react-native/README.md +++ b/react-native/README.md @@ -40,7 +40,7 @@ a `ffmpeg-kit-react-native` package with `libvpx` inside. `ffmpeg-kit` provides eight packages that include different sets of external libraries. These packages are named according to the external libraries included in them. Refer to -[Packages](https://github.com/tanersener/ffmpeg-kit#7-packages) section of the project README to see the names +[Packages](https://github.com/tanersener/ffmpeg-kit#8-packages) section of the project README to see the names of those packages and external libraries included in each of them. ##### 2.1.1 Package Names From fb8992a96ce5fad5658131f88bba42126f91f73b Mon Sep 17 00:00:00 2001 From: Taner Sener Date: Tue, 23 Aug 2022 23:47:48 +0100 Subject: [PATCH 05/15] refactor media information classes --- flutter/flutter/lib/chapter.dart | 8 ++-- flutter/flutter/lib/media_information.dart | 52 +++++++++++++-------- flutter/flutter/lib/stream_information.dart | 8 ++-- 3 files changed, 41 insertions(+), 27 deletions(-) diff --git a/flutter/flutter/lib/chapter.dart b/flutter/flutter/lib/chapter.dart index cbf7bfc..cdf6b87 100644 --- a/flutter/flutter/lib/chapter.dart +++ b/flutter/flutter/lib/chapter.dart @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Taner Sener + * Copyright (c) 2021-2022 Taner Sener * * This file is part of FFmpegKit. * @@ -51,7 +51,7 @@ class Chapter { String? getEndTime() => this.getStringProperty(Chapter.keyEndTime); /// Returns all tags. - Map? getTags() => this.getProperties(Chapter.keyTags); + Map? getTags() => this.getProperty(Chapter.keyTags); /// Returns the chapter property associated with the key. String? getStringProperty(String key) => this._allProperties?[key]; @@ -59,8 +59,8 @@ class Chapter { /// Returns the chapter property associated with the key. num? getNumberProperty(String key) => this._allProperties?[key]; - /// Returns the chapter properties associated with the key. - dynamic getProperties(String key) => this._allProperties?[key]; + /// Returns the chapter property associated with the key. + dynamic getProperty(String key) => this._allProperties?[key]; /// Returns all properties found. Map? getAllProperties() => this._allProperties; diff --git a/flutter/flutter/lib/media_information.dart b/flutter/flutter/lib/media_information.dart index 83560f1..1abb89e 100644 --- a/flutter/flutter/lib/media_information.dart +++ b/flutter/flutter/lib/media_information.dart @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2021 Taner Sener + * Copyright (c) 2019-2022 Taner Sener * * This file is part of FFmpegKit. * @@ -22,7 +22,7 @@ import 'stream_information.dart'; /// Media information class. class MediaInformation { - static const keyMediaProperties = "format"; + static const keyFormatProperties = "format"; static const keyFilename = "filename"; static const keyFormat = "format_name"; static const keyFormatLong = "format_long_name"; @@ -38,40 +38,54 @@ class MediaInformation { MediaInformation(this._allProperties); /// Returns file name. - String? getFilename() => this.getStringProperty(MediaInformation.keyFilename); + String? getFilename() => + this.getStringFormatProperty(MediaInformation.keyFilename); /// Returns format. - String? getFormat() => this.getStringProperty(MediaInformation.keyFormat); + String? getFormat() => + this.getStringFormatProperty(MediaInformation.keyFormat); /// Returns long format. String? getLongFormat() => - this.getStringProperty(MediaInformation.keyFormatLong); + this.getStringFormatProperty(MediaInformation.keyFormatLong); /// Returns duration. - String? getDuration() => this.getStringProperty(MediaInformation.keyDuration); + String? getDuration() => + this.getStringFormatProperty(MediaInformation.keyDuration); /// Returns start time. String? getStartTime() => - this.getStringProperty(MediaInformation.keyStartTime); + this.getStringFormatProperty(MediaInformation.keyStartTime); /// Returns size. - String? getSize() => this.getStringProperty(MediaInformation.keySize); + String? getSize() => this.getStringFormatProperty(MediaInformation.keySize); /// Returns bitrate. - String? getBitrate() => this.getStringProperty(MediaInformation.keyBitRate); + String? getBitrate() => + this.getStringFormatProperty(MediaInformation.keyBitRate); /// Returns all tags. Map? getTags() => - this.getProperties(StreamInformation.keyTags); + this.getFormatProperty(StreamInformation.keyTags); - /// Returns the media property associated with the key. - String? getStringProperty(String key) => this.getMediaProperties()?[key]; + /// Returns the property associated with the key. + String? getStringProperty(String key) => this.getAllProperties()?[key]; - /// Returns the media property associated with the key. - num? getNumberProperty(String key) => this.getMediaProperties()?[key]; + /// Returns the property associated with the key. + num? getNumberProperty(String key) => this.getAllProperties()?[key]; - /// Returns the media properties associated with the key. - dynamic getProperties(String key) => this.getMediaProperties()?[key]; + /// Returns the property associated with the key. + dynamic getProperty(String key) => this.getAllProperties()?[key]; + + /// Returns the format property associated with the key. + String? getStringFormatProperty(String key) => + this.getFormatProperties()?[key]; + + /// Returns the format property associated with the key. + num? getNumberFormatProperty(String key) => this.getFormatProperties()?[key]; + + /// Returns the format property associated with the key. + dynamic getFormatProperty(String key) => this.getFormatProperties()?[key]; /// Returns all streams found as a list. List getStreams() { @@ -102,9 +116,9 @@ class MediaInformation { return list; } - /// Returns all media properties. - Map? getMediaProperties() => - this._allProperties?[keyMediaProperties]; + /// Returns all format properties found. + Map? getFormatProperties() => + this._allProperties?[keyFormatProperties]; /// Returns all properties found, including stream properties. Map? getAllProperties() => this._allProperties; diff --git a/flutter/flutter/lib/stream_information.dart b/flutter/flutter/lib/stream_information.dart index eb546b6..0af0528 100644 --- a/flutter/flutter/lib/stream_information.dart +++ b/flutter/flutter/lib/stream_information.dart @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2021 Taner Sener + * Copyright (c) 2019-2022 Taner Sener * * This file is part of FFmpegKit. * @@ -108,7 +108,7 @@ class StreamInformation { /// Returns all tags. Map? getTags() => - this.getProperties(StreamInformation.keyTags); + this.getProperty(StreamInformation.keyTags); /// Returns the stream property associated with the key. String? getStringProperty(String key) => this._allProperties?[key]; @@ -116,8 +116,8 @@ class StreamInformation { /// Returns the stream property associated with the key. num? getNumberProperty(String key) => this._allProperties?[key]; - /// Returns the stream properties associated with the key. - dynamic getProperties(String key) => this._allProperties?[key]; + /// Returns the stream property associated with the key. + dynamic getProperty(String key) => this._allProperties?[key]; /// Returns all properties found. Map? getAllProperties() => this._allProperties; From c43fed69016f4e6b4af8c042c0c119a870f09194 Mon Sep 17 00:00:00 2001 From: Taner Sener Date: Tue, 23 Aug 2022 23:55:37 +0100 Subject: [PATCH 06/15] refactor media information classes --- react-native/src/index.d.ts | 16 ++++-- react-native/src/index.js | 105 +++++++++++++++++++++++++----------- 2 files changed, 86 insertions(+), 35 deletions(-) diff --git a/react-native/src/index.d.ts b/react-native/src/index.d.ts index 8de2b56..551b735 100644 --- a/react-native/src/index.d.ts +++ b/react-native/src/index.d.ts @@ -321,7 +321,7 @@ declare module 'ffmpeg-kit-react-native' { export class MediaInformation { - static readonly KEY_MEDIA_PROPERTIES: string; + static readonly KEY_FORMAT_PROPERTIES: string; static readonly KEY_FILENAME: string; static readonly KEY_FORMAT: string; static readonly KEY_FORMAT_LONG: string; @@ -357,9 +357,15 @@ declare module 'ffmpeg-kit-react-native' { getNumberProperty(key: string): number; - getProperties(key: string): Record; + getProperty(key: string): any; - getMediaProperties(): Record; + getStringFormatProperty(key: string): string; + + getNumberFormatProperty(key: string): number; + + getFormatProperty(key: string): any; + + getFormatProperties(): Record; getAllProperties(): Record; @@ -591,7 +597,7 @@ declare module 'ffmpeg-kit-react-native' { getNumberProperty(key): number; - getProperties(key): Record; + getProperty(key): any; getAllProperties(): Record; @@ -627,7 +633,7 @@ declare module 'ffmpeg-kit-react-native' { getNumberProperty(key): number; - getProperties(key): Record; + getProperty(key): any; getAllProperties(): Record; diff --git a/react-native/src/index.js b/react-native/src/index.js index 03241f1..041544f 100644 --- a/react-native/src/index.js +++ b/react-native/src/index.js @@ -2438,7 +2438,7 @@ export class Log { */ export class MediaInformation { - static KEY_MEDIA_PROPERTIES = "format"; + static KEY_FORMAT_PROPERTIES = "format"; static KEY_FILENAME = "filename"; static KEY_FORMAT = "format_name"; static KEY_FORMAT_LONG = "format_long_name"; @@ -2460,7 +2460,7 @@ export class MediaInformation { * @return media file name */ getFilename() { - return this.getStringProperty(MediaInformation.KEY_FILENAME); + return this.getStringFormatProperty(MediaInformation.KEY_FILENAME); } /** @@ -2469,7 +2469,7 @@ export class MediaInformation { * @return media format */ getFormat() { - return this.getStringProperty(MediaInformation.KEY_FORMAT); + return this.getStringFormatProperty(MediaInformation.KEY_FORMAT); } /** @@ -2478,7 +2478,7 @@ export class MediaInformation { * @return media long format */ getLongFormat() { - return this.getStringProperty(MediaInformation.KEY_FORMAT_LONG); + return this.getStringFormatProperty(MediaInformation.KEY_FORMAT_LONG); } /** @@ -2487,7 +2487,7 @@ export class MediaInformation { * @return media duration in "seconds.microseconds" format */ getDuration() { - return this.getStringProperty(MediaInformation.KEY_DURATION); + return this.getStringFormatProperty(MediaInformation.KEY_DURATION); } /** @@ -2496,7 +2496,7 @@ export class MediaInformation { * @return media start time in milliseconds */ getStartTime() { - return this.getStringProperty(MediaInformation.KEY_START_TIME); + return this.getStringFormatProperty(MediaInformation.KEY_START_TIME); } /** @@ -2505,7 +2505,7 @@ export class MediaInformation { * @return media size in bytes */ getSize() { - return this.getStringProperty(MediaInformation.KEY_SIZE); + return this.getStringFormatProperty(MediaInformation.KEY_SIZE); } /** @@ -2514,7 +2514,7 @@ export class MediaInformation { * @return media bitrate in kb/s */ getBitrate() { - return this.getStringProperty(MediaInformation.KEY_BIT_RATE); + return this.getStringFormatProperty(MediaInformation.KEY_BIT_RATE); } /** @@ -2523,7 +2523,7 @@ export class MediaInformation { * @return tags dictionary */ getTags() { - return this.getProperties(MediaInformation.KEY_TAGS); + return this.getFormatProperty(MediaInformation.KEY_TAGS); } /** @@ -2571,58 +2571,103 @@ export class MediaInformation { } /** - * Returns the media property associated with the key. + * Returns the property associated with the key. * * @param key property key - * @return media property as string or undefined if the key is not found + * @return property as string or undefined if the key is not found */ getStringProperty(key) { - let mediaProperties = this.getMediaProperties(); - if (mediaProperties !== undefined) { - return mediaProperties[key]; + let allProperties = this.getAllProperties(); + if (allProperties !== undefined) { + return allProperties[key]; } else { return undefined; } } /** - * Returns the media property associated with the key. + * Returns the property associated with the key. * * @param key property key - * @return media property as number or undefined if the key is not found + * @return property as number or undefined if the key is not found */ getNumberProperty(key) { - let mediaProperties = this.getMediaProperties(); - if (mediaProperties !== undefined) { - return mediaProperties[key]; + let allProperties = this.getAllProperties(); + if (allProperties !== undefined) { + return allProperties[key]; } else { return undefined; } } /** - * Returns the media properties associated with the key. + * Returns the property associated with the key. * - * @param key properties key - * @return media properties as an object or undefined if the key is not found + * @param key property key + * @return property as an object or undefined if the key is not found */ - getProperties(key) { - let mediaProperties = this.getMediaProperties(); - if (mediaProperties !== undefined) { - return mediaProperties[key]; + getProperty(key) { + let allProperties = this.getAllProperties(); + if (allProperties !== undefined) { + return allProperties[key]; } else { return undefined; } } /** - * Returns all media properties. + * Returns the format property associated with the key. * - * @returns an object where media properties can be accessed by property names + * @param key property key + * @return format property as string or undefined if the key is not found */ - getMediaProperties() { + getStringFormatProperty(key) { + let formatProperties = this.getFormatProperties(); + if (formatProperties !== undefined) { + return formatProperties[key]; + } else { + return undefined; + } + } + + /** + * Returns the format property associated with the key. + * + * @param key property key + * @return format property as number or undefined if the key is not found + */ + getNumberFormatProperty(key) { + let formatProperties = this.getFormatProperties(); + if (formatProperties !== undefined) { + return formatProperties[key]; + } else { + return undefined; + } + } + + /** + * Returns the format property associated with the key. + * + * @param key property key + * @return format property as an object or undefined if the key is not found + */ + getFormatProperty(key) { + let formatProperties = this.getFormatProperties(); + if (formatProperties !== undefined) { + return formatProperties[key]; + } else { + return undefined; + } + } + + /** + * Returns all format properties defined. + * + * @returns an object where format properties can be accessed by property names + */ + getFormatProperties() { if (this.#allProperties !== undefined) { - return this.#allProperties.format; + return this.#allProperties[MediaInformation.KEY_FORMAT_PROPERTIES]; } else { return undefined; } From e0eab9ffa33b4422e42dadbe61999aeb96b8321a Mon Sep 17 00:00:00 2001 From: Taner Sener Date: Wed, 24 Aug 2022 00:12:07 +0100 Subject: [PATCH 07/15] refactor session create methods --- .../flutter/FFmpegKitFlutterPlugin.java | 8 ++++---- .../flutter/ios/Classes/FFmpegKitFlutterPlugin.m | 8 ++++---- flutter/flutter/lib/abstract_session.dart | 4 ++-- flutter/flutter/lib/ffmpeg_session.dart | 7 +------ flutter/flutter/lib/ffprobe_session.dart | 7 +------ .../flutter/lib/media_information_session.dart | 7 +------ flutter/flutter/lib/src/ffmpeg_kit_factory.dart | 16 +++++++--------- .../macos/Classes/FFmpegKitFlutterPlugin.m | 8 ++++---- 8 files changed, 24 insertions(+), 41 deletions(-) diff --git a/flutter/flutter/android/src/main/java/com/arthenica/ffmpegkit/flutter/FFmpegKitFlutterPlugin.java b/flutter/flutter/android/src/main/java/com/arthenica/ffmpegkit/flutter/FFmpegKitFlutterPlugin.java index 3d227bb..479ce82 100644 --- a/flutter/flutter/android/src/main/java/com/arthenica/ffmpegkit/flutter/FFmpegKitFlutterPlugin.java +++ b/flutter/flutter/android/src/main/java/com/arthenica/ffmpegkit/flutter/FFmpegKitFlutterPlugin.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2021 Taner Sener + * Copyright (c) 2018-2022 Taner Sener * * This file is part of FFmpegKit. * @@ -831,7 +831,7 @@ public class FFmpegKitFlutterPlugin implements FlutterPlugin, ActivityAware, Met // FFmpegSession protected void ffmpegSession(@NonNull final List arguments, @NonNull final Result result) { - final FFmpegSession session = new FFmpegSession(arguments.toArray(new String[0]), null, null, null, LogRedirectionStrategy.NEVER_PRINT_LOGS); + final FFmpegSession session = FFmpegSession.create(arguments.toArray(new String[0]), null, null, null, LogRedirectionStrategy.NEVER_PRINT_LOGS); resultHandler.successAsync(result, toMap(session)); } @@ -872,14 +872,14 @@ public class FFmpegKitFlutterPlugin implements FlutterPlugin, ActivityAware, Met // FFprobeSession protected void ffprobeSession(@NonNull final List arguments, @NonNull final Result result) { - final FFprobeSession session = new FFprobeSession(arguments.toArray(new String[0]), null, null, LogRedirectionStrategy.NEVER_PRINT_LOGS); + final FFprobeSession session = FFprobeSession.create(arguments.toArray(new String[0]), null, null, LogRedirectionStrategy.NEVER_PRINT_LOGS); resultHandler.successAsync(result, toMap(session)); } // MediaInformationSession protected void mediaInformationSession(@NonNull final List arguments, @NonNull final Result result) { - final MediaInformationSession session = new MediaInformationSession(arguments.toArray(new String[0]), null, null); + final MediaInformationSession session = MediaInformationSession.create(arguments.toArray(new String[0]), null, null); resultHandler.successAsync(result, toMap(session)); } diff --git a/flutter/flutter/ios/Classes/FFmpegKitFlutterPlugin.m b/flutter/flutter/ios/Classes/FFmpegKitFlutterPlugin.m index 22381a2..d4bf896 100644 --- a/flutter/flutter/ios/Classes/FFmpegKitFlutterPlugin.m +++ b/flutter/flutter/ios/Classes/FFmpegKitFlutterPlugin.m @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2021 Taner Sener + * Copyright (c) 2018-2022 Taner Sener * * This file is part of FFmpegKit. * @@ -573,7 +573,7 @@ extern int const AbstractSessionDefaultTimeoutForAsynchronousMessagesInTransmit; // FFmpegSession - (void)ffmpegSession:(NSArray*)arguments result:(FlutterResult)result { - FFmpegSession* session = [[FFmpegSession alloc] init:arguments withCompleteCallback:nil withLogCallback:nil withStatisticsCallback:nil withLogRedirectionStrategy:LogRedirectionStrategyNeverPrintLogs]; + FFmpegSession* session = [FFmpegSession create:arguments withCompleteCallback:nil withLogCallback:nil withStatisticsCallback:nil withLogRedirectionStrategy:LogRedirectionStrategyNeverPrintLogs]; result([FFmpegKitFlutterPlugin toSessionDictionary:session]); } @@ -614,14 +614,14 @@ extern int const AbstractSessionDefaultTimeoutForAsynchronousMessagesInTransmit; // FFprobeSession - (void)ffprobeSession:(NSArray*)arguments result:(FlutterResult)result { - FFprobeSession* session = [[FFprobeSession alloc] init:arguments withCompleteCallback:nil withLogCallback:nil withLogRedirectionStrategy:LogRedirectionStrategyNeverPrintLogs]; + FFprobeSession* session = [FFprobeSession create:arguments withCompleteCallback:nil withLogCallback:nil withLogRedirectionStrategy:LogRedirectionStrategyNeverPrintLogs]; result([FFmpegKitFlutterPlugin toSessionDictionary:session]); } // MediaInformationSession - (void)mediaInformationSession:(NSArray*)arguments result:(FlutterResult)result { - MediaInformationSession* session = [[MediaInformationSession alloc] init:arguments withCompleteCallback:nil withLogCallback:nil]; + MediaInformationSession* session = [MediaInformationSession create:arguments withCompleteCallback:nil withLogCallback:nil]; result([FFmpegKitFlutterPlugin toSessionDictionary:session]); } diff --git a/flutter/flutter/lib/abstract_session.dart b/flutter/flutter/lib/abstract_session.dart index 36d717d..4cbb521 100644 --- a/flutter/flutter/lib/abstract_session.dart +++ b/flutter/flutter/lib/abstract_session.dart @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2021 Taner Sener + * Copyright (c) 2019-2022 Taner Sener * * This file is part of FFmpegKit. * @@ -35,7 +35,7 @@ import 'src/ffmpeg_kit_factory.dart'; /// Abstract session implementation which includes common features shared by /// "FFmpeg", "FFprobe" and "MediaInformation" sessions. -class AbstractSession extends Session { +abstract class AbstractSession extends Session { static FFmpegKitPlatform _platform = FFmpegKitPlatform.instance; /// Defines how long default "getAll" methods wait, in milliseconds. diff --git a/flutter/flutter/lib/ffmpeg_session.dart b/flutter/flutter/lib/ffmpeg_session.dart index 2cbc777..e3a655c 100644 --- a/flutter/flutter/lib/ffmpeg_session.dart +++ b/flutter/flutter/lib/ffmpeg_session.dart @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2021 Taner Sener + * Copyright (c) 2019-2022 Taner Sener * * This file is part of FFmpegKit. * @@ -49,11 +49,6 @@ class FFmpegSession extends AbstractSession { return session; } - /// Creates a new FFmpeg session from [sessionMap], which includes session - /// fields as map keys. - static FFmpegSession fromMap(Map sessionMap) => - AbstractSession.createFFmpegSessionFromMap(sessionMap); - /// Returns the session specific statistics callback. StatisticsCallback? getStatisticsCallback() => FFmpegKitFactory.getStatisticsCallback(this.getSessionId()); diff --git a/flutter/flutter/lib/ffprobe_session.dart b/flutter/flutter/lib/ffprobe_session.dart index af35a38..42e826d 100644 --- a/flutter/flutter/lib/ffprobe_session.dart +++ b/flutter/flutter/lib/ffprobe_session.dart @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2021 Taner Sener + * Copyright (c) 2019-2022 Taner Sener * * This file is part of FFmpegKit. * @@ -41,11 +41,6 @@ class FFprobeSession extends AbstractSession { return session; } - /// Creates a new FFprobe session from [sessionMap], which includes session - /// fields as map keys. - static FFprobeSession fromMap(Map sessionMap) => - AbstractSession.createFFprobeSessionFromMap(sessionMap); - /// Returns the session specific complete callback. FFprobeSessionCompleteCallback? getCompleteCallback() => FFmpegKitFactory.getFFprobeSessionCompleteCallback(this.getSessionId()); diff --git a/flutter/flutter/lib/media_information_session.dart b/flutter/flutter/lib/media_information_session.dart index c550ca8..472fa1b 100644 --- a/flutter/flutter/lib/media_information_session.dart +++ b/flutter/flutter/lib/media_information_session.dart @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2021 Taner Sener + * Copyright (c) 2019-2022 Taner Sener * * This file is part of FFmpegKit. * @@ -43,11 +43,6 @@ class MediaInformationSession extends AbstractSession { return session; } - /// Creates a new MediaInformation session from [sessionMap], which includes - /// session fields as map keys. - static MediaInformationSession fromMap(Map sessionMap) => - AbstractSession.createMediaInformationSessionFromMap(sessionMap); - /// Returns the media information extracted in this session. MediaInformation? getMediaInformation() => this._mediaInformation; diff --git a/flutter/flutter/lib/src/ffmpeg_kit_factory.dart b/flutter/flutter/lib/src/ffmpeg_kit_factory.dart index bb4529d..9d7d26b 100644 --- a/flutter/flutter/lib/src/ffmpeg_kit_factory.dart +++ b/flutter/flutter/lib/src/ffmpeg_kit_factory.dart @@ -17,15 +17,13 @@ * along with FFmpegKit. If not, see . */ -import '../ffmpeg_session.dart'; +import '../abstract_session.dart'; import '../ffmpeg_session_complete_callback.dart'; -import '../ffprobe_session.dart'; import '../ffprobe_session_complete_callback.dart'; import '../log.dart'; import '../log_callback.dart'; import '../log_redirection_strategy.dart'; import '../media_information.dart'; -import '../media_information_session.dart'; import '../media_information_session_complete_callback.dart'; import '../session.dart'; import '../statistics.dart'; @@ -66,12 +64,12 @@ class FFmpegKitFactory { static Session mapToSession(Map sessionMap) { switch (sessionMap["type"]) { case 2: - return FFprobeSession.fromMap(sessionMap); + return AbstractSession.createFFprobeSessionFromMap(sessionMap); case 3: - return MediaInformationSession.fromMap(sessionMap); + return AbstractSession.createMediaInformationSessionFromMap(sessionMap); case 1: default: - return FFmpegSession.fromMap(sessionMap); + return AbstractSession.createFFmpegSessionFromMap(sessionMap); } } @@ -79,12 +77,12 @@ class FFmpegKitFactory { if (sessionMap != null) { switch (sessionMap["type"]) { case 2: - return FFprobeSession.fromMap(sessionMap); + return AbstractSession.createFFprobeSessionFromMap(sessionMap); case 3: - return MediaInformationSession.fromMap(sessionMap); + return AbstractSession.createMediaInformationSessionFromMap(sessionMap); case 1: default: - return FFmpegSession.fromMap(sessionMap); + return AbstractSession.createFFmpegSessionFromMap(sessionMap); } } else { return null; diff --git a/flutter/flutter/macos/Classes/FFmpegKitFlutterPlugin.m b/flutter/flutter/macos/Classes/FFmpegKitFlutterPlugin.m index edaf6e7..8a2100c 100644 --- a/flutter/flutter/macos/Classes/FFmpegKitFlutterPlugin.m +++ b/flutter/flutter/macos/Classes/FFmpegKitFlutterPlugin.m @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2021 Taner Sener + * Copyright (c) 2018-2022 Taner Sener * * This file is part of FFmpegKit. * @@ -573,7 +573,7 @@ extern int const AbstractSessionDefaultTimeoutForAsynchronousMessagesInTransmit; // FFmpegSession - (void)ffmpegSession:(NSArray*)arguments result:(FlutterResult)result { - FFmpegSession* session = [[FFmpegSession alloc] init:arguments withCompleteCallback:nil withLogCallback:nil withStatisticsCallback:nil withLogRedirectionStrategy:LogRedirectionStrategyNeverPrintLogs]; + FFmpegSession* session = [FFmpegSession create:arguments withCompleteCallback:nil withLogCallback:nil withStatisticsCallback:nil withLogRedirectionStrategy:LogRedirectionStrategyNeverPrintLogs]; result([FFmpegKitFlutterPlugin toSessionDictionary:session]); } @@ -614,14 +614,14 @@ extern int const AbstractSessionDefaultTimeoutForAsynchronousMessagesInTransmit; // FFprobeSession - (void)ffprobeSession:(NSArray*)arguments result:(FlutterResult)result { - FFprobeSession* session = [[FFprobeSession alloc] init:arguments withCompleteCallback:nil withLogCallback:nil withLogRedirectionStrategy:LogRedirectionStrategyNeverPrintLogs]; + FFprobeSession* session = [FFprobeSession create:arguments withCompleteCallback:nil withLogCallback:nil withLogRedirectionStrategy:LogRedirectionStrategyNeverPrintLogs]; result([FFmpegKitFlutterPlugin toSessionDictionary:session]); } // MediaInformationSession - (void)mediaInformationSession:(NSArray*)arguments result:(FlutterResult)result { - MediaInformationSession* session = [[MediaInformationSession alloc] init:arguments withCompleteCallback:nil withLogCallback:nil]; + MediaInformationSession* session = [MediaInformationSession create:arguments withCompleteCallback:nil withLogCallback:nil]; result([FFmpegKitFlutterPlugin toSessionDictionary:session]); } From 235af6a8c33c96fd29aa49e118561540c7e65926 Mon Sep 17 00:00:00 2001 From: Taner Sener Date: Wed, 24 Aug 2022 01:26:43 +0100 Subject: [PATCH 08/15] refactor session create methods --- .../FFmpegKitReactNativeModule.java | 6 +- react-native/ios/FFmpegKitReactNativeModule.m | 6 +- react-native/src/index.d.ts | 14 ---- react-native/src/index.js | 64 +------------------ 4 files changed, 9 insertions(+), 81 deletions(-) diff --git a/react-native/android/src/main/java/com/arthenica/ffmpegkit/reactnative/FFmpegKitReactNativeModule.java b/react-native/android/src/main/java/com/arthenica/ffmpegkit/reactnative/FFmpegKitReactNativeModule.java index bccdcee..8d7ed2c 100644 --- a/react-native/android/src/main/java/com/arthenica/ffmpegkit/reactnative/FFmpegKitReactNativeModule.java +++ b/react-native/android/src/main/java/com/arthenica/ffmpegkit/reactnative/FFmpegKitReactNativeModule.java @@ -344,7 +344,7 @@ public class FFmpegKitReactNativeModule extends ReactContextBaseJavaModule { @ReactMethod public void ffmpegSession(final ReadableArray readableArray, final Promise promise) { - promise.resolve(toMap(new FFmpegSession(toArgumentsArray(readableArray), null, null, null, LogRedirectionStrategy.NEVER_PRINT_LOGS))); + promise.resolve(toMap(FFmpegSession.create(toArgumentsArray(readableArray), null, null, null, LogRedirectionStrategy.NEVER_PRINT_LOGS))); } @ReactMethod @@ -395,14 +395,14 @@ public class FFmpegKitReactNativeModule extends ReactContextBaseJavaModule { @ReactMethod public void ffprobeSession(final ReadableArray readableArray, final Promise promise) { - promise.resolve(toMap(new FFprobeSession(toArgumentsArray(readableArray), null, null, LogRedirectionStrategy.NEVER_PRINT_LOGS))); + promise.resolve(toMap(FFprobeSession.create(toArgumentsArray(readableArray), null, null, LogRedirectionStrategy.NEVER_PRINT_LOGS))); } // MediaInformationSession @ReactMethod public void mediaInformationSession(final ReadableArray readableArray, final Promise promise) { - promise.resolve(toMap(new MediaInformationSession(toArgumentsArray(readableArray), null, null))); + promise.resolve(toMap(MediaInformationSession.create(toArgumentsArray(readableArray), null, null))); } // MediaInformationJsonParser diff --git a/react-native/ios/FFmpegKitReactNativeModule.m b/react-native/ios/FFmpegKitReactNativeModule.m index 7465cda..6cca720 100644 --- a/react-native/ios/FFmpegKitReactNativeModule.m +++ b/react-native/ios/FFmpegKitReactNativeModule.m @@ -244,7 +244,7 @@ RCT_EXPORT_METHOD(getArch:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRe // FFmpegSession RCT_EXPORT_METHOD(ffmpegSession:(NSArray*)arguments resolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject) { - FFmpegSession* session = [[FFmpegSession alloc] init:arguments withCompleteCallback:nil withLogCallback:nil withStatisticsCallback:nil withLogRedirectionStrategy:LogRedirectionStrategyNeverPrintLogs]; + FFmpegSession* session = [FFmpegSession create:arguments withCompleteCallback:nil withLogCallback:nil withStatisticsCallback:nil withLogRedirectionStrategy:LogRedirectionStrategyNeverPrintLogs]; resolve([FFmpegKitReactNativeModule toSessionDictionary:session]); } @@ -285,14 +285,14 @@ RCT_EXPORT_METHOD(ffmpegSessionGetStatistics:(int)sessionId resolver:(RCTPromise // FFprobeSession RCT_EXPORT_METHOD(ffprobeSession:(NSArray*)arguments resolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject) { - FFprobeSession* session = [[FFprobeSession alloc] init:arguments withCompleteCallback:nil withLogCallback:nil withLogRedirectionStrategy:LogRedirectionStrategyNeverPrintLogs]; + FFprobeSession* session = [FFprobeSession create:arguments withCompleteCallback:nil withLogCallback:nil withLogRedirectionStrategy:LogRedirectionStrategyNeverPrintLogs]; resolve([FFmpegKitReactNativeModule toSessionDictionary:session]); } // MediaInformationSession RCT_EXPORT_METHOD(mediaInformationSession:(NSArray*)arguments resolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject) { - MediaInformationSession* session = [[MediaInformationSession alloc] init:arguments withCompleteCallback:nil withLogCallback:nil]; + MediaInformationSession* session = [MediaInformationSession create:arguments withCompleteCallback:nil withLogCallback:nil]; resolve([FFmpegKitReactNativeModule toSessionDictionary:session]); } diff --git a/react-native/src/index.d.ts b/react-native/src/index.d.ts index 551b735..9ac8aab 100644 --- a/react-native/src/index.d.ts +++ b/react-native/src/index.d.ts @@ -2,8 +2,6 @@ declare module 'ffmpeg-kit-react-native' { export abstract class AbstractSession implements Session { - protected constructor(); - static createFFmpegSession(argumentsArray: Array, logRedirectionStrategy?: LogRedirectionStrategy): Promise; static createFFmpegSessionFromMap(sessionMap: { [key: string]: any }): FFmpegSession; @@ -212,12 +210,8 @@ declare module 'ffmpeg-kit-react-native' { export class FFmpegSession extends AbstractSession implements Session { - constructor(); - static create(argumentsArray: Array, completeCallback?: FFmpegSessionCompleteCallback, logCallback?: LogCallback, statisticsCallback?: StatisticsCallback, logRedirectionStrategy?: LogRedirectionStrategy): Promise; - static fromMap(sessionMap: { [key: string]: any }): FFmpegSession; - getStatisticsCallback(): StatisticsCallback; getCompleteCallback(): FFmpegSessionCompleteCallback; @@ -266,12 +260,8 @@ declare module 'ffmpeg-kit-react-native' { export class FFprobeSession extends AbstractSession implements Session { - constructor(); - static create(argumentsArray: Array, completeCallback?: FFprobeSessionCompleteCallback, logCallback?: LogCallback, logRedirectionStrategy?: LogRedirectionStrategy): Promise; - static fromMap(sessionMap: { [key: string]: any }): FFprobeSession; - getCompleteCallback(): FFprobeSessionCompleteCallback; isFFmpeg(): boolean; @@ -381,12 +371,8 @@ declare module 'ffmpeg-kit-react-native' { export class MediaInformationSession extends AbstractSession implements Session { - constructor(); - static create(argumentsArray: Array, completeCallback?: MediaInformationSessionCompleteCallback, logCallback?: LogCallback): Promise; - static fromMap(sessionMap: { [key: string]: any }): MediaInformationSession; - getMediaInformation(): MediaInformation; setMediaInformation(mediaInformation: MediaInformation): void; diff --git a/react-native/src/index.js b/react-native/src/index.js index 041544f..346fbc5 100644 --- a/react-native/src/index.js +++ b/react-native/src/index.js @@ -296,13 +296,6 @@ export class AbstractSession extends Session { */ #logRedirectionStrategy; - /** - * Creates a new abstract session. - */ - constructor() { - super(); - } - /** * Creates a new FFmpeg session. * @@ -1605,12 +1598,12 @@ class FFmpegKitFactory { if (sessionMap !== undefined) { switch (sessionMap.type) { case 2: - return FFprobeSession.fromMap(sessionMap); + return AbstractSession.createFFprobeSessionFromMap(sessionMap); case 3: - return MediaInformationSession.fromMap(sessionMap); + return AbstractSession.createMediaInformationSessionFromMap(sessionMap); case 1: default: - return FFmpegSession.fromMap(sessionMap); + return AbstractSession.createFFmpegSessionFromMap(sessionMap); } } else { return undefined; @@ -1935,13 +1928,6 @@ class FFmpegKitInitializer { */ export class FFmpegSession extends AbstractSession { - /** - * Creates an empty FFmpeg session. - */ - constructor() { - super(); - } - /** * Creates a new FFmpeg session. * @@ -1963,16 +1949,6 @@ export class FFmpegSession extends AbstractSession { return session; } - /** - * Creates a new FFmpeg session from the given map. - * - * @param sessionMap map that includes session fields as map keys - * @returns FFmpeg session created - */ - static fromMap(sessionMap) { - return AbstractSession.createFFmpegSessionFromMap(sessionMap); - } - /** * Returns the session specific statistics callback. * @@ -2252,13 +2228,6 @@ export class FFprobeKit { */ export class FFprobeSession extends AbstractSession { - /** - * Creates an empty FFprobe session. - */ - constructor() { - super(); - } - /** * Creates a new FFprobe session. * @@ -2278,16 +2247,6 @@ export class FFprobeSession extends AbstractSession { return session; } - /** - * Creates a new FFprobe session from the given map. - * - * @param sessionMap map that includes session fields as map keys - * @returns FFprobe session created - */ - static fromMap(sessionMap) { - return AbstractSession.createFFprobeSessionFromMap(sessionMap); - } - /** * Returns the session specific complete callback. * @@ -2722,13 +2681,6 @@ export class MediaInformationJsonParser { export class MediaInformationSession extends AbstractSession { #mediaInformation; - /** - * Creates an empty MediaInformationSession. - */ - constructor() { - super(); - } - /** * Creates a new MediaInformationSession session. * @@ -2747,16 +2699,6 @@ export class MediaInformationSession extends AbstractSession { return session; } - /** - * Creates a new MediaInformationSession from the given map. - * - * @param sessionMap map that includes session fields as map keys - * @returns MediaInformationSession created - */ - static fromMap(sessionMap) { - return AbstractSession.createMediaInformationSessionFromMap(sessionMap); - } - /** * Returns the media information extracted in this session. * From c2a44c0b97125f541038223c25c059918f9471c0 Mon Sep 17 00:00:00 2001 From: Taner Sener Date: Sun, 2 Oct 2022 15:54:42 +0100 Subject: [PATCH 09/15] release flutter plugin v5.1.0 --- README.md | 3 +- docs/index.md | 9 ++-- flutter/flutter/CHANGELOG.md | 10 ++++ flutter/flutter/README.md | 48 +++++++++++-------- flutter/flutter/android/build.gradle | 28 +++++------ .../ios/Classes/FFmpegKitFlutterPlugin.m | 18 ++++--- .../flutter/ios/ffmpeg_kit_flutter.podspec | 34 ++++++------- .../flutter/lib/src/ffmpeg_kit_factory.dart | 5 +- .../macos/Classes/FFmpegKitFlutterPlugin.m | 18 ++++--- .../flutter/macos/ffmpeg_kit_flutter.podspec | 34 ++++++------- flutter/flutter/pubspec.yaml | 4 +- 11 files changed, 114 insertions(+), 97 deletions(-) diff --git a/README.md b/README.md index 2cdc9b9..46496a1 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ It includes scripts to build `FFmpeg` native libraries, a wrapper library to run - Supports hybrid platforms: Flutter, React Native - Based on FFmpeg `v4.5-dev` or later with optional system and external libraries - 8 prebuilt binary packages available at [Github](https://github.com/arthenica/ffmpeg-kit/releases), [Maven Central](https://search.maven.org), [CocoaPods](https://cocoapods.org), [pub](https://pub.dev) and [npm](https://www.npmjs.com) -- Licensed under `LGPL 3.0`, or `GPL v3.0` if GPL licensed libraries are enabled +- Licensed under `LGPL 3.0` by default, `GPL v3.0` if GPL licensed libraries are enabled ### 2. Android @@ -126,6 +126,7 @@ the exact version number of `FFmpeg` is obtained using the `git describe --tags` | Platforms | FFmpegKit Version | FFmpeg Version | Release Date | |:----------------:|:----------------------------------------------------------------------------------:|:--------------:|:------------:| +| Flutter | [5.1.0](https://github.com/arthenica/ffmpeg-kit/releases/tag/flutter.v5.1.0) | 5.1.2 | Oct 02, 2022 | | Android | [5.1](https://github.com/arthenica/ffmpeg-kit/releases/tag/v5.1) | 5.1.2 | Sep 29, 2022 | | Apple | [5.1](https://github.com/arthenica/ffmpeg-kit/releases/tag/v5.1) | 5.1.2 | Sep 29, 2022 | | React Native | [4.5.2](https://github.com/arthenica/ffmpeg-kit/releases/tag/react.native.v4.5.2) | 4.5-dev-3393 | May 25, 2022 | diff --git a/docs/index.md b/docs/index.md index 12d8eed..c60828a 100644 --- a/docs/index.md +++ b/docs/index.md @@ -15,7 +15,7 @@ applications and 8 prebuilt binary packages available at [Github](https://github - Supports hybrid platforms: Flutter, React Native - Based on FFmpeg `v4.5-dev` or later with optional system and external libraries - 8 prebuilt binary packages available at [Github](https://github.com/arthenica/ffmpeg-kit/releases), [Maven Central](https://search.maven.org), [CocoaPods](https://cocoapods.org), [pub](https://pub.dev) and [npm](https://www.npmjs.com) -- Licensed under `LGPL 3.0`, or `GPL v3.0` if GPL licensed libraries are enabled +- Licensed under `LGPL 3.0` by default, some packages licensed by `GPL v3.0` effectively ### 2. Android @@ -112,10 +112,11 @@ the same `FFmpeg` release branch. `dev` part in the version string indicates that `FFmpeg` source code is cloned from the `FFmpeg` `master` branch and the exact version number of `FFmpeg` is obtained using the `git describe --tags` command. -| Platforms | FFmpegKit Version | FFmpeg Version | Release Date | -|:----------------:|:----------------------------------------------------------------------------------:|:--------------:|:------------:| +| Platforms | FFmpegKit Version | FFmpeg Version | Release Date | +|:----------------:|:---------------------------------------------------------------------------------:|:--------------:|:------------:| +| Flutter | [5.1.0](https://github.com/arthenica/ffmpeg-kit/releases/tag/flutter.v5.1.0) | 5.1.2 | Oct 02, 2022 | | Android | [5.1](https://github.com/arthenica/ffmpeg-kit/releases/tag/v5.1) | 5.1.2 | Sep 29, 2022 | -| Apple | [5.1](https://github.com/arthenica/ffmpeg-kit/releases/tag/v5.1) | 5.1.2 | Sep 29, 2022 | +| Apple | [5.1](https://github.com/arthenica/ffmpeg-kit/releases/tag/v5.1) | 5.1.2 | Sep 29, 2022 | | React Native | [4.5.2](https://github.com/arthenica/ffmpeg-kit/releases/tag/react.native.v4.5.2) | 4.5-dev-3393 | May 25, 2022 | | Flutter | [4.5.1](https://github.com/arthenica/ffmpeg-kit/releases/tag/flutter.v4.5.1) | 4.5-dev-3393 | Jan 02, 2022 | | React Native | [4.5.1](https://github.com/arthenica/ffmpeg-kit/releases/tag/react.native.v4.5.1) | 4.5-dev-3393 | Jan 02, 2022 | diff --git a/flutter/flutter/CHANGELOG.md b/flutter/flutter/CHANGELOG.md index 31f1289..38e6d3f 100644 --- a/flutter/flutter/CHANGELOG.md +++ b/flutter/flutter/CHANGELOG.md @@ -1,3 +1,13 @@ +## 5.1.0 +- Feature release based on native v5.1 +- Implements AbstractSession.cancel() method +- Runs iOS and macOS callbacks on main queue + +## 5.1.0-LTS +- Feature release based on native v5.1.LTS +- Implements AbstractSession.cancel() method +- Runs iOS and macOS callbacks on main queue + ## 4.5.1 - Feature release based on native v4.5.1 diff --git a/flutter/flutter/README.md b/flutter/flutter/README.md index 8e2f409..b5623bd 100644 --- a/flutter/flutter/README.md +++ b/flutter/flutter/README.md @@ -5,14 +5,17 @@ - Includes both `FFmpeg` and `FFprobe` - Supports - `Android`, `iOS` and `macOS` - - FFmpeg `v4.5-dev` releases + - FFmpeg `v5.1.2` - `arm-v7a`, `arm-v7a-neon`, `arm64-v8a`, `x86` and `x86_64` architectures on Android - - `Android API Level 16` or later + - `Android API Level 24` or later + - `API Level 16` on LTS releases - `armv7`, `armv7s`, `arm64`, `arm64-simulator`, `i386`, `x86_64`, `x86_64-mac-catalyst` and `arm64-mac-catalyst` architectures on iOS - - `iOS SDK 10` or later + - `iOS SDK 12.1` or later + - `iOS SDK 10` on LTS releases - `arm64` and `x86_64` architectures on macOS - - `macOS SDK 10.12+` or later + - `macOS SDK 10.15` or later + - `macOS SDK 10.12` on LTS releases - Can process Storage Access Framework (SAF) Uris on Android - 25 external libraries @@ -24,7 +27,7 @@ `vid.stab`, `x264`, `x265`, `xvidcore` -- Licensed under LGPL 3.0, can be customized to support GPL v3.0 +- Licensed under `LGPL 3.0` by default, some packages licensed by `GPL v3.0` effectively ### 2. Installation @@ -32,21 +35,21 @@ Add `ffmpeg_kit_flutter` as a dependency in your `pubspec.yaml file`. ```yaml dependencies: - ffmpeg_kit_flutter: 4.5.1 + ffmpeg_kit_flutter: 5.1.0 ``` #### 2.1 Packages -`ffmpeg` includes built-in encoders for some popular formats. However, there are certain external libraries that needs +`FFmpeg` includes built-in encoders for some popular formats. However, there are certain external libraries that needs to be enabled in order to encode specific formats/codecs. For example, to encode an `mp3` file you need `lame` or `shine` library enabled. You have to install a `ffmpeg_kit_flutter` package that has at least one of them inside. To encode an `h264` video, you need to install a package with `x264` inside. To encode `vp8` or `vp9` videos, you need a `ffmpeg_kit_flutter` package with `libvpx` inside. `ffmpeg-kit` provides eight packages that include different sets of external libraries. These packages are named -according to the external libraries included in them. Refer to -[Packages](https://github.com/arthenica/ffmpeg-kit#8-packages) section of the project README to see the names of those -packages and external libraries included in each of them. +according to the external libraries included. Refer to the +[Packages](https://github.com/arthenica/ffmpeg-kit/wiki/Packages) wiki page to see the names of those +packages and external libraries included in each one of them. #### 2.2 Installing Packages @@ -55,7 +58,7 @@ using the following dependency format. ```yaml dependencies: - ffmpeg_kit_flutter_: 4.5.1 + ffmpeg_kit_flutter_: 5.1.0 ``` Note that hyphens in the package name must be replaced with underscores. Additionally, do not forget to use the package @@ -67,39 +70,44 @@ In order to install the `LTS` variant, append `-LTS` to the version you have for ```yaml dependencies: - ffmpeg_kit_flutter: 4.5.1-LTS + ffmpeg_kit_flutter: 5.1.0-LTS ``` #### 2.4 LTS Releases -`ffmpeg_kit_flutter` is published in two different variants: `Main Release` and `LTS Release`. Both releases share the -same source code but is built with different settings (Architectures, API Level, iOS Min SDK, etc.). Refer to -[LTS Releases](https://github.com/arthenica/ffmpeg-kit#10-lts-releases) section of the project README to see how they -compare to each other. +`ffmpeg_kit_flutter` is published in two variants: `Main Release` and `LTS Release`. Both releases share the +same source code but is built with different settings (Architectures, API Level, iOS Min SDK, etc.). Refer to the +[LTS Releases](https://github.com/arthenica/ffmpeg-kit/wiki/LTS-Releases) wiki page to see how they differ from each +other. -#### 2.5 Android and iOS Support +#### 2.5 Platform Support -The following table shows the Android API level and iOS deployment target required in `ffmpeg_kit_flutter` releases. +The following table shows Android API level, iOS deployment target and macOS deployment target requirements in +`ffmpeg_kit_flutter` releases. - - + + + + + +
Main ReleaseLTS ReleaseMain ReleaseLTS Release
Android
API Level
iOS Minimum
Deployment Target
macOS Minimum
Deployment Target
Android
API Level
iOS Minimum
Deployment Target
macOS Minimum
Deployment Target
24 12.110.15 16 1010.12
diff --git a/flutter/flutter/android/build.gradle b/flutter/flutter/android/build.gradle index 0a033dc..7c6b559 100644 --- a/flutter/flutter/android/build.gradle +++ b/flutter/flutter/android/build.gradle @@ -1,24 +1,31 @@ buildscript { repositories { google() - jcenter() + mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:4.2.2' + classpath 'com.android.tools.build:gradle:7.1.2' + } +} + +rootProject.allprojects { + repositories { + google() + mavenCentral() } } apply plugin: 'com.android.library' android { - compileSdkVersion 30 + compileSdkVersion 31 defaultConfig { minSdkVersion 24 - targetSdkVersion 30 - versionCode 451 - versionName "4.5.1" + targetSdkVersion 31 + versionCode 510 + versionName "5.1.0" } buildTypes { @@ -35,14 +42,7 @@ android { } } -repositories { - mavenCentral() - jcenter() - google() -} - dependencies { implementation 'androidx.annotation:annotation:1.2.0' - implementation 'com.arthenica:ffmpeg-kit-https:4.5.1-1' + implementation 'com.arthenica:ffmpeg-kit-https:5.1' } - diff --git a/flutter/flutter/ios/Classes/FFmpegKitFlutterPlugin.m b/flutter/flutter/ios/Classes/FFmpegKitFlutterPlugin.m index d4bf896..a2dac73 100644 --- a/flutter/flutter/ios/Classes/FFmpegKitFlutterPlugin.m +++ b/flutter/flutter/ios/Classes/FFmpegKitFlutterPlugin.m @@ -642,23 +642,21 @@ extern int const AbstractSessionDefaultTimeoutForAsynchronousMessagesInTransmit; // MediaInformationJsonParser - (void)mediaInformationJsonParserFrom:(NSString*)ffprobeJsonOutput result:(FlutterResult)result { - NSError *error; - MediaInformation* mediaInformation = [MediaInformationJsonParser from:ffprobeJsonOutput with:error]; - if (error == nil) { + @try { + MediaInformation* mediaInformation = [MediaInformationJsonParser fromWithError:ffprobeJsonOutput]; result([FFmpegKitFlutterPlugin toMediaInformationDictionary:mediaInformation]); - } else { - NSLog(@"Parsing MediaInformation failed: %@.\n", error); + } @catch (NSException *exception) { + NSLog(@"Parsing MediaInformation failed: %@.\n", [NSString stringWithFormat:@"%@\n%@", [exception userInfo], [exception callStackSymbols]]); result(nil); } } - (void)mediaInformationJsonParserFromWithError:(NSString*)ffprobeJsonOutput result:(FlutterResult)result { - NSError *error; - MediaInformation* mediaInformation = [MediaInformationJsonParser from:ffprobeJsonOutput with:error]; - if (error == nil) { + @try { + MediaInformation* mediaInformation = [MediaInformationJsonParser fromWithError:ffprobeJsonOutput]; result([FFmpegKitFlutterPlugin toMediaInformationDictionary:mediaInformation]); - } else { - NSLog(@"Parsing MediaInformation failed: %@.\n", error); + } @catch (NSException *exception) { + NSLog(@"Parsing MediaInformation failed: %@.\n", [NSString stringWithFormat:@"%@\n%@", [exception userInfo], [exception callStackSymbols]]); result([FlutterError errorWithCode:@"PARSE_FAILED" message:@"Parsing MediaInformation failed with JSON error." details:nil]); } } diff --git a/flutter/flutter/ios/ffmpeg_kit_flutter.podspec b/flutter/flutter/ios/ffmpeg_kit_flutter.podspec index ba33a6e..afd9360 100644 --- a/flutter/flutter/ios/ffmpeg_kit_flutter.podspec +++ b/flutter/flutter/ios/ffmpeg_kit_flutter.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'ffmpeg_kit_flutter' - s.version = '4.5.1' + s.version = '5.1.0' s.summary = 'FFmpeg Kit for Flutter' s.description = 'A Flutter plugin for running FFmpeg and FFprobe commands.' s.homepage = 'https://github.com/arthenica/ffmpeg-kit' @@ -23,112 +23,112 @@ Pod::Spec.new do |s| s.subspec 'min' do |ss| ss.source_files = 'Classes/**/*' ss.public_header_files = 'Classes/**/*.h' - ss.dependency 'ffmpeg-kit-ios-min', "4.5.1" + ss.dependency 'ffmpeg-kit-ios-min', "5.1" ss.ios.deployment_target = '12.1' end s.subspec 'min-lts' do |ss| ss.source_files = 'Classes/**/*' ss.public_header_files = 'Classes/**/*.h' - ss.dependency 'ffmpeg-kit-ios-min', "4.5.1.LTS" + ss.dependency 'ffmpeg-kit-ios-min', "5.1.LTS" ss.ios.deployment_target = '10' end s.subspec 'min-gpl' do |ss| ss.source_files = 'Classes/**/*' ss.public_header_files = 'Classes/**/*.h' - ss.dependency 'ffmpeg-kit-ios-min-gpl', "4.5.1" + ss.dependency 'ffmpeg-kit-ios-min-gpl', "5.1" ss.ios.deployment_target = '12.1' 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', "4.5.1.LTS" + ss.dependency 'ffmpeg-kit-ios-min-gpl', "5.1.LTS" ss.ios.deployment_target = '10' end s.subspec 'https' do |ss| ss.source_files = 'Classes/**/*' ss.public_header_files = 'Classes/**/*.h' - ss.dependency 'ffmpeg-kit-ios-https', "4.5.1" + ss.dependency 'ffmpeg-kit-ios-https', "5.1" ss.ios.deployment_target = '12.1' end s.subspec 'https-lts' do |ss| ss.source_files = 'Classes/**/*' ss.public_header_files = 'Classes/**/*.h' - ss.dependency 'ffmpeg-kit-ios-https', "4.5.1.LTS" + ss.dependency 'ffmpeg-kit-ios-https', "5.1.LTS" ss.ios.deployment_target = '10' end s.subspec 'https-gpl' do |ss| ss.source_files = 'Classes/**/*' ss.public_header_files = 'Classes/**/*.h' - ss.dependency 'ffmpeg-kit-ios-https-gpl', "4.5.1" + ss.dependency 'ffmpeg-kit-ios-https-gpl', "5.1" ss.ios.deployment_target = '12.1' 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', "4.5.1.LTS" + ss.dependency 'ffmpeg-kit-ios-https-gpl', "5.1.LTS" ss.ios.deployment_target = '10' end s.subspec 'audio' do |ss| ss.source_files = 'Classes/**/*' ss.public_header_files = 'Classes/**/*.h' - ss.dependency 'ffmpeg-kit-ios-audio', "4.5.1" + ss.dependency 'ffmpeg-kit-ios-audio', "5.1" ss.ios.deployment_target = '12.1' end s.subspec 'audio-lts' do |ss| ss.source_files = 'Classes/**/*' ss.public_header_files = 'Classes/**/*.h' - ss.dependency 'ffmpeg-kit-ios-audio', "4.5.1.LTS" + ss.dependency 'ffmpeg-kit-ios-audio', "5.1.LTS" ss.ios.deployment_target = '10' end s.subspec 'video' do |ss| ss.source_files = 'Classes/**/*' ss.public_header_files = 'Classes/**/*.h' - ss.dependency 'ffmpeg-kit-ios-video', "4.5.1" + ss.dependency 'ffmpeg-kit-ios-video', "5.1" ss.ios.deployment_target = '12.1' end s.subspec 'video-lts' do |ss| ss.source_files = 'Classes/**/*' ss.public_header_files = 'Classes/**/*.h' - ss.dependency 'ffmpeg-kit-ios-video', "4.5.1.LTS" + ss.dependency 'ffmpeg-kit-ios-video', "5.1.LTS" ss.ios.deployment_target = '10' end s.subspec 'full' do |ss| ss.source_files = 'Classes/**/*' ss.public_header_files = 'Classes/**/*.h' - ss.dependency 'ffmpeg-kit-ios-full', "4.5.1" + ss.dependency 'ffmpeg-kit-ios-full', "5.1" ss.ios.deployment_target = '12.1' end s.subspec 'full-lts' do |ss| ss.source_files = 'Classes/**/*' ss.public_header_files = 'Classes/**/*.h' - ss.dependency 'ffmpeg-kit-ios-full', "4.5.1.LTS" + ss.dependency 'ffmpeg-kit-ios-full', "5.1.LTS" ss.ios.deployment_target = '10' end s.subspec 'full-gpl' do |ss| ss.source_files = 'Classes/**/*' ss.public_header_files = 'Classes/**/*.h' - ss.dependency 'ffmpeg-kit-ios-full-gpl', "4.5.1" + ss.dependency 'ffmpeg-kit-ios-full-gpl', "5.1" ss.ios.deployment_target = '12.1' 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', "4.5.1.LTS" + ss.dependency 'ffmpeg-kit-ios-full-gpl', "5.1.LTS" ss.ios.deployment_target = '10' end diff --git a/flutter/flutter/lib/src/ffmpeg_kit_factory.dart b/flutter/flutter/lib/src/ffmpeg_kit_factory.dart index 9d7d26b..d72fca1 100644 --- a/flutter/flutter/lib/src/ffmpeg_kit_factory.dart +++ b/flutter/flutter/lib/src/ffmpeg_kit_factory.dart @@ -79,7 +79,8 @@ 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); @@ -98,7 +99,7 @@ class FFmpegKitFactory { } } - static String getVersion() => "4.5.1"; + static String getVersion() => "5.1.0"; static LogRedirectionStrategy? getLogRedirectionStrategy(int? sessionId) => logRedirectionStrategyMap[sessionId]; diff --git a/flutter/flutter/macos/Classes/FFmpegKitFlutterPlugin.m b/flutter/flutter/macos/Classes/FFmpegKitFlutterPlugin.m index 8a2100c..b616988 100644 --- a/flutter/flutter/macos/Classes/FFmpegKitFlutterPlugin.m +++ b/flutter/flutter/macos/Classes/FFmpegKitFlutterPlugin.m @@ -642,23 +642,21 @@ extern int const AbstractSessionDefaultTimeoutForAsynchronousMessagesInTransmit; // MediaInformationJsonParser - (void)mediaInformationJsonParserFrom:(NSString*)ffprobeJsonOutput result:(FlutterResult)result { - NSError *error; - MediaInformation* mediaInformation = [MediaInformationJsonParser from:ffprobeJsonOutput with:error]; - if (error == nil) { + @try { + MediaInformation* mediaInformation = [MediaInformationJsonParser fromWithError:ffprobeJsonOutput]; result([FFmpegKitFlutterPlugin toMediaInformationDictionary:mediaInformation]); - } else { - NSLog(@"Parsing MediaInformation failed: %@.\n", error); + } @catch (NSException *exception) { + NSLog(@"Parsing MediaInformation failed: %@.\n", [NSString stringWithFormat:@"%@\n%@", [exception userInfo], [exception callStackSymbols]]); result(nil); } } - (void)mediaInformationJsonParserFromWithError:(NSString*)ffprobeJsonOutput result:(FlutterResult)result { - NSError *error; - MediaInformation* mediaInformation = [MediaInformationJsonParser from:ffprobeJsonOutput with:error]; - if (error == nil) { + @try { + MediaInformation* mediaInformation = [MediaInformationJsonParser fromWithError:ffprobeJsonOutput]; result([FFmpegKitFlutterPlugin toMediaInformationDictionary:mediaInformation]); - } else { - NSLog(@"Parsing MediaInformation failed: %@.\n", error); + } @catch (NSException *exception) { + NSLog(@"Parsing MediaInformation failed: %@.\n", [NSString stringWithFormat:@"%@\n%@", [exception userInfo], [exception callStackSymbols]]); result([FlutterError errorWithCode:@"PARSE_FAILED" message:@"Parsing MediaInformation failed with JSON error." details:nil]); } } diff --git a/flutter/flutter/macos/ffmpeg_kit_flutter.podspec b/flutter/flutter/macos/ffmpeg_kit_flutter.podspec index 083244d..ee93a39 100644 --- a/flutter/flutter/macos/ffmpeg_kit_flutter.podspec +++ b/flutter/flutter/macos/ffmpeg_kit_flutter.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'ffmpeg_kit_flutter' - s.version = '4.5.1' + s.version = '5.1.0' s.summary = 'FFmpeg Kit for Flutter' s.description = 'A Flutter plugin for running FFmpeg and FFprobe commands.' s.homepage = 'https://github.com/arthenica/ffmpeg-kit' @@ -23,112 +23,112 @@ Pod::Spec.new do |s| s.subspec 'min' do |ss| ss.source_files = 'Classes/**/*' ss.public_header_files = 'Classes/**/*.h' - ss.dependency 'ffmpeg-kit-macos-min', "4.5.1" + ss.dependency 'ffmpeg-kit-macos-min', "5.1" ss.osx.deployment_target = '10.15' end s.subspec 'min-lts' do |ss| ss.source_files = 'Classes/**/*' ss.public_header_files = 'Classes/**/*.h' - ss.dependency 'ffmpeg-kit-macos-min', "4.5.1.LTS" + ss.dependency 'ffmpeg-kit-macos-min', "5.1.LTS" ss.osx.deployment_target = '10.12' end s.subspec 'min-gpl' do |ss| ss.source_files = 'Classes/**/*' ss.public_header_files = 'Classes/**/*.h' - ss.dependency 'ffmpeg-kit-macos-min-gpl', "4.5.1" + ss.dependency 'ffmpeg-kit-macos-min-gpl', "5.1" ss.osx.deployment_target = '10.15' 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', "4.5.1.LTS" + ss.dependency 'ffmpeg-kit-macos-min-gpl', "5.1.LTS" ss.osx.deployment_target = '10.12' end s.subspec 'https' do |ss| ss.source_files = 'Classes/**/*' ss.public_header_files = 'Classes/**/*.h' - ss.dependency 'ffmpeg-kit-macos-https', "4.5.1" + ss.dependency 'ffmpeg-kit-macos-https', "5.1" ss.osx.deployment_target = '10.15' end s.subspec 'https-lts' do |ss| ss.source_files = 'Classes/**/*' ss.public_header_files = 'Classes/**/*.h' - ss.dependency 'ffmpeg-kit-macos-https', "4.5.1.LTS" + ss.dependency 'ffmpeg-kit-macos-https', "5.1.LTS" ss.osx.deployment_target = '10.12' end s.subspec 'https-gpl' do |ss| ss.source_files = 'Classes/**/*' ss.public_header_files = 'Classes/**/*.h' - ss.dependency 'ffmpeg-kit-macos-https-gpl', "4.5.1" + ss.dependency 'ffmpeg-kit-macos-https-gpl', "5.1" ss.osx.deployment_target = '10.15' 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', "4.5.1.LTS" + ss.dependency 'ffmpeg-kit-macos-https-gpl', "5.1.LTS" ss.osx.deployment_target = '10.12' end s.subspec 'audio' do |ss| ss.source_files = 'Classes/**/*' ss.public_header_files = 'Classes/**/*.h' - ss.dependency 'ffmpeg-kit-macos-audio', "4.5.1" + ss.dependency 'ffmpeg-kit-macos-audio', "5.1" ss.osx.deployment_target = '10.15' end s.subspec 'audio-lts' do |ss| ss.source_files = 'Classes/**/*' ss.public_header_files = 'Classes/**/*.h' - ss.dependency 'ffmpeg-kit-macos-audio', "4.5.1.LTS" + ss.dependency 'ffmpeg-kit-macos-audio', "5.1.LTS" ss.osx.deployment_target = '10.12' end s.subspec 'video' do |ss| ss.source_files = 'Classes/**/*' ss.public_header_files = 'Classes/**/*.h' - ss.dependency 'ffmpeg-kit-macos-video', "4.5.1" + ss.dependency 'ffmpeg-kit-macos-video', "5.1" ss.osx.deployment_target = '10.15' end s.subspec 'video-lts' do |ss| ss.source_files = 'Classes/**/*' ss.public_header_files = 'Classes/**/*.h' - ss.dependency 'ffmpeg-kit-macos-video', "4.5.1.LTS" + ss.dependency 'ffmpeg-kit-macos-video', "5.1.LTS" ss.osx.deployment_target = '10.12' end s.subspec 'full' do |ss| ss.source_files = 'Classes/**/*' ss.public_header_files = 'Classes/**/*.h' - ss.dependency 'ffmpeg-kit-macos-full', "4.5.1" + ss.dependency 'ffmpeg-kit-macos-full', "5.1" ss.osx.deployment_target = '10.15' end s.subspec 'full-lts' do |ss| ss.source_files = 'Classes/**/*' ss.public_header_files = 'Classes/**/*.h' - ss.dependency 'ffmpeg-kit-macos-full', "4.5.1.LTS" + ss.dependency 'ffmpeg-kit-macos-full', "5.1.LTS" ss.osx.deployment_target = '10.12' end s.subspec 'full-gpl' do |ss| ss.source_files = 'Classes/**/*' ss.public_header_files = 'Classes/**/*.h' - ss.dependency 'ffmpeg-kit-macos-full-gpl', "4.5.1" + ss.dependency 'ffmpeg-kit-macos-full-gpl', "5.1" ss.osx.deployment_target = '10.15' 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', "4.5.1.LTS" + ss.dependency 'ffmpeg-kit-macos-full-gpl', "5.1.LTS" ss.osx.deployment_target = '10.12' end diff --git a/flutter/flutter/pubspec.yaml b/flutter/flutter/pubspec.yaml index 5af935f..c592e26 100644 --- a/flutter/flutter/pubspec.yaml +++ b/flutter/flutter/pubspec.yaml @@ -3,7 +3,7 @@ description: FFmpeg Kit for Flutter. Supports Android, iOS and macOS platforms. repository: https://github.com/arthenica/ffmpeg-kit issue_tracker: https://github.com/arthenica/ffmpeg-kit/issues homepage: https://github.com/arthenica/ffmpeg-kit -version: 4.5.1 +version: 5.1.0 environment: sdk: ">=2.12.0 <3.0.0" @@ -28,4 +28,4 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - plugin_platform_interface: ^2.0.2 + plugin_platform_interface: ^2.1.3 From b3379ce59770eda0aa5372491d917bac21bab0e3 Mon Sep 17 00:00:00 2001 From: Taner Sener Date: Sun, 2 Oct 2022 20:45:51 +0100 Subject: [PATCH 10/15] release react-native plugin v5.1.0 --- .github/pull_request_template.md | 2 +- README.md | 7 ++-- docs/index.md | 1 + react-native/README.md | 28 ++++++++-------- react-native/android/build.gradle | 17 +++++----- react-native/android/gradle.properties | 4 +-- .../gradle/wrapper/gradle-wrapper.properties | 2 +- react-native/ffmpeg-kit-react-native.podspec | 32 +++++++++---------- react-native/ios/FFmpegKitReactNativeModule.m | 18 +++++------ react-native/package.json | 4 +-- react-native/src/index.js | 22 ++++++------- 11 files changed, 69 insertions(+), 68 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index fe16e58..0cd01d1 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -8,7 +8,7 @@ Please also include the context and motivation about the changes introduced. - Documentation ## Checks -- [ ] Changes support all platforms (`Android`, `iOS`, `Linux`, macOS`, `tvOS`) +- [ ] Changes support all platforms (`Android`, `iOS`, `Linux`, `macOS`, `tvOS`) - [ ] Breaks existing functionality - [ ] Implementation is completed, not half-done - [ ] Is there another PR already created for this feature/bug fix diff --git a/README.md b/README.md index 46496a1..3d8e0c1 100644 --- a/README.md +++ b/README.md @@ -124,11 +124,12 @@ the same `FFmpeg` release branch. `dev` part in the version string indicates that `FFmpeg` source code is cloned from the `FFmpeg` `master` branch and the exact version number of `FFmpeg` is obtained using the `git describe --tags` command. -| Platforms | FFmpegKit Version | FFmpeg Version | Release Date | -|:----------------:|:----------------------------------------------------------------------------------:|:--------------:|:------------:| +| Platforms | FFmpegKit Version | FFmpeg Version | Release Date | +|:----------------:|:---------------------------------------------------------------------------------:|:--------------:|:------------:| +| React Native | [5.1.0](https://github.com/arthenica/ffmpeg-kit/releases/tag/react.native.v5.1.0) | 5.1.2 | Oct 02, 2022 | | Flutter | [5.1.0](https://github.com/arthenica/ffmpeg-kit/releases/tag/flutter.v5.1.0) | 5.1.2 | Oct 02, 2022 | | Android | [5.1](https://github.com/arthenica/ffmpeg-kit/releases/tag/v5.1) | 5.1.2 | Sep 29, 2022 | -| Apple | [5.1](https://github.com/arthenica/ffmpeg-kit/releases/tag/v5.1) | 5.1.2 | Sep 29, 2022 | +| Apple | [5.1](https://github.com/arthenica/ffmpeg-kit/releases/tag/v5.1) | 5.1.2 | Sep 29, 2022 | | React Native | [4.5.2](https://github.com/arthenica/ffmpeg-kit/releases/tag/react.native.v4.5.2) | 4.5-dev-3393 | May 25, 2022 | | Flutter | [4.5.1](https://github.com/arthenica/ffmpeg-kit/releases/tag/flutter.v4.5.1) | 4.5-dev-3393 | Jan 02, 2022 | | React Native | [4.5.1](https://github.com/arthenica/ffmpeg-kit/releases/tag/react.native.v4.5.1) | 4.5-dev-3393 | Jan 02, 2022 | diff --git a/docs/index.md b/docs/index.md index c60828a..cc9aeb4 100644 --- a/docs/index.md +++ b/docs/index.md @@ -114,6 +114,7 @@ the exact version number of `FFmpeg` is obtained using the `git describe --tags` | Platforms | FFmpegKit Version | FFmpeg Version | Release Date | |:----------------:|:---------------------------------------------------------------------------------:|:--------------:|:------------:| +| React Native | [5.1.0](https://github.com/arthenica/ffmpeg-kit/releases/tag/react.native.v5.1.0) | 5.1.2 | Oct 02, 2022 | | Flutter | [5.1.0](https://github.com/arthenica/ffmpeg-kit/releases/tag/flutter.v5.1.0) | 5.1.2 | Oct 02, 2022 | | Android | [5.1](https://github.com/arthenica/ffmpeg-kit/releases/tag/v5.1) | 5.1.2 | Sep 29, 2022 | | Apple | [5.1](https://github.com/arthenica/ffmpeg-kit/releases/tag/v5.1) | 5.1.2 | Sep 29, 2022 | diff --git a/react-native/README.md b/react-native/README.md index d72fac0..fd1a2f1 100644 --- a/react-native/README.md +++ b/react-native/README.md @@ -4,11 +4,13 @@ - Includes both `FFmpeg` and `FFprobe` - Supports - Both `Android` and `iOS` - - FFmpeg `v4.5-dev` releases + - FFmpeg `v5.1.2` - `arm-v7a`, `arm-v7a-neon`, `arm64-v8a`, `x86` and `x86_64` architectures on Android - - `Android API Level 16` or later + - `Android API Level 24` or later + - `API Level 16` on LTS releases - `armv7`, `armv7s`, `arm64`, `arm64-simulator`, `i386`, `x86_64`, `x86_64-mac-catalyst` and `arm64-mac-catalyst` architectures on iOS - - `iOS SDK 10` or later + - `iOS SDK 12.1` or later + - `iOS SDK 10` on LTS releases - Can process Storage Access Framework (SAF) Uris on Android - 25 external libraries @@ -22,7 +24,7 @@ - `bzip2`, `iconv`, `libuuid`, `zlib` system libraries and `AudioToolbox`, `VideoToolbox`, `AVFoundation` system frameworks on iOS - Includes Typescript definitions -- Licensed under LGPL 3.0, can be customized to support GPL v3.0 +- Licensed under `LGPL 3.0` by default, some packages licensed by `GPL v3.0` effectively ### 2. Installation @@ -32,16 +34,16 @@ yarn add ffmpeg-kit-react-native #### 2.1 Packages -`ffmpeg` includes built-in encoders for some popular formats. However, there are certain external libraries that needs +`FFmpeg` includes built-in encoders for some popular formats. However, there are certain external libraries that needs to be enabled in order to encode specific formats/codecs. For example, to encode an `mp3` file you need `lame` or `shine` library enabled. You have to install a `ffmpeg-kit-react-native` package that has at least one of them inside. To encode an `h264` video, you need to install a package with `x264` inside. To encode `vp8` or `vp9` videos, you need a `ffmpeg-kit-react-native` package with `libvpx` inside. -`ffmpeg-kit` provides eight packages that include different sets of external libraries. These packages are -named according to the external libraries included in them. Refer to -[Packages](https://github.com/arthenica/ffmpeg-kit#9-packages) section of the project README to see the names -of those packages and external libraries included in each of them. +`ffmpeg-kit` provides eight packages that include different sets of external libraries. These packages are named +according to the external libraries included. Refer to the +[Packages](https://github.com/arthenica/ffmpeg-kit/wiki/Packages) wiki page to see the names of those +packages and external libraries included in each one of them. ##### 2.1.1 Package Names @@ -184,10 +186,10 @@ the package name you are using. #### 2.4 LTS Releases -`ffmpeg-kit-react-native` is published in two different variants: `Main Release` and `LTS Release`. Both releases -share the same source code but is built with different settings (Architectures, API Level, iOS Min SDK, etc.). Refer to -[LTS Releases](https://github.com/arthenica/ffmpeg-kit#11-lts-releases) section of the project README to see how they -compare to each other. +`ffmpeg-kit-react-native` is published in two variants: `Main Release` and `LTS Release`. Both releases share the +same source code but is built with different settings (Architectures, API Level, iOS Min SDK, etc.). Refer to the +[LTS Releases](https://github.com/arthenica/ffmpeg-kit/wiki/LTS-Releases) wiki page to see how they differ from each +other. ### 3. Using diff --git a/react-native/android/build.gradle b/react-native/android/build.gradle index e00921b..dcb21f2 100644 --- a/react-native/android/build.gradle +++ b/react-native/android/build.gradle @@ -1,11 +1,11 @@ buildscript { repositories { google() - jcenter() + mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:4.2.2' + classpath 'com.android.tools.build:gradle:7.3.0' } } @@ -26,13 +26,13 @@ def safeExtGet(String prop, String fallback) { } android { - compileSdkVersion 30 + compileSdkVersion 31 defaultConfig { minSdkVersion safeExtGet('ffmpegKitPackage', 'https').contains("-lts") ? 16 : 24 - targetSdkVersion 30 - versionCode 452 - versionName "4.5.2" + targetSdkVersion 31 + versionCode 510 + versionName "5.1.0" } buildTypes { @@ -44,14 +44,13 @@ android { disable 'GradleCompatible' } compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + sourceCompatibility JavaVersion.VERSION_11 + targetCompatibility JavaVersion.VERSION_11 } } repositories { mavenCentral() - jcenter() google() def found = false diff --git a/react-native/android/gradle.properties b/react-native/android/gradle.properties index 389aa70..e1fff5b 100644 --- a/react-native/android/gradle.properties +++ b/react-native/android/gradle.properties @@ -1,3 +1,3 @@ android.useAndroidX=true -ffmpegKit.android.main.version=4.5.1-1 -ffmpegKit.android.lts.version=4.5.1-1 +ffmpegKit.android.main.version=5.1 +ffmpegKit.android.lts.version=5.1 diff --git a/react-native/android/gradle/wrapper/gradle-wrapper.properties b/react-native/android/gradle/wrapper/gradle-wrapper.properties index 28ff446..ae04661 100644 --- a/react-native/android/gradle/wrapper/gradle-wrapper.properties +++ b/react-native/android/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/react-native/ffmpeg-kit-react-native.podspec b/react-native/ffmpeg-kit-react-native.podspec index 7d19f88..653bcf0 100644 --- a/react-native/ffmpeg-kit-react-native.podspec +++ b/react-native/ffmpeg-kit-react-native.podspec @@ -23,112 +23,112 @@ Pod::Spec.new do |s| s.subspec 'min' do |ss| ss.source_files = '**/FFmpegKitReactNativeModule.m', '**/FFmpegKitReactNativeModule.h' - ss.dependency 'ffmpeg-kit-ios-min', "4.5.1" + ss.dependency 'ffmpeg-kit-ios-min', "5.1" ss.ios.deployment_target = '12.1' end s.subspec 'min-lts' do |ss| ss.source_files = '**/FFmpegKitReactNativeModule.m', '**/FFmpegKitReactNativeModule.h' - ss.dependency 'ffmpeg-kit-ios-min', "4.5.1.LTS" + ss.dependency 'ffmpeg-kit-ios-min', "5.1.LTS" ss.ios.deployment_target = '10' end s.subspec 'min-gpl' do |ss| ss.source_files = '**/FFmpegKitReactNativeModule.m', '**/FFmpegKitReactNativeModule.h' - ss.dependency 'ffmpeg-kit-ios-min-gpl', "4.5.1" + ss.dependency 'ffmpeg-kit-ios-min-gpl', "5.1" ss.ios.deployment_target = '12.1' end s.subspec 'min-gpl-lts' do |ss| ss.source_files = '**/FFmpegKitReactNativeModule.m', '**/FFmpegKitReactNativeModule.h' - ss.dependency 'ffmpeg-kit-ios-min-gpl', "4.5.1.LTS" + ss.dependency 'ffmpeg-kit-ios-min-gpl', "5.1.LTS" ss.ios.deployment_target = '10' end s.subspec 'https' do |ss| ss.source_files = '**/FFmpegKitReactNativeModule.m', '**/FFmpegKitReactNativeModule.h' - ss.dependency 'ffmpeg-kit-ios-https', "4.5.1" + ss.dependency 'ffmpeg-kit-ios-https', "5.1" ss.ios.deployment_target = '12.1' end s.subspec 'https-lts' do |ss| ss.source_files = '**/FFmpegKitReactNativeModule.m', '**/FFmpegKitReactNativeModule.h' - ss.dependency 'ffmpeg-kit-ios-https', "4.5.1.LTS" + ss.dependency 'ffmpeg-kit-ios-https', "5.1.LTS" ss.ios.deployment_target = '10' end s.subspec 'https-gpl' do |ss| ss.source_files = '**/FFmpegKitReactNativeModule.m', '**/FFmpegKitReactNativeModule.h' - ss.dependency 'ffmpeg-kit-ios-https-gpl', "4.5.1" + ss.dependency 'ffmpeg-kit-ios-https-gpl', "5.1" ss.ios.deployment_target = '12.1' end s.subspec 'https-gpl-lts' do |ss| ss.source_files = '**/FFmpegKitReactNativeModule.m', '**/FFmpegKitReactNativeModule.h' - ss.dependency 'ffmpeg-kit-ios-https-gpl', "4.5.1.LTS" + ss.dependency 'ffmpeg-kit-ios-https-gpl', "5.1.LTS" ss.ios.deployment_target = '10' end s.subspec 'audio' do |ss| ss.source_files = '**/FFmpegKitReactNativeModule.m', '**/FFmpegKitReactNativeModule.h' - ss.dependency 'ffmpeg-kit-ios-audio', "4.5.1" + ss.dependency 'ffmpeg-kit-ios-audio', "5.1" ss.ios.deployment_target = '12.1' end s.subspec 'audio-lts' do |ss| ss.source_files = '**/FFmpegKitReactNativeModule.m', '**/FFmpegKitReactNativeModule.h' - ss.dependency 'ffmpeg-kit-ios-audio', "4.5.1.LTS" + ss.dependency 'ffmpeg-kit-ios-audio', "5.1.LTS" ss.ios.deployment_target = '10' end s.subspec 'video' do |ss| ss.source_files = '**/FFmpegKitReactNativeModule.m', '**/FFmpegKitReactNativeModule.h' - ss.dependency 'ffmpeg-kit-ios-video', "4.5.1" + ss.dependency 'ffmpeg-kit-ios-video', "5.1" ss.ios.deployment_target = '12.1' end s.subspec 'video-lts' do |ss| ss.source_files = '**/FFmpegKitReactNativeModule.m', '**/FFmpegKitReactNativeModule.h' - ss.dependency 'ffmpeg-kit-ios-video', "4.5.1.LTS" + ss.dependency 'ffmpeg-kit-ios-video', "5.1.LTS" ss.ios.deployment_target = '10' end s.subspec 'full' do |ss| ss.source_files = '**/FFmpegKitReactNativeModule.m', '**/FFmpegKitReactNativeModule.h' - ss.dependency 'ffmpeg-kit-ios-full', "4.5.1" + ss.dependency 'ffmpeg-kit-ios-full', "5.1" ss.ios.deployment_target = '12.1' end s.subspec 'full-lts' do |ss| ss.source_files = '**/FFmpegKitReactNativeModule.m', '**/FFmpegKitReactNativeModule.h' - ss.dependency 'ffmpeg-kit-ios-full', "4.5.1.LTS" + ss.dependency 'ffmpeg-kit-ios-full', "5.1.LTS" ss.ios.deployment_target = '10' end s.subspec 'full-gpl' do |ss| ss.source_files = '**/FFmpegKitReactNativeModule.m', '**/FFmpegKitReactNativeModule.h' - ss.dependency 'ffmpeg-kit-ios-full-gpl', "4.5.1" + ss.dependency 'ffmpeg-kit-ios-full-gpl', "5.1" ss.ios.deployment_target = '12.1' end s.subspec 'full-gpl-lts' do |ss| ss.source_files = '**/FFmpegKitReactNativeModule.m', '**/FFmpegKitReactNativeModule.h' - ss.dependency 'ffmpeg-kit-ios-full-gpl', "4.5.1.LTS" + ss.dependency 'ffmpeg-kit-ios-full-gpl', "5.1.LTS" ss.ios.deployment_target = '10' end diff --git a/react-native/ios/FFmpegKitReactNativeModule.m b/react-native/ios/FFmpegKitReactNativeModule.m index 6cca720..04a03b6 100644 --- a/react-native/ios/FFmpegKitReactNativeModule.m +++ b/react-native/ios/FFmpegKitReactNativeModule.m @@ -299,23 +299,21 @@ RCT_EXPORT_METHOD(mediaInformationSession:(NSArray*)arguments resolver:(RCTPromi // MediaInformationJsonParser RCT_EXPORT_METHOD(mediaInformationJsonParserFrom:(NSString*)ffprobeJsonOutput resolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject) { - NSError *error; - MediaInformation* mediaInformation = [MediaInformationJsonParser from:ffprobeJsonOutput with:error]; - if (error == nil) { + @try { + MediaInformation* mediaInformation = [MediaInformationJsonParser fromWithError:ffprobeJsonOutput]; resolve([FFmpegKitReactNativeModule toMediaInformationDictionary:mediaInformation]); - } else { - NSLog(@"MediaInformation parsing failed: %@.\n", error); + } @catch (NSException *exception) { + NSLog(@"Parsing MediaInformation failed: %@.\n", [NSString stringWithFormat:@"%@\n%@", [exception userInfo], [exception callStackSymbols]]); resolve(nil); } } RCT_EXPORT_METHOD(mediaInformationJsonParserFromWithError:(NSString*)ffprobeJsonOutput resolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject) { - NSError *error; - MediaInformation* mediaInformation = [MediaInformationJsonParser from:ffprobeJsonOutput with:error]; - if (error == nil) { + @try { + MediaInformation* mediaInformation = [MediaInformationJsonParser fromWithError:ffprobeJsonOutput]; resolve([FFmpegKitReactNativeModule toMediaInformationDictionary:mediaInformation]); - } else { - NSLog(@"MediaInformation parsing failed: %@.\n", error); + } @catch (NSException *exception) { + NSLog(@"Parsing MediaInformation failed: %@.\n", [NSString stringWithFormat:@"%@\n%@", [exception userInfo], [exception callStackSymbols]]); reject(@"PARSE_FAILED", @"Parsing MediaInformation failed with JSON error.", nil); } } diff --git a/react-native/package.json b/react-native/package.json index 858566b..42194bd 100644 --- a/react-native/package.json +++ b/react-native/package.json @@ -1,6 +1,6 @@ { "name": "ffmpeg-kit-react-native", - "version": "4.5.2", + "version": "5.1.0", "description": "FFmpeg Kit for React Native", "main": "src/index", "types": "src/index.d.ts", @@ -19,7 +19,7 @@ "ios" ], "repository": "https://github.com/arthenica/ffmpeg-kit", - "author": "ARTHENICA (https://github.com/arthenica)", + "author": "ARTHENICA (https://www.arthenica.com)", "license": "LGPL-3.0", "bugs": { "url": "https://github.com/arthenica/ffmpeg-kit/issues" diff --git a/react-native/src/index.js b/react-native/src/index.js index 346fbc5..8e167d1 100644 --- a/react-native/src/index.js +++ b/react-native/src/index.js @@ -1611,7 +1611,7 @@ class FFmpegKitFactory { } static getVersion() { - return "4.5.2"; + return "5.1.0"; } static getLogRedirectionStrategy(sessionId) { @@ -3091,7 +3091,7 @@ export class StreamInformation { * @return tags object */ getTags() { - return this.getProperties(StreamInformation.KEY_TAGS); + return this.getProperty(StreamInformation.KEY_TAGS); } /** @@ -3123,12 +3123,12 @@ export class StreamInformation { } /** - * Returns the stream properties associated with the key. + * Returns the stream property associated with the key. * - * @param key properties key - * @return stream properties as an object or undefined if the key is not found + * @param key property key + * @return stream property as an object or undefined if the key is not found */ - getProperties(key) { + getProperty(key) { if (this.#allProperties !== undefined) { return this.#allProperties[key]; } else { @@ -3225,7 +3225,7 @@ export class Chapter { * @return tags object */ getTags() { - return this.getProperties(StreamInformation.KEY_TAGS); + return this.getProperty(StreamInformation.KEY_TAGS); } /** @@ -3257,12 +3257,12 @@ export class Chapter { } /** - * Returns the chapter properties associated with the key. + * Returns the chapter property associated with the key. * - * @param key properties key - * @return chapter properties as an object or undefined if the key is not found + * @param key property key + * @return chapter property as an object or undefined if the key is not found */ - getProperties(key) { + getProperty(key) { if (this.#allProperties !== undefined) { return this.#allProperties[key]; } else { From c93e29edffee5bfe2a4e8a45b62b127621fffaa5 Mon Sep 17 00:00:00 2001 From: Taner Sener Date: Fri, 21 Oct 2022 21:04:58 +0100 Subject: [PATCH 11/15] make build scripts more tolerant against the space character in path --- apple.sh | 8 ++++---- scripts/function.sh | 26 +++++++++++++------------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/apple.sh b/apple.sh index fe3b21f..38c21c8 100755 --- a/apple.sh +++ b/apple.sh @@ -56,14 +56,14 @@ create_umbrella_xcframework() { local BUILD_COMMAND="xcodebuild -create-xcframework " for ARCHITECTURE_VARIANT_INDEX in "${TARGET_ARCHITECTURE_VARIANT_INDEX_ARRAY[@]}"; do - local FRAMEWORK_PATH=${BASEDIR}/prebuilt/$(get_framework_directory "${ARCHITECTURE_VARIANT_INDEX}")/${FRAMEWORK_NAME}.framework - BUILD_COMMAND+=" -framework ${FRAMEWORK_PATH}" + local FRAMEWORK_PATH="${BASEDIR}"/prebuilt/$(get_framework_directory "${ARCHITECTURE_VARIANT_INDEX}")/${FRAMEWORK_NAME}.framework + BUILD_COMMAND+=" -framework \"${FRAMEWORK_PATH}\"" done - BUILD_COMMAND+=" -output ${XCFRAMEWORK_PATH}" + BUILD_COMMAND+=" -output \"${XCFRAMEWORK_PATH}\"" # EXECUTE CREATE FRAMEWORK COMMAND - COMMAND_OUTPUT=$(${BUILD_COMMAND} 2>&1) + COMMAND_OUTPUT=$(eval ${BUILD_COMMAND} 2>&1) RC=$? echo -e "DEBUG: ${COMMAND_OUTPUT}\n" 1>>"${BASEDIR}"/build.log 2>&1 diff --git a/scripts/function.sh b/scripts/function.sh index a3dedf6..6595a7e 100755 --- a/scripts/function.sh +++ b/scripts/function.sh @@ -1921,53 +1921,53 @@ autoreconf_library() { clone_git_repository_with_commit_id() { local RC - (mkdir -p $2 1>>"${BASEDIR}"/build.log 2>&1) + (mkdir -p "$2" 1>>"${BASEDIR}"/build.log 2>&1) RC=$? if [ ${RC} -ne 0 ]; then echo -e "\nINFO: Failed to create local directory $2\n" 1>>"${BASEDIR}"/build.log 2>&1 - rm -rf $2 1>>"${BASEDIR}"/build.log 2>&1 + rm -rf "$2" 1>>"${BASEDIR}"/build.log 2>&1 echo ${RC} return fi echo -e "INFO: Cloning commit id $3 from repository $1 into local directory $2\n" 1>>"${BASEDIR}"/build.log 2>&1 - (git clone $1 $2 --depth 1 1>>"${BASEDIR}"/build.log 2>&1) + (git clone "$1" "$2" --depth 1 1>>"${BASEDIR}"/build.log 2>&1) RC=$? if [ ${RC} -ne 0 ]; then echo -e "\nINFO: Failed to clone $1\n" 1>>"${BASEDIR}"/build.log 2>&1 - rm -rf $2 1>>"${BASEDIR}"/build.log 2>&1 + rm -rf "$2" 1>>"${BASEDIR}"/build.log 2>&1 echo ${RC} return fi - cd $2 1>>"${BASEDIR}"/build.log 2>&1 + cd "$2" 1>>"${BASEDIR}"/build.log 2>&1 RC=$? if [ ${RC} -ne 0 ]; then echo -e "\nINFO: Failed to cd into $2\n" 1>>"${BASEDIR}"/build.log 2>&1 - rm -rf $2 1>>"${BASEDIR}"/build.log 2>&1 + rm -rf "$2" 1>>"${BASEDIR}"/build.log 2>&1 echo ${RC} return fi - (git fetch --depth 1 origin $3 1>>"${BASEDIR}"/build.log 2>&1) + (git fetch --depth 1 origin "$3" 1>>"${BASEDIR}"/build.log 2>&1) RC=$? if [ ${RC} -ne 0 ]; then echo -e "\nINFO: Failed to fetch commit id $3 from $1\n" 1>>"${BASEDIR}"/build.log 2>&1 - rm -rf $2 1>>"${BASEDIR}"/build.log 2>&1 + rm -rf "$2" 1>>"${BASEDIR}"/build.log 2>&1 echo ${RC} return fi - (git checkout $3 1>>"${BASEDIR}"/build.log 2>&1) + (git checkout "$3" 1>>"${BASEDIR}"/build.log 2>&1) RC=$? @@ -1988,26 +1988,26 @@ clone_git_repository_with_commit_id() { clone_git_repository_with_tag() { local RC - (mkdir -p $3 1>>"${BASEDIR}"/build.log 2>&1) + (mkdir -p "$3" 1>>"${BASEDIR}"/build.log 2>&1) RC=$? if [ ${RC} -ne 0 ]; then echo -e "\nINFO: Failed to create local directory $3\n" 1>>"${BASEDIR}"/build.log 2>&1 - rm -rf $3 1>>"${BASEDIR}"/build.log 2>&1 + rm -rf "$3" 1>>"${BASEDIR}"/build.log 2>&1 echo ${RC} return fi echo -e "INFO: Cloning tag $2 from repository $1 into local directory $3\n" 1>>"${BASEDIR}"/build.log 2>&1 - (git clone --depth 1 --branch $2 $1 $3 1>>"${BASEDIR}"/build.log 2>&1) + (git clone --depth 1 --branch "$2" "$1" "$3" 1>>"${BASEDIR}"/build.log 2>&1) RC=$? if [ ${RC} -ne 0 ]; then echo -e "\nINFO: Failed to clone $1 -> $2\n" 1>>"${BASEDIR}"/build.log 2>&1 - rm -rf $3 1>>"${BASEDIR}"/build.log 2>&1 + rm -rf "$3" 1>>"${BASEDIR}"/build.log 2>&1 echo ${RC} return fi From a69ea8c844bc23c9c902490739bee93cb96828de Mon Sep 17 00:00:00 2001 From: Taner Sener Date: Fri, 21 Oct 2022 22:40:54 +0100 Subject: [PATCH 12/15] decommission macos 10-15 in github workflows --- .github/workflows/android-build-scripts.yml | 4 +-- .github/workflows/ios-build-scripts.yml | 29 +++------------------ .github/workflows/macos-build-scripts.yml | 29 +++------------------ .github/workflows/periodic-builds-apple.yml | 18 ++++++------- .github/workflows/tvos-build-scripts.yml | 29 +++------------------ 5 files changed, 20 insertions(+), 89 deletions(-) diff --git a/.github/workflows/android-build-scripts.yml b/.github/workflows/android-build-scripts.yml index e91cd46..b60e25a 100644 --- a/.github/workflows/android-build-scripts.yml +++ b/.github/workflows/android-build-scripts.yml @@ -85,7 +85,7 @@ jobs: run: '[[ -f ./src/ffmpeg/ffbuild/config.log ]] && tail -50 ./src/ffmpeg/ffbuild/config.log' build-main-on-macos: name: android main on macos - runs-on: macos-10.15 + runs-on: macos-12 strategy: matrix: ndk-version: [ 'r22b-darwin-x86_64', 'r23b-darwin', 'r24-darwin', 'r25b-darwin' ] @@ -114,7 +114,7 @@ jobs: run: '[[ -f ./src/ffmpeg/ffbuild/config.log ]] && tail -50 ./src/ffmpeg/ffbuild/config.log' build-lts-on-macos: name: android lts on macos - runs-on: macos-10.15 + runs-on: macos-11 strategy: matrix: ndk-version: [ 'r22b-darwin-x86_64', 'r23b-darwin' ] diff --git a/.github/workflows/ios-build-scripts.yml b/.github/workflows/ios-build-scripts.yml index 729f983..29d8978 100644 --- a/.github/workflows/ios-build-scripts.yml +++ b/.github/workflows/ios-build-scripts.yml @@ -73,38 +73,15 @@ jobs: - name: print ffbuild logs if: ${{ failure() }} run: '[[ -f ./src/ffmpeg/ffbuild/config.log ]] && tail -50 ./src/ffmpeg/ffbuild/config.log' - build-main-on-macos-catalina: - name: ios main on catalina - runs-on: macos-10.15 + build-lts-on-macos-bigsur: + name: ios lts on big sur + runs-on: macos-11 strategy: matrix: xcode: [ '11.7', '12.4' ] defaults: run: shell: bash - steps: - - uses: actions/checkout@v2 - - name: prerequisites - run: brew install autoconf automake libtool pkg-config curl git cmake nasm - - name: set up xcode - run: echo "export DEVELOPER_DIR=/Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer" > ~/.xcode.for.ffmpeg.kit.sh - - name: run the build script - run: ./ios.sh --xcframework --enable-ios-audiotoolbox --enable-ios-avfoundation --enable-ios-bzip2 --enable-ios-libiconv --enable-ios-videotoolbox --enable-ios-zlib - - name: print build logs - if: ${{ always() }} - run: cat build.log - - name: print ffbuild logs - if: ${{ failure() }} - run: '[[ -f ./src/ffmpeg/ffbuild/config.log ]] && tail -50 ./src/ffmpeg/ffbuild/config.log' - build-lts-on-macos: - name: ios lts - runs-on: macos-10.15 - strategy: - matrix: - xcode: [ '10.3', '11.7' ] - defaults: - run: - shell: bash steps: - uses: actions/checkout@v2 - name: prerequisites diff --git a/.github/workflows/macos-build-scripts.yml b/.github/workflows/macos-build-scripts.yml index cfca086..fb2d35b 100644 --- a/.github/workflows/macos-build-scripts.yml +++ b/.github/workflows/macos-build-scripts.yml @@ -73,38 +73,15 @@ jobs: - name: print ffbuild logs if: ${{ failure() }} run: '[[ -f ./src/ffmpeg/ffbuild/config.log ]] && tail -50 ./src/ffmpeg/ffbuild/config.log' - build-main-on-macos-catalina: - name: macos main on catalina - runs-on: macos-10.15 + build-lts-on-macos-bigsur: + name: macos lts on big sur + runs-on: macos-11 strategy: matrix: xcode: [ '11.7', '12.4' ] defaults: run: shell: bash - steps: - - uses: actions/checkout@v2 - - name: prerequisites - run: brew install autoconf automake libtool pkg-config curl git cmake nasm - - name: set up xcode - run: echo "export DEVELOPER_DIR=/Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer" > ~/.xcode.for.ffmpeg.kit.sh - - name: run the build script - run: ./macos.sh --xcframework --enable-macos-audiotoolbox --enable-macos-avfoundation --enable-macos-bzip2 --enable-macos-coreimage --enable-macos-libiconv --enable-macos-opencl --enable-macos-opengl --enable-macos-videotoolbox --enable-macos-zlib - - name: print build logs - if: ${{ always() }} - run: cat build.log - - name: print ffbuild logs - if: ${{ failure() }} - run: '[[ -f ./src/ffmpeg/ffbuild/config.log ]] && tail -50 ./src/ffmpeg/ffbuild/config.log' - build-lts-on-macos: - name: macos lts - runs-on: macos-10.15 - strategy: - matrix: - xcode: [ '10.3', '11.7' ] - defaults: - run: - shell: bash steps: - uses: actions/checkout@v2 - name: prerequisites diff --git a/.github/workflows/periodic-builds-apple.yml b/.github/workflows/periodic-builds-apple.yml index 6099d07..d9d480b 100644 --- a/.github/workflows/periodic-builds-apple.yml +++ b/.github/workflows/periodic-builds-apple.yml @@ -31,9 +31,9 @@ jobs: - name: print ffbuild logs if: ${{ failure() }} run: '[[ -f ./src/ffmpeg/ffbuild/config.log ]] && tail -50 ./src/ffmpeg/ffbuild/config.log' - build-ios-lts-on-macos-catalina: - name: ios lts on catalina - runs-on: macos-10.15 + build-ios-lts-on-macos-bigsur: + name: ios lts on big sur + runs-on: macos-11 strategy: matrix: xcode: [ '12.4' ] @@ -83,9 +83,9 @@ jobs: - name: print ffbuild logs if: ${{ failure() }} run: '[[ -f ./src/ffmpeg/ffbuild/config.log ]] && tail -50 ./src/ffmpeg/ffbuild/config.log' - build-macos-lts-on-macos-catalina: - name: macos lts on catalina - runs-on: macos-10.15 + build-macos-lts-on-macos-bigsur: + name: macos lts on big sur + runs-on: macos-11 strategy: matrix: xcode: [ '12.4' ] @@ -135,9 +135,9 @@ jobs: - name: print ffbuild logs if: ${{ failure() }} run: '[[ -f ./src/ffmpeg/ffbuild/config.log ]] && tail -50 ./src/ffmpeg/ffbuild/config.log' - build-tvos-lts-on-macos-catalina: - name: tvos lts on catalina - runs-on: macos-10.15 + build-tvos-lts-on-macos-bigsur: + name: tvos lts on big sur + runs-on: macos-11 strategy: matrix: xcode: [ '12.4' ] diff --git a/.github/workflows/tvos-build-scripts.yml b/.github/workflows/tvos-build-scripts.yml index c5e3c0a..1169942 100644 --- a/.github/workflows/tvos-build-scripts.yml +++ b/.github/workflows/tvos-build-scripts.yml @@ -73,38 +73,15 @@ jobs: - name: print ffbuild logs if: ${{ failure() }} run: '[[ -f ./src/ffmpeg/ffbuild/config.log ]] && tail -50 ./src/ffmpeg/ffbuild/config.log' - build-main-on-macos-catalina: - name: tvos main on catalina - runs-on: macos-10.15 + build-lts-on-macos-bigsur: + name: tvos lts on big sur + runs-on: macos-11 strategy: matrix: xcode: [ '11.7', '12.4' ] defaults: run: shell: bash - steps: - - uses: actions/checkout@v2 - - name: prerequisites - run: brew install autoconf automake libtool pkg-config curl git cmake nasm - - name: set up xcode - run: echo "export DEVELOPER_DIR=/Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer" > ~/.xcode.for.ffmpeg.kit.sh - - name: run the build script - run: ./tvos.sh --xcframework --enable-tvos-bzip2 --enable-tvos-audiotoolbox --enable-tvos-libiconv --enable-tvos-videotoolbox --enable-tvos-zlib - - name: print build logs - if: ${{ always() }} - run: cat build.log - - name: print ffbuild logs - if: ${{ failure() }} - run: '[[ -f ./src/ffmpeg/ffbuild/config.log ]] && tail -50 ./src/ffmpeg/ffbuild/config.log' - build-lts-on-macos: - name: tvos lts - runs-on: macos-10.15 - strategy: - matrix: - xcode: [ '10.3', '11.7' ] - defaults: - run: - shell: bash steps: - uses: actions/checkout@v2 - name: prerequisites From a48591b802c8f9b0069d9e489adfc976be681890 Mon Sep 17 00:00:00 2001 From: Taner Sener Date: Sun, 6 Nov 2022 20:33:01 +0000 Subject: [PATCH 13/15] allow disabling bitcode in ios and tvos, fixes #614 --- ios.sh | 3 +++ scripts/apple/ffmpeg.sh | 4 ++++ scripts/function-ios.sh | 20 ++++++++++++++------ scripts/function-tvos.sh | 24 ++++++++++++++++++------ scripts/function.sh | 3 +++ tvos.sh | 3 +++ 6 files changed, 45 insertions(+), 12 deletions(-) diff --git a/ios.sh b/ios.sh index 0f28538..17ed291 100755 --- a/ios.sh +++ b/ios.sh @@ -71,6 +71,9 @@ while [ ! $# -eq 0 ]; do skip_library "${SKIP_LIBRARY}" ;; + --no-bitcode) + export NO_BITCODE="1" + ;; --no-framework) NO_FRAMEWORK="1" ;; diff --git a/scripts/apple/ffmpeg.sh b/scripts/apple/ffmpeg.sh index 8d3c052..45feb2c 100755 --- a/scripts/apple/ffmpeg.sh +++ b/scripts/apple/ffmpeg.sh @@ -98,6 +98,10 @@ x86-64-mac-catalyst) ;; esac +if [ ! -z $NO_BITCODE ]; then + BITCODE_FLAGS="" +fi + CONFIGURE_POSTFIX="" HIGH_PRIORITY_LDFLAGS="" diff --git a/scripts/function-ios.sh b/scripts/function-ios.sh index 2853c96..02ae7c3 100755 --- a/scripts/function-ios.sh +++ b/scripts/function-ios.sh @@ -55,9 +55,9 @@ libraries are created under the prebuilt folder.\n" display_help_gpl_libraries display_help_custom_libraries if [[ -n ${FFMPEG_KIT_XCF_BUILD} ]]; then - display_help_advanced_options " --no-framework\t\tdo not build xcframework bundles [no]" + display_help_advanced_options " --no-framework\t\tdo not build xcframework bundles [no]" " --no-bitcode\t\t\tdo not enable bitcode in bundles [no]" else - display_help_advanced_options " --no-framework\t\tdo not build framework bundles [no]" + display_help_advanced_options " --no-framework\t\tdo not build framework bundles [no]" " --no-bitcode\t\t\tdo not enable bitcode in bundles [no]" fi } @@ -105,16 +105,19 @@ get_common_cflags() { fi local BUILD_DATE="-DFFMPEG_KIT_BUILD_DATE=$(date +%Y%m%d 2>>"${BASEDIR}"/build.log)" + if [ -z $NO_BITCODE ]; then + local BITCODE_FLAGS="-fembed-bitcode" + fi case ${ARCH} in i386 | x86-64 | arm64-simulator) echo "-fstrict-aliasing -DIOS ${LTS_BUILD_FLAG}${BUILD_DATE} -isysroot ${SDK_PATH}" ;; *-mac-catalyst) - echo "-fstrict-aliasing -fembed-bitcode -DMACOSX ${LTS_BUILD_FLAG}${BUILD_DATE} -isysroot ${SDK_PATH}" + echo "-fstrict-aliasing ${BITCODE_FLAGS} -DMACOSX ${LTS_BUILD_FLAG}${BUILD_DATE} -isysroot ${SDK_PATH}" ;; *) - echo "-fstrict-aliasing -fembed-bitcode -DIOS ${LTS_BUILD_FLAG}${BUILD_DATE} -isysroot ${SDK_PATH}" + echo "-fstrict-aliasing ${BITCODE_FLAGS} -DIOS ${LTS_BUILD_FLAG}${BUILD_DATE} -isysroot ${SDK_PATH}" ;; esac } @@ -278,7 +281,9 @@ get_cxxflags() { local BITCODE_FLAGS="" case ${ARCH} in armv7 | armv7s | arm64 | arm64e | *-mac-catalyst) - local BITCODE_FLAGS="-fembed-bitcode" + if [ -z $NO_BITCODE ]; then + local BITCODE_FLAGS="-fembed-bitcode" + fi ;; esac @@ -384,12 +389,15 @@ get_ldflags() { local OPTIMIZATION_FLAGS="${FFMPEG_KIT_DEBUG}" fi local COMMON_FLAGS=$(get_common_ldflags) + if [ -z $NO_BITCODE ]; then + local BITCODE_FLAGS="-fembed-bitcode -Wc,-fembed-bitcode" + fi case $1 in ffmpeg-kit) case ${ARCH} in armv7 | armv7s | arm64 | arm64e | *-mac-catalyst) - echo "${ARCH_FLAGS} ${LINKED_LIBRARIES} ${COMMON_FLAGS} -fembed-bitcode -Wc,-fembed-bitcode ${OPTIMIZATION_FLAGS}" + echo "${ARCH_FLAGS} ${LINKED_LIBRARIES} ${COMMON_FLAGS} ${BITCODE_FLAGS} ${OPTIMIZATION_FLAGS}" ;; *) echo "${ARCH_FLAGS} ${LINKED_LIBRARIES} ${COMMON_FLAGS} ${OPTIMIZATION_FLAGS}" diff --git a/scripts/function-tvos.sh b/scripts/function-tvos.sh index 98dc5b6..f36f0f6 100755 --- a/scripts/function-tvos.sh +++ b/scripts/function-tvos.sh @@ -43,9 +43,9 @@ set explicitly. When compilation ends, libraries are created under the prebuilt display_help_gpl_libraries display_help_custom_libraries if [[ -n ${FFMPEG_KIT_XCF_BUILD} ]]; then - display_help_advanced_options " --no-framework\t\tdo not build xcframework bundles [no]" + display_help_advanced_options " --no-framework\t\tdo not build xcframework bundles [no]" " --no-bitcode\t\t\tdo not enable bitcode in bundles [no]" else - display_help_advanced_options " --no-framework\t\tdo not build framework bundles [no]" + display_help_advanced_options " --no-framework\t\tdo not build framework bundles [no]" " --no-bitcode\t\t\tdo not enable bitcode in bundles [no]" fi } @@ -79,10 +79,13 @@ get_common_cflags() { fi local BUILD_DATE="-DFFMPEG_KIT_BUILD_DATE=$(date +%Y%m%d 2>>"${BASEDIR}"/build.log)" + if [ -z $NO_BITCODE ]; then + local BITCODE_FLAGS="-fembed-bitcode" + fi case ${ARCH} in arm64) - echo "-fstrict-aliasing -fembed-bitcode -DTVOS ${LTS_BUILD_FLAG}${BUILD_DATE} -isysroot ${SDK_PATH}" + echo "-fstrict-aliasing ${BITCODE_FLAGS} -DTVOS ${LTS_BUILD_FLAG}${BUILD_DATE} -isysroot ${SDK_PATH}" ;; x86-64 | arm64-simulator) echo "-fstrict-aliasing -DTVOS ${LTS_BUILD_FLAG}${BUILD_DATE} -isysroot ${SDK_PATH}" @@ -254,7 +257,9 @@ get_cxxflags() { local BITCODE_FLAGS="" case ${ARCH} in arm64) - local BITCODE_FLAGS="-fembed-bitcode" + if [ -z $NO_BITCODE ]; then + local BITCODE_FLAGS="-fembed-bitcode" + fi ;; esac @@ -320,9 +325,13 @@ get_size_optimization_ldflags() { } get_arch_specific_ldflags() { + if [ -z $NO_BITCODE ]; then + local BITCODE_FLAGS="-fembed-bitcode" + fi + case ${ARCH} in arm64) - echo "-arch arm64 -march=armv8-a+crc+crypto -fembed-bitcode" + echo "-arch arm64 -march=armv8-a+crc+crypto ${BITCODE_FLAGS}" ;; arm64-simulator) echo "-arch arm64 -march=armv8-a+crc+crypto" @@ -342,12 +351,15 @@ get_ldflags() { local OPTIMIZATION_FLAGS="${FFMPEG_KIT_DEBUG}" fi local COMMON_FLAGS=$(get_common_ldflags) + if [ -z $NO_BITCODE ]; then + local BITCODE_FLAGS="-fembed-bitcode -Wc,-fembed-bitcode" + fi case $1 in ffmpeg-kit) case ${ARCH} in arm64) - echo "${ARCH_FLAGS} ${LINKED_LIBRARIES} ${COMMON_FLAGS} -fembed-bitcode -Wc,-fembed-bitcode ${OPTIMIZATION_FLAGS}" + echo "${ARCH_FLAGS} ${LINKED_LIBRARIES} ${COMMON_FLAGS} ${BITCODE_FLAGS} ${OPTIMIZATION_FLAGS}" ;; *) echo "${ARCH_FLAGS} ${LINKED_LIBRARIES} ${COMMON_FLAGS} ${OPTIMIZATION_FLAGS}" diff --git a/scripts/function.sh b/scripts/function.sh index 6595a7e..421cb80 100755 --- a/scripts/function.sh +++ b/scripts/function.sh @@ -927,6 +927,9 @@ display_help_advanced_options() { if [ -n "$1" ]; then echo -e "$1" fi + if [ -n "$2" ]; then + echo -e "$2" + fi echo -e "" } diff --git a/tvos.sh b/tvos.sh index ac097a8..1165963 100755 --- a/tvos.sh +++ b/tvos.sh @@ -71,6 +71,9 @@ while [ ! $# -eq 0 ]; do skip_library "${SKIP_LIBRARY}" ;; + --no-bitcode) + export NO_BITCODE="1" + ;; --no-framework) NO_FRAMEWORK="1" ;; From 47f85fa9ea3f8c34f3c817b87d8667b61b87d0bc Mon Sep 17 00:00:00 2001 From: Taner Sener Date: Sat, 19 Nov 2022 13:20:10 +0000 Subject: [PATCH 14/15] remove android release template --- android/ffmpeg-kit-android-lib/build.gradle | 4 - tools/android/build.gradle | 4 - tools/android/build.lts.gradle | 4 - tools/android/release.template.gradle | 114 -------------------- 4 files changed, 126 deletions(-) delete mode 100644 tools/android/release.template.gradle diff --git a/android/ffmpeg-kit-android-lib/build.gradle b/android/ffmpeg-kit-android-lib/build.gradle index 43c84dd..cf35c13 100644 --- a/android/ffmpeg-kit-android-lib/build.gradle +++ b/android/ffmpeg-kit-android-lib/build.gradle @@ -54,7 +54,3 @@ dependencies { testImplementation "androidx.test.ext:junit:1.1.3" testImplementation 'org.json:json:20220320' } - -if (System.properties.containsKey('releaseFFmpegKit')) { - apply from: "${rootProject.projectDir}/../tools/android/release.template.gradle" -} diff --git a/tools/android/build.gradle b/tools/android/build.gradle index 43c84dd..cf35c13 100644 --- a/tools/android/build.gradle +++ b/tools/android/build.gradle @@ -54,7 +54,3 @@ dependencies { testImplementation "androidx.test.ext:junit:1.1.3" testImplementation 'org.json:json:20220320' } - -if (System.properties.containsKey('releaseFFmpegKit')) { - apply from: "${rootProject.projectDir}/../tools/android/release.template.gradle" -} diff --git a/tools/android/build.lts.gradle b/tools/android/build.lts.gradle index 869072b..4bf3b86 100644 --- a/tools/android/build.lts.gradle +++ b/tools/android/build.lts.gradle @@ -54,7 +54,3 @@ dependencies { testImplementation "androidx.test.ext:junit:1.1.3" testImplementation 'org.json:json:20220320' } - -if (System.properties.containsKey('releaseFFmpegKit')) { - apply from: "${rootProject.projectDir}/../tools/android/release.template.gradle" -} diff --git a/tools/android/release.template.gradle b/tools/android/release.template.gradle deleted file mode 100644 index 61da992..0000000 --- a/tools/android/release.template.gradle +++ /dev/null @@ -1,114 +0,0 @@ -task sourcesJar(type: Jar) { - archiveClassifier.set('sources') - from android.sourceSets.main.java.srcDirs -} - -task javadocJar(type: Jar, dependsOn: javadoc) { - archiveClassifier.set('javadoc') - from javadoc.destinationDir -} - -artifacts { - archives javadocJar - archives sourcesJar -} - -apply plugin: 'maven-publish' -apply plugin: 'signing' - -group = 'com.arthenica' -archivesBaseName = releaseProject -version = releaseVersionName - -File propertiesFile = project.rootProject.file('local.properties') -if (propertiesFile.exists()) { - Properties properties = new Properties() - properties.load(new FileInputStream(propertiesFile)) - properties.each { name, value -> - ext[name] = value - } -} - -ext { - publishedGroupId = group - artifact = releaseProject - libraryName = releaseProject - libraryVersion = version - libraryDescription = releaseProjectDescription - - siteUrl = 'https://github.com/arthenica/ffmpeg-kit' - gitUrl = 'https://github.com/arthenica/ffmpeg-kit.git' - - developerId = 'arthenica' - developerName = 'ARTHENICA' - developerEmail = 'open-source@arthenica.com' - - if (Project.hasProperty('releaseGPL')) { - licenseName = 'GNU General Public License version 3' - licenseUrl = 'https://www.gnu.org/licenses/gpl-3.0.txt' - } else { - licenseName = 'GNU Lesser General Public License, Version 3' - licenseUrl = 'https://www.gnu.org/licenses/lgpl-3.0.txt' - } -} - -afterEvaluate { - publishing { - publications { - release(MavenPublication) { - - groupId group - artifactId = libraryName - version = version - - from components.release - - artifact sourcesJar - artifact javadocJar - - pom { - packaging 'aar' - name = libraryName - description = libraryDescription - url = siteUrl - - licenses { - license { - name = licenseName - url = licenseUrl - } - } - developers { - developer { - id = developerId - name = developerName - email = developerEmail - } - } - - scm { - connection = gitUrl - developerConnection = gitUrl - url = siteUrl - } - } - } - } - repositories { - maven { - var releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/" - var snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots/" - url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl - credentials { - username ossrhUsername - password ossrhPassword - } - } - } - } -} - - -signing { - sign publishing.publications -} From a2b81ffb3ba03940ff6d13050256f05a2781c5f9 Mon Sep 17 00:00:00 2001 From: Taner Sener Date: Sun, 16 Jul 2023 12:42:05 +0100 Subject: [PATCH 15/15] remove funding options --- .github/FUNDING.yml | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 .github/FUNDING.yml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml deleted file mode 100644 index 0c08990..0000000 --- a/.github/FUNDING.yml +++ /dev/null @@ -1,3 +0,0 @@ -patreon: tanersener -open_collective: ffmpeg-kit -custom: [ 'https://buymeacoff.ee/tanersener' ] \ No newline at end of file