Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ xcuserdata/
timeline.xctimeline
playground.xcworkspace
.build/
.swiftpm/
build/
Pods/
3 changes: 1 addition & 2 deletions Mediasoup-Client-Swift.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@ Pod::Spec.new do |spec|
spec.author = {
"Alexander Gorbunov" => "gorbunov.a@vlprojects.pro"
}

spec.name = "Mediasoup-Client-Swift"
spec.version = "0.8.0"
spec.platform = :ios, "14.0"
spec.module_name = "Mediasoup"
spec.module_map = "Mediasoup/Mediasoup.modulemap"

Expand Down
10 changes: 5 additions & 5 deletions Mediasoup.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "set -e\n\nFRAMEWORK_NAME=\"Mediasoup\"\nBUILD_DIR=\"${SRCROOT}/build/Mediasoup\"\nOUTPUT_DIR=\"${SRCROOT}/bin\"\n\n# Remove build directory if it exists\nif [ -d \"${BUILD_DIR}\" ]; then\n\trm -rf \"${BUILD_DIR}\"\nfi\n\n# Build the framework for both device and simulator\nxcodebuild -project \"${PROJECT_NAME}.xcodeproj\" \\\n -scheme \"${FRAMEWORK_NAME}\" \\\n -configuration Release \\\n -arch arm64 only_active_arch=no \\\n -sdk \"iphoneos\" \\\n -derivedDataPath \"${BUILD_DIR}\"\n\nxcodebuild -project \"${PROJECT_NAME}.xcodeproj\" \\\n -scheme \"${FRAMEWORK_NAME}\" \\\n -configuration Release \\\n -arch x86_64 -arch arm64 only_active_arch=no \\\n -sdk \"iphonesimulator\" \\\n -derivedDataPath \"${BUILD_DIR}\"\n\n# Prepare output directory\nmkdir -p ${OUTPUT_DIR}\nif [ -d \"${OUTPUT_DIR}/${FRAMEWORK_NAME}.xcframework\" ]; then\n\trm -rf \"${OUTPUT_DIR}/${FRAMEWORK_NAME}.xcframework\"\nfi\n\nxcodebuild -create-xcframework \\\n\t-framework ${BUILD_DIR}/Build/Products/Release-iphoneos/${FRAMEWORK_NAME}.framework \\\n\t-framework ${BUILD_DIR}/Build/Products/Release-iphonesimulator/${FRAMEWORK_NAME}.framework \\\n\t-output $OUTPUT_DIR/${FRAMEWORK_NAME}.xcframework\n";
shellScript = "set -e\n\nFRAMEWORK_NAME=\"Mediasoup\"\nBUILD_DIR=\"${SRCROOT}/build/Mediasoup\"\nOUTPUT_DIR=\"${SRCROOT}/bin\"\n\n# Remove build directory if it exists\nif [ -d \"${BUILD_DIR}\" ]; then\n\trm -rf \"${BUILD_DIR}\"\nfi\n\n# Build the framework for both device and simulator\nxcodebuild -project \"${PROJECT_NAME}.xcodeproj\" \\\n -scheme \"${FRAMEWORK_NAME}\" \\\n -configuration Release \\\n -arch arm64 only_active_arch=no \\\n -sdk \"iphoneos\" \\\n -derivedDataPath \"${BUILD_DIR}\"\n\nxcodebuild -project \"${PROJECT_NAME}.xcodeproj\" \\\n -scheme \"${FRAMEWORK_NAME}\" \\\n -configuration Release \\\n -arch x86_64 -arch arm64 only_active_arch=no \\\n -sdk \"iphonesimulator\" \\\n -derivedDataPath \"${BUILD_DIR}\"\n \nxcodebuild -project \"${PROJECT_NAME}.xcodeproj\" \\\n -scheme \"${FRAMEWORK_NAME}\" \\\n -configuration Release \\\n -arch arm64 only_active_arch=no \\\n -sdk \"appletvos\" \\\n -derivedDataPath \"${BUILD_DIR}\"\n \nxcodebuild -project \"${PROJECT_NAME}.xcodeproj\" \\\n -scheme \"${FRAMEWORK_NAME}\" \\\n -configuration Release \\\n -arch x86_64 -arch arm64 only_active_arch=no \\\n -sdk \"appletvsimulator\" \\\n -derivedDataPath \"${BUILD_DIR}\"\n \n# Prepare output directory\nmkdir -p ${OUTPUT_DIR}\nif [ -d \"${OUTPUT_DIR}/${FRAMEWORK_NAME}.xcframework\" ]; then\n\trm -rf \"${OUTPUT_DIR}/${FRAMEWORK_NAME}.xcframework\"\nfi\n\nxcodebuild -create-xcframework \\\n\t-framework ${BUILD_DIR}/Build/Products/Release-iphoneos/${FRAMEWORK_NAME}.framework \\\n\t-framework ${BUILD_DIR}/Build/Products/Release-iphonesimulator/${FRAMEWORK_NAME}.framework \\\n\t-framework ${BUILD_DIR}/Build/Products/Release-appletvos/${FRAMEWORK_NAME}.framework \\\n -framework ${BUILD_DIR}/Build/Products/Release-appletvsimulator/${FRAMEWORK_NAME}.framework \\\n\t-output $OUTPUT_DIR/${FRAMEWORK_NAME}.xcframework\n";
};
/* End PBXShellScriptBuildPhase section */

Expand Down Expand Up @@ -640,12 +640,12 @@
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SDKROOT = iphoneos;
SKIP_INSTALL = YES;
SUPPORTED_PLATFORMS = "iphonesimulator iphoneos";
SUPPORTED_PLATFORMS = "appletvos appletvsimulator iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TARGETED_DEVICE_FAMILY = "1,2,3";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
Expand Down Expand Up @@ -737,11 +737,11 @@
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SDKROOT = iphoneos;
SKIP_INSTALL = YES;
SUPPORTED_PLATFORMS = "iphonesimulator iphoneos";
SUPPORTED_PLATFORMS = "appletvos appletvsimulator iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TARGETED_DEVICE_FAMILY = "1,2,3";
VALIDATE_PRODUCT = YES;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
Expand Down
4 changes: 4 additions & 0 deletions Mediasoup/Consumer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ public class Consumer {
consumer.close()
}

public func setJitterBufferMinimumDelay(seconds: Double) {
consumer.setJitterBufferMinimumDelay(seconds)
}

func getStats() throws -> String {
return try consumer.getStats()
}
Expand Down
6 changes: 5 additions & 1 deletion Mediasoup/dependencies/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,12 @@ if("${IOS_SDK}" STREQUAL "iphone")
set(CMAKE_OSX_SYSROOT "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/")
elseif("${IOS_SDK}" STREQUAL "iphonesimulator")
set(CMAKE_OSX_SYSROOT "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk")
elseif("${IOS_SDK}" STREQUAL "appletv")
set(CMAKE_OSX_SYSROOT "/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk")
elseif("${IOS_SDK}" STREQUAL "appletvsimulator")
set(CMAKE_OSX_SYSROOT "/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator.sdk")
else()
message(FATAL_ERROR "IOS_SDK must be set to iphone/iphonesimulator")
message(FATAL_ERROR "IOS_SDK must be set to iphone/iphonesimulator/appletv/appletvsimulator")
endif()

# set the ios architectures
Expand Down
2 changes: 2 additions & 0 deletions Mediasoup_Private/Consumer/ConsumerWrapper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ class ConsumerListenerAdapter;

- (void)close;

- (void)setJitterBufferMinimumDelay:(double)seconds;

- (NSString *_Nullable)getStatsWithError:(out NSError *__autoreleasing _Nullable *_Nullable)error;

@end
Expand Down
4 changes: 4 additions & 0 deletions Mediasoup_Private/Consumer/ConsumerWrapper.mm
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ - (void)close {
_consumer->Close();
}

- (void)setJitterBufferMinimumDelay:(double)seconds {
_consumer->GetRtpReceiver()->SetJitterBufferMinimumDelay(seconds);
}

- (NSString *_Nullable)getStatsWithError:(out NSError *__autoreleasing _Nullable *_Nullable)error {
return nil;
}
Expand Down
3 changes: 2 additions & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ let webrtcChecksum = "d6f5f751ca3aad5ba9e74896ba6e5a4869b3a50ac6def2a069357277d9
let package = Package(
name: "Mediasoup-Client-Swift",
platforms: [
.iOS(.v14)
.iOS(.v17),
.tvOS(.v17)
],
products: [
.library(
Expand Down
37 changes: 34 additions & 3 deletions bin/Mediasoup.xcframework/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,38 @@
<key>BinaryPath</key>
<string>Mediasoup.framework/Mediasoup</string>
<key>LibraryIdentifier</key>
<string>ios-arm64</string>
<string>ios-arm64_x86_64-simulator</string>
<key>LibraryPath</key>
<string>Mediasoup.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
<dict>
<key>BinaryPath</key>
<string>Mediasoup.framework/Mediasoup</string>
<key>LibraryIdentifier</key>
<string>ios-arm64_x86_64-simulator</string>
<string>tvos-arm64</string>
<key>LibraryPath</key>
<string>Mediasoup.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
</array>
<key>SupportedPlatform</key>
<string>tvos</string>
</dict>
<dict>
<key>BinaryPath</key>
<string>Mediasoup.framework/Mediasoup</string>
<key>LibraryIdentifier</key>
<string>tvos-arm64_x86_64-simulator</string>
<key>LibraryPath</key>
<string>Mediasoup.framework</string>
<key>SupportedArchitectures</key>
Expand All @@ -31,10 +48,24 @@
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<string>tvos</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
<dict>
<key>BinaryPath</key>
<string>Mediasoup.framework/Mediasoup</string>
<key>LibraryIdentifier</key>
<string>ios-arm64</string>
<key>LibraryPath</key>
<string>Mediasoup.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
</dict>
</array>
<key>CFBundlePackageType</key>
<string>XFWK</string>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#if 0
#elif defined(__arm64__) && __arm64__
// Generated by Apple Swift version 5.9 (swiftlang-5.9.0.128.108 clang-1500.0.40.1)
// Generated by Apple Swift version 6.0.3 effective-5.10 (swiftlang-6.0.3.1.10 clang-1600.0.30.1)
#ifndef MEDIASOUP_SWIFT_H
#define MEDIASOUP_SWIFT_H
#pragma clang diagnostic push
Expand Down Expand Up @@ -42,6 +42,8 @@
#include <string.h>
#endif
#if defined(__cplusplus)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wnon-modular-include-in-framework-module"
#if defined(__arm64e__) && __has_include(<ptrauth.h>)
# include <ptrauth.h>
#else
Expand All @@ -55,6 +57,7 @@
# endif
#pragma clang diagnostic pop
#endif
#pragma clang diagnostic pop
#endif

#if !defined(SWIFT_TYPEDEFS)
Expand Down Expand Up @@ -288,6 +291,7 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
#pragma clang diagnostic ignored "-Wunknown-pragmas"
#pragma clang diagnostic ignored "-Wnullability"
#pragma clang diagnostic ignored "-Wdollar-in-identifier-extension"
#pragma clang diagnostic ignored "-Wunsafe-buffer-usage"

#if __has_attribute(external_source_symbol)
# pragma push_macro("any")
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading