react-native-audio-api 0.10.0-nightly-325e87a-20251023 → 0.10.0-nightly-353aaa2-20251023

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. package/RNAudioAPI.podspec +6 -5
  2. package/android/build.gradle +7 -1
  3. package/common/cpp/audioapi/libs/ffmpeg/relinking.md +24 -0
  4. package/ios/audioapi/ios/core/IOSAudioRecorder.h +2 -1
  5. package/package.json +2 -1
  6. package/scripts/download-prebuilt-binaries.sh +52 -0
  7. package/android/src/main/jniLibs/arm64-v8a/libavcodec.so +0 -0
  8. package/android/src/main/jniLibs/arm64-v8a/libavformat.so +0 -0
  9. package/android/src/main/jniLibs/arm64-v8a/libavutil.so +0 -0
  10. package/android/src/main/jniLibs/arm64-v8a/libswresample.so +0 -0
  11. package/android/src/main/jniLibs/armeabi-v7a/libavcodec.so +0 -0
  12. package/android/src/main/jniLibs/armeabi-v7a/libavformat.so +0 -0
  13. package/android/src/main/jniLibs/armeabi-v7a/libavutil.so +0 -0
  14. package/android/src/main/jniLibs/armeabi-v7a/libswresample.so +0 -0
  15. package/android/src/main/jniLibs/x86/libavcodec.so +0 -0
  16. package/android/src/main/jniLibs/x86/libavformat.so +0 -0
  17. package/android/src/main/jniLibs/x86/libavutil.so +0 -0
  18. package/android/src/main/jniLibs/x86/libswresample.so +0 -0
  19. package/android/src/main/jniLibs/x86_64/libavcodec.so +0 -0
  20. package/android/src/main/jniLibs/x86_64/libavformat.so +0 -0
  21. package/android/src/main/jniLibs/x86_64/libavutil.so +0 -0
  22. package/android/src/main/jniLibs/x86_64/libswresample.so +0 -0
  23. package/common/cpp/audioapi/external/arm64-v8a/libcrypto.a +0 -0
  24. package/common/cpp/audioapi/external/arm64-v8a/libogg.a +0 -0
  25. package/common/cpp/audioapi/external/arm64-v8a/libopus.a +0 -0
  26. package/common/cpp/audioapi/external/arm64-v8a/libopusfile.a +0 -0
  27. package/common/cpp/audioapi/external/arm64-v8a/libssl.a +0 -0
  28. package/common/cpp/audioapi/external/arm64-v8a/libvorbis.a +0 -0
  29. package/common/cpp/audioapi/external/arm64-v8a/libvorbisenc.a +0 -0
  30. package/common/cpp/audioapi/external/arm64-v8a/libvorbisfile.a +0 -0
  31. package/common/cpp/audioapi/external/armeabi-v7a/libcrypto.a +0 -0
  32. package/common/cpp/audioapi/external/armeabi-v7a/libogg.a +0 -0
  33. package/common/cpp/audioapi/external/armeabi-v7a/libopus.a +0 -0
  34. package/common/cpp/audioapi/external/armeabi-v7a/libopusfile.a +0 -0
  35. package/common/cpp/audioapi/external/armeabi-v7a/libssl.a +0 -0
  36. package/common/cpp/audioapi/external/armeabi-v7a/libvorbis.a +0 -0
  37. package/common/cpp/audioapi/external/armeabi-v7a/libvorbisenc.a +0 -0
  38. package/common/cpp/audioapi/external/armeabi-v7a/libvorbisfile.a +0 -0
  39. package/common/cpp/audioapi/external/iphoneos/libcrypto.a +0 -0
  40. package/common/cpp/audioapi/external/iphoneos/libogg.a +0 -0
  41. package/common/cpp/audioapi/external/iphoneos/libopus.a +0 -0
  42. package/common/cpp/audioapi/external/iphoneos/libopusfile.a +0 -0
  43. package/common/cpp/audioapi/external/iphoneos/libssl.a +0 -0
  44. package/common/cpp/audioapi/external/iphoneos/libvorbis.a +0 -0
  45. package/common/cpp/audioapi/external/iphoneos/libvorbisenc.a +0 -0
  46. package/common/cpp/audioapi/external/iphoneos/libvorbisfile.a +0 -0
  47. package/common/cpp/audioapi/external/iphonesimulator/libcrypto.a +0 -0
  48. package/common/cpp/audioapi/external/iphonesimulator/libogg.a +0 -0
  49. package/common/cpp/audioapi/external/iphonesimulator/libopus.a +0 -0
  50. package/common/cpp/audioapi/external/iphonesimulator/libopusfile.a +0 -0
  51. package/common/cpp/audioapi/external/iphonesimulator/libssl.a +0 -0
  52. package/common/cpp/audioapi/external/iphonesimulator/libvorbis.a +0 -0
  53. package/common/cpp/audioapi/external/iphonesimulator/libvorbisenc.a +0 -0
  54. package/common/cpp/audioapi/external/iphonesimulator/libvorbisfile.a +0 -0
  55. package/common/cpp/audioapi/external/libavcodec.xcframework/Info.plist +0 -44
  56. package/common/cpp/audioapi/external/libavcodec.xcframework/ios-arm64/libavcodec.framework/Info.plist +0 -1
  57. package/common/cpp/audioapi/external/libavcodec.xcframework/ios-arm64/libavcodec.framework/libavcodec +0 -0
  58. package/common/cpp/audioapi/external/libavcodec.xcframework/ios-arm64_x86_64-simulator/libavcodec.framework/Info.plist +0 -1
  59. package/common/cpp/audioapi/external/libavcodec.xcframework/ios-arm64_x86_64-simulator/libavcodec.framework/libavcodec +0 -0
  60. package/common/cpp/audioapi/external/libavformat.xcframework/Info.plist +0 -44
  61. package/common/cpp/audioapi/external/libavformat.xcframework/ios-arm64/libavformat.framework/Info.plist +0 -1
  62. package/common/cpp/audioapi/external/libavformat.xcframework/ios-arm64/libavformat.framework/libavformat +0 -0
  63. package/common/cpp/audioapi/external/libavformat.xcframework/ios-arm64_x86_64-simulator/libavformat.framework/Info.plist +0 -1
  64. package/common/cpp/audioapi/external/libavformat.xcframework/ios-arm64_x86_64-simulator/libavformat.framework/libavformat +0 -0
  65. package/common/cpp/audioapi/external/libavutil.xcframework/Info.plist +0 -44
  66. package/common/cpp/audioapi/external/libavutil.xcframework/ios-arm64/libavutil.framework/Info.plist +0 -1
  67. package/common/cpp/audioapi/external/libavutil.xcframework/ios-arm64/libavutil.framework/libavutil +0 -0
  68. package/common/cpp/audioapi/external/libavutil.xcframework/ios-arm64_x86_64-simulator/libavutil.framework/Info.plist +0 -1
  69. package/common/cpp/audioapi/external/libavutil.xcframework/ios-arm64_x86_64-simulator/libavutil.framework/libavutil +0 -0
  70. package/common/cpp/audioapi/external/libswresample.xcframework/Info.plist +0 -44
  71. package/common/cpp/audioapi/external/libswresample.xcframework/ios-arm64/libswresample.framework/Info.plist +0 -1
  72. package/common/cpp/audioapi/external/libswresample.xcframework/ios-arm64/libswresample.framework/libswresample +0 -0
  73. package/common/cpp/audioapi/external/libswresample.xcframework/ios-arm64_x86_64-simulator/libswresample.framework/Info.plist +0 -1
  74. package/common/cpp/audioapi/external/libswresample.xcframework/ios-arm64_x86_64-simulator/libswresample.framework/libswresample +0 -0
  75. package/common/cpp/audioapi/external/x86/libcrypto.a +0 -0
  76. package/common/cpp/audioapi/external/x86/libogg.a +0 -0
  77. package/common/cpp/audioapi/external/x86/libopus.a +0 -0
  78. package/common/cpp/audioapi/external/x86/libopusfile.a +0 -0
  79. package/common/cpp/audioapi/external/x86/libssl.a +0 -0
  80. package/common/cpp/audioapi/external/x86/libvorbis.a +0 -0
  81. package/common/cpp/audioapi/external/x86/libvorbisenc.a +0 -0
  82. package/common/cpp/audioapi/external/x86/libvorbisfile.a +0 -0
  83. package/common/cpp/audioapi/external/x86_64/libcrypto.a +0 -0
  84. package/common/cpp/audioapi/external/x86_64/libogg.a +0 -0
  85. package/common/cpp/audioapi/external/x86_64/libopus.a +0 -0
  86. package/common/cpp/audioapi/external/x86_64/libopusfile.a +0 -0
  87. package/common/cpp/audioapi/external/x86_64/libssl.a +0 -0
  88. package/common/cpp/audioapi/external/x86_64/libvorbis.a +0 -0
  89. package/common/cpp/audioapi/external/x86_64/libvorbisenc.a +0 -0
  90. package/common/cpp/audioapi/external/x86_64/libvorbisfile.a +0 -0
  91. package/common/cpp/audioapi/libs/ffmpeg/INSTRUCTIONS.md +0 -26
  92. package/common/cpp/audioapi/libs/ffmpeg/create_xcframework.sh +0 -111
  93. package/common/cpp/audioapi/libs/ffmpeg/ffmpeg_setup.sh +0 -381
@@ -38,9 +38,10 @@ Pod::Spec.new do |s|
38
38
 
39
39
  s.compiler_flags = "#{folly_flags}"
40
40
 
41
- # s.prepare_command = <<-CMD TODO: re-add when we have prebuilt libs put somewhere public
42
- # ruby -r './scripts/download-audioapi-libs.rb'
43
- # CMD
41
+ s.prepare_command = <<-CMD
42
+ chmod +x scripts/download-prebuilt-binaries.sh
43
+ scripts/download-prebuilt-binaries.sh ios
44
+ CMD
44
45
 
45
46
  # Assumes Pods dir is nested under ios project dir
46
47
  ios_dir = File.join(Pod::Config.instance.project_pods_root, '..')
@@ -71,8 +72,8 @@ s.pod_target_xcconfig = {
71
72
  $(PODS_TARGET_SRCROOT)/#{external_dir_relative}/include/vorbis
72
73
  $(PODS_TARGET_SRCROOT)/#{external_dir_relative}/ffmpeg_include
73
74
  ].join(" "),
74
- 'OTHER_CFLAGS' => "$(inherited) #{folly_flags} #{fabric_flags} #{version_flag}",
75
- 'OTHER_CPLUSPLUSFLAGS' => "$(inherited) #{folly_flags} #{fabric_flags} #{version_flag}"
75
+ 'OTHER_CFLAGS' => "$(inherited) #{folly_flags} #{fabric_flags} #{version_flag} #{worklets_preprocessor_flag}",
76
+ 'OTHER_CPLUSPLUSFLAGS' => "$(inherited) #{folly_flags} #{fabric_flags} #{version_flag} #{worklets_preprocessor_flag}",
76
77
  }
77
78
 
78
79
  s.user_target_xcconfig = {
@@ -301,10 +301,16 @@ def assertMinimalReactNativeVersion = task assertMinimalReactNativeVersionTask {
301
301
  }
302
302
  }
303
303
 
304
+ task downloadPrebuiltBinaries(type: Exec) {
305
+ commandLine 'chmod', '+x', '../scripts/download-prebuilt-binaries.sh'
306
+ commandLine 'bash', '../scripts/download-prebuilt-binaries.sh'
307
+ args 'android'
308
+ }
309
+
304
310
  // Make preBuild depend on the download task
305
311
  tasks.preBuild {
306
312
  dependsOn assertMinimalReactNativeVersion
307
- // dependsOn downloadStaticPrebuiltLibraries TODO: re-add when we have prebuilt libs put somewhere public
313
+ dependsOn downloadPrebuiltBinaries
308
314
  }
309
315
 
310
316
  task cleanCmakeCache() {
@@ -0,0 +1,24 @@
1
+ ## If you would like to relink ffmpeg to your implementation there are two options:
2
+
3
+ ### Option A)
4
+
5
+ you can modify script in scripts/download-prebuilt-binaries.sh
6
+
7
+ - ios dynamic frameworks are in `ffmpeg_ios.zip` directory
8
+ - android shared libraries are in `jniLibs.zip`
9
+
10
+ just replace way of downloading them that links to your binaries
11
+
12
+ ### Option B)
13
+
14
+ directly modify libraries in source code
15
+
16
+ - ios dynamic frameworks are placed in `common/cpp/audioapi/external`
17
+ - android shared libraries are placed in `android/src/main/jniLibs`
18
+
19
+ ---
20
+ `USED_LIBRARIES`:
21
+ - libavcodec
22
+ - libavformat
23
+ - libavutil
24
+ - libswresample
@@ -18,7 +18,8 @@ class IOSAudioRecorder : public AudioRecorder {
18
18
  IOSAudioRecorder(
19
19
  float sampleRate,
20
20
  int bufferLength,
21
- const std::shared_ptr<AudioEventHandlerRegistry> &audioEventHandlerRegistry);
21
+ const std::shared_ptr<AudioEventHandlerRegistry>
22
+ &audioEventHandlerRegistry);
22
23
 
23
24
  ~IOSAudioRecorder() override;
24
25
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-audio-api",
3
- "version": "0.10.0-nightly-325e87a-20251023",
3
+ "version": "0.10.0-nightly-353aaa2-20251023",
4
4
  "description": "react-native-audio-api provides system for controlling audio in React Native environment compatible with Web Audio API specification",
5
5
  "bin": {
6
6
  "setup-rn-audio-api-web": "./scripts/setup-rn-audio-api-web.js"
@@ -35,6 +35,7 @@
35
35
  "!**/.*",
36
36
  "!**/node_modules",
37
37
  "scripts/setup-rn-audio-api-web.js",
38
+ "scripts/download-prebuilt-binaries.sh",
38
39
  "app.plugin.js"
39
40
  ],
40
41
  "scripts": {
@@ -0,0 +1,52 @@
1
+ #!/bin/bash
2
+ # Script to download and unzip prebuilt native binaries for React Native.
3
+
4
+ MAIN_DOWNLOAD_URL="https://github.com/software-mansion-labs/rn-audio-libs/releases/download"
5
+ TAG="v1.0.0"
6
+ DOWNLOAD_NAMES=(
7
+ "armeabi-v7a.zip" "arm64-v8a.zip" "x86.zip" "x86_64.zip"
8
+ "ffmpeg_ios.zip" "iphoneos.zip" "iphonesimulator.zip" "jniLibs.zip"
9
+ )
10
+
11
+ # Use a temporary directory for downloads, ensuring it exists
12
+ TEMP_DOWNLOAD_DIR="$(pwd)/audioapi-binaries-temp"
13
+ mkdir -p "$TEMP_DOWNLOAD_DIR"
14
+ if [ $1 == "android" ]
15
+ then
16
+ PROJECT_ROOT="$(pwd)/.."
17
+ else
18
+ PROJECT_ROOT="$(pwd)"
19
+ fi
20
+
21
+ for name in "${DOWNLOAD_NAMES[@]}"; do
22
+ ARCH_URL="${MAIN_DOWNLOAD_URL}/${TAG}/${name}"
23
+ ZIP_FILE_PATH="${TEMP_DOWNLOAD_DIR}/${name}"
24
+
25
+ if [[ "$name" == "jniLibs.zip" ]]; then
26
+ OUTPUT_DIR="${PROJECT_ROOT}/android/src/main"
27
+ else
28
+ OUTPUT_DIR="${PROJECT_ROOT}/common/cpp/audioapi/external"
29
+ fi
30
+
31
+ mkdir -p "$OUTPUT_DIR"
32
+
33
+ if [ -f "$ZIP_FILE_PATH" ]; then
34
+ echo "Zip file already exists locally. Skipping download."
35
+ continue
36
+ fi
37
+ echo "Downloading from: $ARCH_URL"
38
+ curl -fsSL "$ARCH_URL" -o "$ZIP_FILE_PATH"
39
+
40
+ if [ $? -ne 0 ]; then
41
+ rm -f "$ZIP_FILE_PATH"
42
+ continue
43
+ fi
44
+
45
+ unzip -o "$ZIP_FILE_PATH" -d "$OUTPUT_DIR"
46
+
47
+ # Clean up any __MACOSX directories that may have been created
48
+ rm -rf "${OUTPUT_DIR}/__MACOSX"
49
+
50
+ done
51
+
52
+ rm -rf "$TEMP_DOWNLOAD_DIR"
@@ -1,44 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
- <plist version="1.0">
4
- <dict>
5
- <key>AvailableLibraries</key>
6
- <array>
7
- <dict>
8
- <key>BinaryPath</key>
9
- <string>libavcodec.framework/libavcodec</string>
10
- <key>LibraryIdentifier</key>
11
- <string>ios-arm64</string>
12
- <key>LibraryPath</key>
13
- <string>libavcodec.framework</string>
14
- <key>SupportedArchitectures</key>
15
- <array>
16
- <string>arm64</string>
17
- </array>
18
- <key>SupportedPlatform</key>
19
- <string>ios</string>
20
- </dict>
21
- <dict>
22
- <key>BinaryPath</key>
23
- <string>libavcodec.framework/libavcodec</string>
24
- <key>LibraryIdentifier</key>
25
- <string>ios-arm64_x86_64-simulator</string>
26
- <key>LibraryPath</key>
27
- <string>libavcodec.framework</string>
28
- <key>SupportedArchitectures</key>
29
- <array>
30
- <string>arm64</string>
31
- <string>x86_64</string>
32
- </array>
33
- <key>SupportedPlatform</key>
34
- <string>ios</string>
35
- <key>SupportedPlatformVariant</key>
36
- <string>simulator</string>
37
- </dict>
38
- </array>
39
- <key>CFBundlePackageType</key>
40
- <string>XFWK</string>
41
- <key>XCFrameworkFormatVersion</key>
42
- <string>1.0</string>
43
- </dict>
44
- </plist>
@@ -1 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>CFBundleDevelopmentRegion</key> <string>en</string> <key>CFBundleExecutable</key> <string>libavcodec</string> <key>CFBundleIdentifier</key> <string>io.qt.ffmpegkit.libavcodec</string> <key>CFBundleInfoDictionaryVersion</key> <string>6.0</string> <key>CFBundleName</key> <string>libavcodec</string> <key>CFBundlePackageType</key> <string>FMWK</string> <key>CFBundleShortVersionString</key> <string>7.0.2</string> <key>CFBundleVersion</key> <string>7.0.2</string> <key>CFBundleSignature</key> <string>????</string> <key>MinimumOSVersion</key> <string>16.0</string> <key>CFBundleSupportedPlatforms</key> <array> <string>iPhoneOS</string> </array> <key>NSPrincipalClass</key> <string></string> </dict> </plist>
@@ -1 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>CFBundleDevelopmentRegion</key> <string>en</string> <key>CFBundleExecutable</key> <string>libavcodec</string> <key>CFBundleIdentifier</key> <string>io.qt.ffmpegkit.libavcodec</string> <key>CFBundleInfoDictionaryVersion</key> <string>6.0</string> <key>CFBundleName</key> <string>libavcodec</string> <key>CFBundlePackageType</key> <string>FMWK</string> <key>CFBundleShortVersionString</key> <string>7.0.2</string> <key>CFBundleVersion</key> <string>7.0.2</string> <key>CFBundleSignature</key> <string>????</string> <key>MinimumOSVersion</key> <string>16.0</string> <key>CFBundleSupportedPlatforms</key> <array> <string>iPhoneOS</string> </array> <key>NSPrincipalClass</key> <string></string> </dict> </plist>
@@ -1,44 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
- <plist version="1.0">
4
- <dict>
5
- <key>AvailableLibraries</key>
6
- <array>
7
- <dict>
8
- <key>BinaryPath</key>
9
- <string>libavformat.framework/libavformat</string>
10
- <key>LibraryIdentifier</key>
11
- <string>ios-arm64_x86_64-simulator</string>
12
- <key>LibraryPath</key>
13
- <string>libavformat.framework</string>
14
- <key>SupportedArchitectures</key>
15
- <array>
16
- <string>arm64</string>
17
- <string>x86_64</string>
18
- </array>
19
- <key>SupportedPlatform</key>
20
- <string>ios</string>
21
- <key>SupportedPlatformVariant</key>
22
- <string>simulator</string>
23
- </dict>
24
- <dict>
25
- <key>BinaryPath</key>
26
- <string>libavformat.framework/libavformat</string>
27
- <key>LibraryIdentifier</key>
28
- <string>ios-arm64</string>
29
- <key>LibraryPath</key>
30
- <string>libavformat.framework</string>
31
- <key>SupportedArchitectures</key>
32
- <array>
33
- <string>arm64</string>
34
- </array>
35
- <key>SupportedPlatform</key>
36
- <string>ios</string>
37
- </dict>
38
- </array>
39
- <key>CFBundlePackageType</key>
40
- <string>XFWK</string>
41
- <key>XCFrameworkFormatVersion</key>
42
- <string>1.0</string>
43
- </dict>
44
- </plist>
@@ -1 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>CFBundleDevelopmentRegion</key> <string>en</string> <key>CFBundleExecutable</key> <string>libavformat</string> <key>CFBundleIdentifier</key> <string>io.qt.ffmpegkit.libavformat</string> <key>CFBundleInfoDictionaryVersion</key> <string>6.0</string> <key>CFBundleName</key> <string>libavformat</string> <key>CFBundlePackageType</key> <string>FMWK</string> <key>CFBundleShortVersionString</key> <string>7.0.2</string> <key>CFBundleVersion</key> <string>7.0.2</string> <key>CFBundleSignature</key> <string>????</string> <key>MinimumOSVersion</key> <string>16.0</string> <key>CFBundleSupportedPlatforms</key> <array> <string>iPhoneOS</string> </array> <key>NSPrincipalClass</key> <string></string> </dict> </plist>
@@ -1 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>CFBundleDevelopmentRegion</key> <string>en</string> <key>CFBundleExecutable</key> <string>libavformat</string> <key>CFBundleIdentifier</key> <string>io.qt.ffmpegkit.libavformat</string> <key>CFBundleInfoDictionaryVersion</key> <string>6.0</string> <key>CFBundleName</key> <string>libavformat</string> <key>CFBundlePackageType</key> <string>FMWK</string> <key>CFBundleShortVersionString</key> <string>7.0.2</string> <key>CFBundleVersion</key> <string>7.0.2</string> <key>CFBundleSignature</key> <string>????</string> <key>MinimumOSVersion</key> <string>16.0</string> <key>CFBundleSupportedPlatforms</key> <array> <string>iPhoneOS</string> </array> <key>NSPrincipalClass</key> <string></string> </dict> </plist>
@@ -1,44 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
- <plist version="1.0">
4
- <dict>
5
- <key>AvailableLibraries</key>
6
- <array>
7
- <dict>
8
- <key>BinaryPath</key>
9
- <string>libavutil.framework/libavutil</string>
10
- <key>LibraryIdentifier</key>
11
- <string>ios-arm64</string>
12
- <key>LibraryPath</key>
13
- <string>libavutil.framework</string>
14
- <key>SupportedArchitectures</key>
15
- <array>
16
- <string>arm64</string>
17
- </array>
18
- <key>SupportedPlatform</key>
19
- <string>ios</string>
20
- </dict>
21
- <dict>
22
- <key>BinaryPath</key>
23
- <string>libavutil.framework/libavutil</string>
24
- <key>LibraryIdentifier</key>
25
- <string>ios-arm64_x86_64-simulator</string>
26
- <key>LibraryPath</key>
27
- <string>libavutil.framework</string>
28
- <key>SupportedArchitectures</key>
29
- <array>
30
- <string>arm64</string>
31
- <string>x86_64</string>
32
- </array>
33
- <key>SupportedPlatform</key>
34
- <string>ios</string>
35
- <key>SupportedPlatformVariant</key>
36
- <string>simulator</string>
37
- </dict>
38
- </array>
39
- <key>CFBundlePackageType</key>
40
- <string>XFWK</string>
41
- <key>XCFrameworkFormatVersion</key>
42
- <string>1.0</string>
43
- </dict>
44
- </plist>
@@ -1 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>CFBundleDevelopmentRegion</key> <string>en</string> <key>CFBundleExecutable</key> <string>libavutil</string> <key>CFBundleIdentifier</key> <string>io.qt.ffmpegkit.libavutil</string> <key>CFBundleInfoDictionaryVersion</key> <string>6.0</string> <key>CFBundleName</key> <string>libavutil</string> <key>CFBundlePackageType</key> <string>FMWK</string> <key>CFBundleShortVersionString</key> <string>7.0.2</string> <key>CFBundleVersion</key> <string>7.0.2</string> <key>CFBundleSignature</key> <string>????</string> <key>MinimumOSVersion</key> <string>16.0</string> <key>CFBundleSupportedPlatforms</key> <array> <string>iPhoneOS</string> </array> <key>NSPrincipalClass</key> <string></string> </dict> </plist>
@@ -1 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>CFBundleDevelopmentRegion</key> <string>en</string> <key>CFBundleExecutable</key> <string>libavutil</string> <key>CFBundleIdentifier</key> <string>io.qt.ffmpegkit.libavutil</string> <key>CFBundleInfoDictionaryVersion</key> <string>6.0</string> <key>CFBundleName</key> <string>libavutil</string> <key>CFBundlePackageType</key> <string>FMWK</string> <key>CFBundleShortVersionString</key> <string>7.0.2</string> <key>CFBundleVersion</key> <string>7.0.2</string> <key>CFBundleSignature</key> <string>????</string> <key>MinimumOSVersion</key> <string>16.0</string> <key>CFBundleSupportedPlatforms</key> <array> <string>iPhoneOS</string> </array> <key>NSPrincipalClass</key> <string></string> </dict> </plist>
@@ -1,44 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
- <plist version="1.0">
4
- <dict>
5
- <key>AvailableLibraries</key>
6
- <array>
7
- <dict>
8
- <key>BinaryPath</key>
9
- <string>libswresample.framework/libswresample</string>
10
- <key>LibraryIdentifier</key>
11
- <string>ios-arm64</string>
12
- <key>LibraryPath</key>
13
- <string>libswresample.framework</string>
14
- <key>SupportedArchitectures</key>
15
- <array>
16
- <string>arm64</string>
17
- </array>
18
- <key>SupportedPlatform</key>
19
- <string>ios</string>
20
- </dict>
21
- <dict>
22
- <key>BinaryPath</key>
23
- <string>libswresample.framework/libswresample</string>
24
- <key>LibraryIdentifier</key>
25
- <string>ios-arm64_x86_64-simulator</string>
26
- <key>LibraryPath</key>
27
- <string>libswresample.framework</string>
28
- <key>SupportedArchitectures</key>
29
- <array>
30
- <string>arm64</string>
31
- <string>x86_64</string>
32
- </array>
33
- <key>SupportedPlatform</key>
34
- <string>ios</string>
35
- <key>SupportedPlatformVariant</key>
36
- <string>simulator</string>
37
- </dict>
38
- </array>
39
- <key>CFBundlePackageType</key>
40
- <string>XFWK</string>
41
- <key>XCFrameworkFormatVersion</key>
42
- <string>1.0</string>
43
- </dict>
44
- </plist>
@@ -1 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>CFBundleDevelopmentRegion</key> <string>en</string> <key>CFBundleExecutable</key> <string>libswresample</string> <key>CFBundleIdentifier</key> <string>io.qt.ffmpegkit.libswresample</string> <key>CFBundleInfoDictionaryVersion</key> <string>6.0</string> <key>CFBundleName</key> <string>libswresample</string> <key>CFBundlePackageType</key> <string>FMWK</string> <key>CFBundleShortVersionString</key> <string>7.0.2</string> <key>CFBundleVersion</key> <string>7.0.2</string> <key>CFBundleSignature</key> <string>????</string> <key>MinimumOSVersion</key> <string>16.0</string> <key>CFBundleSupportedPlatforms</key> <array> <string>iPhoneOS</string> </array> <key>NSPrincipalClass</key> <string></string> </dict> </plist>
@@ -1 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>CFBundleDevelopmentRegion</key> <string>en</string> <key>CFBundleExecutable</key> <string>libswresample</string> <key>CFBundleIdentifier</key> <string>io.qt.ffmpegkit.libswresample</string> <key>CFBundleInfoDictionaryVersion</key> <string>6.0</string> <key>CFBundleName</key> <string>libswresample</string> <key>CFBundlePackageType</key> <string>FMWK</string> <key>CFBundleShortVersionString</key> <string>7.0.2</string> <key>CFBundleVersion</key> <string>7.0.2</string> <key>CFBundleSignature</key> <string>????</string> <key>MinimumOSVersion</key> <string>16.0</string> <key>CFBundleSupportedPlatforms</key> <array> <string>iPhoneOS</string> </array> <key>NSPrincipalClass</key> <string></string> </dict> </plist>
@@ -1,26 +0,0 @@
1
- # Instruction on how to compile your own version of the ffmpeg and to replace binary files with yours.
2
-
3
- If you would like to change ffmpeg binaries f.e. to include some of its functionalities. There are possible solutions to do that.
4
-
5
- Basically, there are two options to achieve it:
6
-
7
- - Utilize `ffmpeg_setup.sh` script, which provides set of instructions to cross-compile FFmpeg library on all desired mobile architectures.
8
- - Cross-compile it dynamically fully on your own.
9
-
10
- Last part in both of the cases is to replace files in corresponding places.
11
-
12
- ## Where to put compiled files?
13
-
14
- ### Includes
15
-
16
- All includes should go to packages/react-native-audio-api/common/cpp/audioapi/external/ffmpeg_include
17
-
18
- ### Android
19
-
20
- Put your corresponding .so files for each architecture (TARGET_ABI) to packages/react-native-audio-api/android/src/main/jniLibs/TARGET_ABI
21
-
22
- ### iOS
23
-
24
- Put corresponding .xcframework files in packages/react-native-audio-api/common/cpp/audioapi/external
25
-
26
- ## Warning: due to how xcode build an app, it is recommended to delete output directory after moving prebuilt
@@ -1,111 +0,0 @@
1
- #!/usr/bin/env bash
2
-
3
- # Creates an Info.plist file for a given framework:
4
- build_info_plist() {
5
- local file_path="$1"
6
- local framework_name="$2"
7
- local framework_id="$3"
8
-
9
- # Minimum version must be the same we used when building FFmpeg.
10
- local minimum_version_key="MinimumOSVersion"
11
- local minimum_os_version="16.0"
12
-
13
- local supported_platforms="iPhoneOS"
14
-
15
- info_plist="<?xml version=\"1.0\" encoding=\"UTF-8\"?>
16
- <!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">
17
- <plist version=\"1.0\">
18
- <dict>
19
- <key>CFBundleDevelopmentRegion</key>
20
- <string>en</string>
21
- <key>CFBundleExecutable</key>
22
- <string>${framework_name}</string>
23
- <key>CFBundleIdentifier</key>
24
- <string>${framework_id}</string>
25
- <key>CFBundleInfoDictionaryVersion</key>
26
- <string>6.0</string>
27
- <key>CFBundleName</key>
28
- <string>${framework_name}</string>
29
- <key>CFBundlePackageType</key>
30
- <string>FMWK</string>
31
- <key>CFBundleShortVersionString</key>
32
- <string>7.0.2</string>
33
- <key>CFBundleVersion</key>
34
- <string>7.0.2</string>
35
- <key>CFBundleSignature</key>
36
- <string>????</string>
37
- <key>${minimum_version_key}</key>
38
- <string>${minimum_os_version}</string>
39
- <key>CFBundleSupportedPlatforms</key>
40
- <array>
41
- <string>${supported_platforms}</string>
42
- </array>
43
- <key>NSPrincipalClass</key>
44
- <string></string>
45
- </dict>
46
- </plist>"
47
- echo $info_plist | tee ${file_path} 1>/dev/null
48
- }
49
-
50
- dylib_regex="^@rpath/.*\.dylib$"
51
-
52
- # Creates framework from a dylib file:
53
- create_framework() {
54
- local framework_name="$1"
55
- local ffmpeg_library_path="$2"
56
- local framework_complete_path="${ffmpeg_library_path}/framework/${framework_name}.framework/${framework_name}"
57
-
58
- # Create framework directory and copy dylib file to this directory:
59
- mkdir -p "${ffmpeg_library_path}/framework/${framework_name}.framework"
60
- cp "${ffmpeg_library_path}/lib/${framework_name}.dylib" "${ffmpeg_library_path}/framework/${framework_name}.framework/${framework_name}"
61
-
62
- # Change the shared library identification name, removing version number and 'dylib' extension;
63
- # \c Frameworks part of the name is needed since this is where frameworks will be installed in
64
- # an application bundle:
65
- install_name_tool -id @rpath/${framework_name}.framework/${framework_name} "${framework_complete_path}"
66
-
67
- # Add Info.plist file into the framework directory:
68
- build_info_plist "${ffmpeg_library_path}/framework/${framework_name}.framework/Info.plist" "${framework_name}" "io.qt.ffmpegkit."${framework_name}
69
- otool -L "$framework_complete_path" | awk '/\t/ {print $1}' | egrep "$dylib_regex" | while read -r dependency_path; do
70
- found_name=$(tmp=${dependency_path/*\/}; echo ${tmp/\.*})
71
- if [ "$found_name" != "$framework_name" ]
72
- then
73
- # Change the dependent shared library install name to remove version number and 'dylib' extension:
74
- install_name_tool -change "$dependency_path" @rpath/${found_name}.framework/${found_name} "${framework_complete_path}"
75
- fi
76
- done
77
- }
78
-
79
- ffmpeg_libs="libavcodec libavformat libavutil libswresample"
80
-
81
- for name in $ffmpeg_libs; do
82
- create_framework $name output/ios/iphoneos
83
- create_framework $name output/ios/iphonesimulator
84
- done
85
-
86
- # Create XCFramework:
87
- OUTPUT_DIR="output/ios"
88
-
89
- xcodebuild -create-xcframework \
90
- -framework "${OUTPUT_DIR}/iphoneos/framework/libavcodec.framework" \
91
- -framework "${OUTPUT_DIR}/iphonesimulator/framework/libavcodec.framework" \
92
- -output "${OUTPUT_DIR}/libavcodec.xcframework"
93
-
94
- xcodebuild -create-xcframework \
95
- -framework "${OUTPUT_DIR}/iphoneos/framework/libavformat.framework" \
96
- -framework "${OUTPUT_DIR}/iphonesimulator/framework/libavformat.framework" \
97
- -output "${OUTPUT_DIR}/libavformat.xcframework"
98
-
99
- xcodebuild -create-xcframework \
100
- -framework "${OUTPUT_DIR}/iphoneos/framework/libavutil.framework" \
101
- -framework "${OUTPUT_DIR}/iphonesimulator/framework/libavutil.framework" \
102
- -output "${OUTPUT_DIR}/libavutil.xcframework"
103
-
104
- xcodebuild -create-xcframework \
105
- -framework "${OUTPUT_DIR}/iphoneos/framework/libswresample.framework" \
106
- -framework "${OUTPUT_DIR}/iphonesimulator/framework/libswresample.framework" \
107
- -output "${OUTPUT_DIR}/libswresample.xcframework"
108
-
109
-
110
-
111
-
@@ -1,381 +0,0 @@
1
- #!/bin/bash
2
-
3
- # FFmpeg Mobile Architecture Build Script
4
- # Builds shared ffmpeg binaries for iOS and Android architectures
5
- set -e
6
-
7
- SOURCE_DIR="/path/to/your/ffmpeg" # Change this to your FFmpeg source directory
8
- if [ ! -d "${SOURCE_DIR}" ]; then
9
- echo "FFmpeg source directory does not exist: ${SOURCE_DIR}"
10
- exit 1
11
- fi
12
-
13
- BUILD_DIR="$(pwd)/build"
14
- OUTPUT_DIR="$(pwd)/output"
15
- mkdir -p "${BUILD_DIR}"
16
- mkdir -p "${OUTPUT_DIR}"
17
-
18
- AVUTIL_VERSION="60.6.100"
19
- AVCODEC_VERSION="62.8.100"
20
- AVFORMAT_VERSION="62.1.103"
21
- SWRRESAMPLE_VERSION="6.0.100"
22
-
23
- COMMON_CONFIG="
24
- --disable-programs
25
- --disable-doc
26
- --disable-htmlpages
27
- --disable-manpages
28
- --disable-podpages
29
- --disable-txtpages
30
- --disable-avdevice
31
- --disable-swscale
32
- --disable-avfilter
33
- --disable-protocols
34
- --disable-devices
35
- --disable-filters
36
- --disable-static
37
- --enable-shared
38
- --enable-small
39
- --disable-debug
40
- --disable-optimizations
41
- --disable-everything
42
- --disable-audiotoolbox
43
- --disable-videotoolbox
44
- --disable-hwaccels
45
- --enable-protocol=https,tls,tcp,http
46
- --enable-demuxer=hls
47
- --enable-demuxer=mov
48
- --enable-demuxer=mp3
49
- --enable-parser=aac
50
- --enable-decoder=aac
51
- --enable-decoder=mp3
52
- --enable-decoder=flac
53
- --enable-protocol=udp
54
- --enable-protocol=file
55
- --enable-pic
56
- --disable-x86asm
57
- "
58
-
59
- build_arch() {
60
- local ARCH=$1
61
- local PLATFORM=$2
62
- local CC=$3
63
- local CXX=$4
64
- local CFLAGS=$5
65
- local LDFLAGS=$6
66
- local EXTRA_CONFIG=$7
67
-
68
- if [[ ${PLATFORM} == "android" ]]; then
69
- PLATFORM_NAME="android"
70
- if [[ ${ARCH} == "aarch64" ]]; then
71
- ARCH_NAME="arm64-v8a"
72
- elif [[ ${ARCH} == "armv7a" ]]; then
73
- ARCH_NAME="armeabi-v7a"
74
- else
75
- ARCH_NAME=${ARCH}
76
- fi
77
- elif [[ ${PLATFORM} == "darwin" ]]; then
78
- PLATFORM_NAME="ios"
79
- ARCH_NAME="iphoneos"
80
- elif [[ ${PLATFORM} == "darwinsim" ]]; then
81
- PLATFORM_NAME="ios"
82
- if [[ ${ARCH} == "x86_64" ]]; then
83
- ARCH_NAME="iphonesimulator_x86_64"
84
- else
85
- ARCH_NAME="iphonesimulator_arm64"
86
- fi
87
- fi
88
-
89
- echo "Building FFmpeg for ${PLATFORM_NAME} ${ARCH_NAME}..."
90
-
91
- SOURCE_PATH="${BUILD_DIR}/ffmpeg-${PLATFORM_NAME}-${ARCH_NAME}"
92
- OUTPUT_PATH="${OUTPUT_DIR}/${PLATFORM_NAME}/${ARCH_NAME}"
93
-
94
- mkdir -p "${OUTPUT_PATH}"
95
-
96
- echo "Copying source for ${PLATFORM_NAME} ${ARCH_NAME}..."
97
- rm -rf "${SOURCE_PATH}"
98
- cp -r "${SOURCE_DIR}" "${SOURCE_PATH}"
99
-
100
- cd "${SOURCE_PATH}"
101
-
102
- make distclean 2>/dev/null || true
103
-
104
- if [[ ${PLATFORM} == "darwinsim" ]]; then
105
- PLATFORM="darwin"
106
- fi
107
-
108
- echo --enable-cross-compile --arch=${ARCH} --target-os=${PLATFORM} --cc="${CC}" --cxx="${CXX}" --extra-cflags="${CFLAGS}" --extra-ldflags="${LDFLAGS}" --prefix="${OUTPUT_PATH}" ${COMMON_CONFIG} ${EXTRA_CONFIG}
109
-
110
- # Configure
111
- ./configure \
112
- --enable-cross-compile \
113
- --arch=${ARCH} \
114
- --target-os=${PLATFORM} \
115
- --cc="${CC}" \
116
- --cxx="${CXX}" \
117
- --extra-cflags="${CFLAGS}" \
118
- --extra-ldflags="${LDFLAGS}" \
119
- --prefix="${OUTPUT_PATH}" \
120
- ${COMMON_CONFIG} \
121
- ${EXTRA_CONFIG}
122
-
123
- # Build
124
- make -j10
125
- make install
126
-
127
- echo "Completed ${PLATFORM} ${ARCH}"
128
- cd - > /dev/null
129
- }
130
-
131
- fix_dynamic_ios_linkage() {
132
- local LIB_PATH=$1
133
-
134
- # Get all dependencies that are not system libraries (including the library itself)
135
- otool -L "${LIB_PATH}" | grep -v "/usr/lib/" | grep -v "/System/" | awk 'NR>1 {print $1}' | while read -r dep; do
136
- if [[ -n "$dep" ]]; then
137
- # Extract library name without any version numbers and extension for framework path
138
- local lib_name=$(basename "$dep" | sed 's/\.dylib$//' | sed 's/\.[0-9][0-9.]*$//')
139
- local framework_path="@rpath/${lib_name}.framework/${lib_name}"
140
- echo "Changing dependency: $dep -> $framework_path"
141
- install_name_tool -change "$dep" "$framework_path" "${LIB_PATH}"
142
- fi
143
- done
144
-
145
- # Also update the library's own install name to use @rpath with framework structure
146
- local lib_name=$(basename "${LIB_PATH}" | sed 's/\.dylib$//' | sed 's/\.[0-9][0-9.]*$//')
147
- local framework_path="@rpath/${lib_name}.framework/${lib_name}"
148
- echo "Updating install name for $(basename "${LIB_PATH}") -> $framework_path"
149
- install_name_tool -id "$framework_path" "${LIB_PATH}"
150
- }
151
-
152
- # Check if source exists
153
- if [ ! -d "${SOURCE_DIR}" ]; then
154
- echo "FFmpeg source not found."
155
- exit 1
156
- fi
157
-
158
- # Clean the source directory of any previous builds
159
- cd "${SOURCE_DIR}"
160
- make distclean 2>/dev/null || true
161
- cd - > /dev/null
162
-
163
- # Use NDK_ROOT if ANDROID_NDK_ROOT is not set
164
- NDK_PATH="${ANDROID_NDK_ROOT:-$NDK_ROOT}"
165
-
166
- if [ ! -d "$NDK_PATH" ]; then
167
- echo "Android NDK not found. Please set ANDROID_NDK_ROOT or NDK_ROOT environment variable"
168
- exit 1
169
- fi
170
-
171
- API_LEVEL=21
172
- TOOLCHAIN_PATH="${NDK_PATH}/toolchains/llvm/prebuilt"
173
- export ANDROID_NDK_ROOT=${NDK_PATH}
174
-
175
- # Detect host OS for toolchain
176
- if [[ "$OSTYPE" == "darwin"* ]]; then
177
- HOST_TAG="darwin-x86_64"
178
- elif [[ "$OSTYPE" == "linux-gnu"* ]]; then
179
- HOST_TAG="linux-x86_64"
180
- else
181
- echo "Unsupported host OS for Android NDK"
182
- exit 1
183
- fi
184
-
185
- TOOLCHAIN="${TOOLCHAIN_PATH}/${HOST_TAG}"
186
- PATH=$TOOLCHAIN/bin:$PATH
187
-
188
- OPENSSL_PREBUILT_FOLDER="$(pwd)/openssl-prebuilt"
189
- if [ ! -d "$OPENSSL_PREBUILT_FOLDER" ]; then
190
- echo "Cloning and building OpenSSL..."
191
- if [ ! -d "openssl" ]; then
192
- git clone https://github.com/openssl/openssl.git
193
- fi
194
- cd openssl
195
- mkdir -p "${OPENSSL_PREBUILT_FOLDER}/include"
196
-
197
- # ios-arm
198
- ./Configure ios64-xcrun no-shared no-asm no-tests
199
- make build_libs -j10
200
- mkdir -p ${OPENSSL_PREBUILT_FOLDER}/iphoneos && cp libcrypto.a libssl.a "${OPENSSL_PREBUILT_FOLDER}/iphoneos"
201
- cp -r include/crypto include/openssl "${OPENSSL_PREBUILT_FOLDER}/include"
202
- make clean
203
-
204
- # arm-simulator
205
- ./Configure iossimulator-arm64-xcrun no-shared no-asm no-tests
206
- make build_libs -j10
207
- mkdir -p ${OPENSSL_PREBUILT_FOLDER}/iphonesimulator && cp libcrypto.a libssl.a "${OPENSSL_PREBUILT_FOLDER}/iphonesimulator"
208
- make clean
209
-
210
- # x86_64-simulator
211
- ./Configure iossimulator-x86_64-xcrun no-shared no-asm no-tests
212
- make build_libs -j10
213
- mkdir -p ${OPENSSL_PREBUILT_FOLDER}/iphonesimulator-x86_64 && cp libcrypto.a libssl.a "${OPENSSL_PREBUILT_FOLDER}/iphonesimulator-x86_64"
214
- make clean
215
-
216
- # arm64-v8a
217
- ./Configure android-arm64 no-shared no-asm no-tests -D__ANDROID_API__=${API_LEVEL}
218
- make build_libs -j10
219
- mkdir -p ${OPENSSL_PREBUILT_FOLDER}/arm64-v8a && cp libcrypto.a libssl.a "${OPENSSL_PREBUILT_FOLDER}/arm64-v8a"
220
- make clean
221
-
222
- # armeabi-v7a
223
- ./Configure android-arm no-shared no-asm no-tests -D__ANDROID_API__=${API_LEVEL}
224
- make build_libs -j10
225
- mkdir -p ${OPENSSL_PREBUILT_FOLDER}/armeabi-v7a && cp libcrypto.a libssl.a "${OPENSSL_PREBUILT_FOLDER}/armeabi-v7a"
226
- make clean
227
-
228
- ./Configure android-x86 no-shared no-asm no-tests -D__ANDROID_API__=${API_LEVEL}
229
- make build_libs -j10
230
- mkdir -p ${OPENSSL_PREBUILT_FOLDER}/x86 && cp libcrypto.a libssl.a "${OPENSSL_PREBUILT_FOLDER}/x86"
231
- make clean
232
-
233
- ./Configure android-x86_64 no-shared no-asm no-tests -D__ANDROID_API__=${API_LEVEL}
234
- make build_libs -j10
235
- mkdir -p ${OPENSSL_PREBUILT_FOLDER}/x86_64 && cp libcrypto.a libssl.a "${OPENSSL_PREBUILT_FOLDER}/x86_64"
236
- make clean
237
-
238
- cd .. && rm -rf openssl
239
- fi
240
-
241
- # iOS Architectures
242
- if [[ "$OSTYPE" == "darwin"* ]]; then
243
- echo "Building for iOS architectures..."
244
-
245
- # iOS SDK paths
246
- IOS_SDK_PATH=$(xcrun --sdk iphoneos --show-sdk-path)
247
- IOS_SIM_SDK_PATH=$(xcrun --sdk iphonesimulator --show-sdk-path)
248
-
249
- # iOS Device architecture
250
- build_arch "arm64" "darwin" \
251
- "$(xcrun --sdk iphoneos --find clang)" \
252
- "$(xcrun --sdk iphoneos --find clang++)" \
253
- "-I${OPENSSL_PREBUILT_FOLDER}/include -arch arm64 -mios-version-min=11.0 -isysroot ${IOS_SDK_PATH}" \
254
- "-L${OPENSSL_PREBUILT_FOLDER}/iphoneos -arch arm64 -mios-version-min=11.0 -isysroot ${IOS_SDK_PATH}" \
255
- "--disable-iconv --disable-zlib --enable-openssl --disable-securetransport"
256
-
257
- fix_dynamic_ios_linkage "${OUTPUT_DIR}/ios/iphoneos/lib/libavcodec.${AVCODEC_VERSION}.dylib"
258
- fix_dynamic_ios_linkage "${OUTPUT_DIR}/ios/iphoneos/lib/libavformat.${AVFORMAT_VERSION}.dylib"
259
- fix_dynamic_ios_linkage "${OUTPUT_DIR}/ios/iphoneos/lib/libavutil.${AVUTIL_VERSION}.dylib"
260
- fix_dynamic_ios_linkage "${OUTPUT_DIR}/ios/iphoneos/lib/libswresample.${SWRRESAMPLE_VERSION}.dylib"
261
-
262
- rm -rf "${OUTPUT_DIR}/ios/iphoneos/share"
263
-
264
- # iOS Simulator arm (Silicon Macs)
265
- build_arch "arm64" "darwinsim" \
266
- "$(xcrun --sdk iphonesimulator --find clang)" \
267
- "$(xcrun --sdk iphonesimulator --find clang++)" \
268
- "-I${OPENSSL_PREBUILT_FOLDER}/include -arch arm64 -mios-simulator-version-min=11.0 -isysroot ${IOS_SIM_SDK_PATH}" \
269
- "-L${OPENSSL_PREBUILT_FOLDER}/iphonesimulator -arch arm64 -mios-simulator-version-min=11.0 -isysroot ${IOS_SIM_SDK_PATH}" \
270
- "--disable-iconv --disable-zlib --enable-openssl --disable-securetransport"
271
-
272
- fix_dynamic_ios_linkage "${OUTPUT_DIR}/ios/iphonesimulator_arm64/lib/libavcodec.${AVCODEC_VERSION}.dylib"
273
- fix_dynamic_ios_linkage "${OUTPUT_DIR}/ios/iphonesimulator_arm64/lib/libavformat.${AVFORMAT_VERSION}.dylib"
274
- fix_dynamic_ios_linkage "${OUTPUT_DIR}/ios/iphonesimulator_arm64/lib/libavutil.${AVUTIL_VERSION}.dylib"
275
- fix_dynamic_ios_linkage "${OUTPUT_DIR}/ios/iphonesimulator_arm64/lib/libswresample.${SWRRESAMPLE_VERSION}.dylib"
276
-
277
- rm -rf "${OUTPUT_DIR}/ios/iphonesimulator_arm64/share"
278
-
279
- # iOS Simulator x86_64 (Intel Macs)
280
- build_arch "x86_64" "darwinsim" \
281
- "$(xcrun --sdk iphonesimulator --find clang)" \
282
- "$(xcrun --sdk iphonesimulator --find clang++)" \
283
- "-I${OPENSSL_PREBUILT_FOLDER}/include -arch x86_64 -mios-simulator-version-min=11.0 -isysroot ${IOS_SIM_SDK_PATH}" \
284
- "-L${OPENSSL_PREBUILT_FOLDER}/iphonesimulator-x86_64 -arch x86_64 -mios-simulator-version-min=11.0 -isysroot ${IOS_SIM_SDK_PATH}" \
285
- "--disable-iconv --disable-zlib --enable-openssl --disable-securetransport"
286
-
287
- fix_dynamic_ios_linkage "${OUTPUT_DIR}/ios/iphonesimulator_x86_64/lib/libavcodec.${AVCODEC_VERSION}.dylib"
288
- fix_dynamic_ios_linkage "${OUTPUT_DIR}/ios/iphonesimulator_x86_64/lib/libavformat.${AVFORMAT_VERSION}.dylib"
289
- fix_dynamic_ios_linkage "${OUTPUT_DIR}/ios/iphonesimulator_x86_64/lib/libavutil.${AVUTIL_VERSION}.dylib"
290
- fix_dynamic_ios_linkage "${OUTPUT_DIR}/ios/iphonesimulator_x86_64/lib/libswresample.${SWRRESAMPLE_VERSION}.dylib"
291
-
292
- rm -rf "${OUTPUT_DIR}/ios/iphonesimulator_x86_64/share"
293
-
294
- mkdir -p "${OUTPUT_DIR}/ios/iphonesimulator/lib"
295
- # Create universal simulator libraries
296
- lipo -create \
297
- "${OUTPUT_DIR}/ios/iphonesimulator_arm64/lib/libavcodec.${AVCODEC_VERSION}.dylib" \
298
- "${OUTPUT_DIR}/ios/iphonesimulator_x86_64/lib/libavcodec.${AVCODEC_VERSION}.dylib" \
299
- -output "${OUTPUT_DIR}/ios/iphonesimulator/lib/libavcodec.${AVCODEC_VERSION}.dylib"
300
- lipo -create \
301
- "${OUTPUT_DIR}/ios/iphonesimulator_arm64/lib/libavformat.${AVFORMAT_VERSION}.dylib" \
302
- "${OUTPUT_DIR}/ios/iphonesimulator_x86_64/lib/libavformat.${AVFORMAT_VERSION}.dylib" \
303
- -output "${OUTPUT_DIR}/ios/iphonesimulator/lib/libavformat.${AVFORMAT_VERSION}.dylib"
304
-
305
- lipo -create \
306
- "${OUTPUT_DIR}/ios/iphonesimulator_arm64/lib/libavutil.${AVUTIL_VERSION}.dylib" \
307
- "${OUTPUT_DIR}/ios/iphonesimulator_x86_64/lib/libavutil.${AVUTIL_VERSION}.dylib" \
308
- -output "${OUTPUT_DIR}/ios/iphonesimulator/lib/libavutil.${AVUTIL_VERSION}.dylib"
309
-
310
- lipo -create \
311
- "${OUTPUT_DIR}/ios/iphonesimulator_arm64/lib/libswresample.${SWRRESAMPLE_VERSION}.dylib" \
312
- "${OUTPUT_DIR}/ios/iphonesimulator_x86_64/lib/libswresample.${SWRRESAMPLE_VERSION}.dylib" \
313
- -output "${OUTPUT_DIR}/ios/iphonesimulator/lib/libswresample.${SWRRESAMPLE_VERSION}.dylib"
314
-
315
- mv "${OUTPUT_DIR}/ios/iphonesimulator/lib/libswresample.${SWRRESAMPLE_VERSION}.dylib" "${OUTPUT_DIR}/ios/iphonesimulator/lib/libswresample.dylib"
316
- mv "${OUTPUT_DIR}/ios/iphonesimulator/lib/libavutil.${AVUTIL_VERSION}.dylib" "${OUTPUT_DIR}/ios/iphonesimulator/lib/libavutil.dylib"
317
- mv "${OUTPUT_DIR}/ios/iphonesimulator/lib/libavformat.${AVFORMAT_VERSION}.dylib" "${OUTPUT_DIR}/ios/iphonesimulator/lib/libavformat.dylib"
318
- mv "${OUTPUT_DIR}/ios/iphonesimulator/lib/libavcodec.${AVCODEC_VERSION}.dylib" "${OUTPUT_DIR}/ios/iphonesimulator/lib/libavcodec.dylib"
319
-
320
- # create frameworks from binaries
321
- bash ./create_xcframework.sh
322
-
323
- echo "iOS builds completed!"
324
- else
325
- echo "Skipping iOS builds (requires macOS)"
326
- fi
327
-
328
- # Android Architectures
329
- if [ -n "$ANDROID_NDK_ROOT" ] || [ -n "$NDK_ROOT" ]; then
330
- echo "Building for Android architectures..."
331
-
332
- # ARM64-v8a
333
- build_arch "aarch64" "android" \
334
- "${TOOLCHAIN}/bin/aarch64-linux-android${API_LEVEL}-clang" \
335
- "${TOOLCHAIN}/bin/aarch64-linux-android${API_LEVEL}-clang++" \
336
- "-I${OPENSSL_PREBUILT_FOLDER}/include -I${TOOLCHAIN}/sysroot/usr/include -fPIC -Wl,-Bsymbolic -Wl,-z,max-page-size=16384 -Wl,-z,common-page-size=16384" \
337
- "-L${OPENSSL_PREBUILT_FOLDER}/arm64-v8a -L${TOOLCHAIN}/sysroot/usr/lib/aarch64-linux-android/${API_LEVEL} -fPIC -Wl,-Bsymbolic -Wl,-z,max-page-size=16384 -Wl,-z,common-page-size=16384" \
338
- "--enable-openssl --extra-libs=-lz"
339
-
340
- rm -rf ${OUTPUT_DIR}/android/arm64-v8a/share
341
-
342
- # ARMv7a
343
- build_arch "armv7a" "android" \
344
- "${TOOLCHAIN}/bin/armv7a-linux-androideabi${API_LEVEL}-clang" \
345
- "${TOOLCHAIN}/bin/armv7a-linux-androideabi${API_LEVEL}-clang++" \
346
- "-I${OPENSSL_PREBUILT_FOLDER}/include -I${TOOLCHAIN}/sysroot/usr/include -fPIC -Wl,-Bsymbolic -Wl,-z,max-page-size=16384 -Wl,-z,common-page-size=16384" \
347
- "-L${OPENSSL_PREBUILT_FOLDER}/armeabi-v7a -L${TOOLCHAIN}/sysroot/usr/lib/arm-linux-android/${API_LEVEL} -fPIC -Wl,-Bsymbolic -Wl,-z,max-page-size=16384 -Wl,-z,common-page-size=16384" \
348
- "--enable-openssl --extra-libs=-lz"
349
-
350
- rm -rf ${OUTPUT_DIR}/android/armeabi-v7a/share
351
-
352
- # x86
353
- build_arch "x86" "android" \
354
- "${TOOLCHAIN}/bin/i686-linux-android${API_LEVEL}-clang" \
355
- "${TOOLCHAIN}/bin/i686-linux-android${API_LEVEL}-clang++" \
356
- "-I${OPENSSL_PREBUILT_FOLDER}/include -I${TOOLCHAIN}/darwin-x86_64/sysroot/usr/include -fPIC -Wl,-Bsymbolic -Wl,-z,max-page-size=16384 -Wl,-z,common-page-size=16384" \
357
- "-L${OPENSSL_PREBUILT_FOLDER}/x86 -L${TOOLCHAIN}/darwin-x86_64/sysroot/usr/lib/i686-linux-android/${API_LEVEL} -fPIC -Wl,-Bsymbolic -Wl,-z,max-page-size=16384 -Wl,-z,common-page-size=16384" \
358
- "--enable-openssl --extra-libs=-lz"
359
-
360
- rm -rf ${OUTPUT_DIR}/android/x86/share
361
-
362
-
363
- # x86_64
364
- build_arch "x86_64" "android" \
365
- "${TOOLCHAIN}/bin/x86_64-linux-android${API_LEVEL}-clang" \
366
- "${TOOLCHAIN}/bin/x86_64-linux-android${API_LEVEL}-clang++" \
367
- "-I${OPENSSL_PREBUILT_FOLDER}/include -I${TOOLCHAIN}/darwin-x86_64/sysroot/usr/include -fPIC -Wl,-Bsymbolic -Wl,-z,max-page-size=16384 -Wl,-z,common-page-size=16384" \
368
- "-L${OPENSSL_PREBUILT_FOLDER}/x86_64 -L${TOOLCHAIN}/darwin-x86_64/sysroot/usr/lib/x86_64-linux-android/${API_LEVEL} -fPIC -Wl,-Bsymbolic -Wl,-z,max-page-size=16384 -Wl,-z,common-page-size=16384" \
369
- "--enable-openssl --extra-libs=-lz"
370
-
371
- rm -rf ${OUTPUT_DIR}/android/x86_64/share
372
-
373
-
374
- echo "Android builds completed!"
375
- else
376
- echo "Skipping Android builds (ANDROID_NDK_ROOT or NDK_ROOT not set)"
377
- fi
378
-
379
- rm -rf "${BUILD_DIR}"
380
-
381
- echo "All FFmpeg builds completed!"