Skip to content

Commit

Permalink
Bump to libsrt up v1.5.3
Browse files Browse the repository at this point in the history
  • Loading branch information
shogo4405 committed Oct 14, 2023
1 parent c2e8952 commit 0cf61b1
Show file tree
Hide file tree
Showing 121 changed files with 21,146 additions and 3,843 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,6 @@ fastlane/report.xml
docs/docsets/HaishinKit.docset/Contents/Resources/Documents/undocumented.json
Vendor/SRT/OpenSSL/
Vendor/SRT/srt/
Vendor/SRT/Includes/
HaishinKit.json
SRTHaishinKit.json
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[![Swift Compatibility](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fshogo4405%2FHaishinKit.swift%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/shogo4405/HaishinKit.swift)
[![GitHub license](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://raw.githubusercontent.com/shogo4405/HaishinKit.swift/master/LICENSE.md)

* Camera and Microphone streaming library via RTMP, HLS and SRT for iOS, macOS, tvOS.
* Camera and Microphone streaming library via RTMP and SRT for iOS, macOS, tvOS.
* README.md contains unreleased content, which can be tested on the main branch.
* [API Documentation](https://shogo4405.github.io/HaishinKit.swift/documentation/haishinkit)

Expand Down Expand Up @@ -122,7 +122,7 @@ open HaishinKit.xcodeproj
|-|iOS|tvOS|macOS|visionOS|watchOS|
|:----|:----:|:----:|:----:|:----:|:----:|
|HaishinKit|12.0+|12.0+|10.13+|-|-|
|SRTHaishinKit|12.0+|-|-|-|-|
|SRTHaishinKit|12.0+|-|13.0+|-|-|

### Cocoa Keys
Please contains Info.plist.
Expand Down
17 changes: 7 additions & 10 deletions Vendor/SRT/build-xcframework.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ else
popd
fi

rm -rf Includes
mkdir Includes
cp srt/srtcore/*.h Includes

srt() {
Expand All @@ -39,25 +41,20 @@ srt_macosx() {

# macOS
srt_macosx macosx arm64
rm -f ./build/macosx/libsrt-lipo.a
libtool -static -o ./build/macosx/libsrt.a ./build/macosx/arm64/libsrt.a ./OpenSSL/macosx/lib/libcrypto.a ./OpenSSL/macosx/lib/libssl.a
libtool -static -o ./build/macosx/libsrt.a ./build/macosx/arm64/libsrt.a ./OpenSSL/macosx/lib/libcrypto.a ./OpenSSL/macosx/lib/libssl.a

# iOS
export IPHONEOS_DEPLOYMENT_TARGET=12.0
SDKVERSION=$(xcrun --sdk iphoneos --show-sdk-version)
srt iphonesimulator SIMULATOR64 x86_64
srt iphonesimulator SIMULATOR64 arm64
srt iphoneos OS arm64

rm -f ./build/SIMULATOR64/libsrt-lipo.a
lipo -create ./build/SIMULATOR64/arm64/libsrt.a ./build/SIMULATOR64/x86_64/libsrt.a -output ./build/SIMULATOR64/libsrt-lipo.a
libtool -static -o ./build/SIMULATOR64/libsrt.a ./build/SIMULATOR64/libsrt-lipo.a ./OpenSSL/iphonesimulator/lib/libcrypto.a ./OpenSSL/iphonesimulator/lib/libssl.a

rm -f ./build/OS/libsrt-lipo.a
lipo -create ./build/OS/arm64/libsrt.a -output ./build/OS/libsrt-lipo.a
libtool -static -o ./build/SIMULATOR64/arm64/libsrt.a ./OpenSSL/iphonesimulator/lib/libcrypto.a ./OpenSSL/iphonesimulator/lib/libssl.a
libtool -static -o ./build/OS/libsrt.a ./build/OS/libsrt-lipo.a ./OpenSSL/iphoneos/lib/libcrypto.a ./OpenSSL/iphoneos/lib/libssl.a

# make libsrt.xcframework
cp module.modulemap Includes/module.modulemap
cp ./build/OS/arm64/version.h Includes/version.h

rm -rf libsrt.xcframework
xcodebuild -create-xcframework \
-library ./build/SIMULATOR64/libsrt.a -headers Includes \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ written by
// CODE NOT IN USE 408: unused: no timeout predicted for listener callback
#define SRT_REJX_CONFLICT 1409 // The resource being accessed is already locked for modification. This is in case of m=publish and the specified resource is currently read-only.
// CODE NOT IN USE 410: unused: treated as a specific case of 404
// CODE NOT IN USE 411: unused: no reason to include lenght in the protocol
// CODE NOT IN USE 411: unused: no reason to include length in the protocol
// CODE NOT IN USE 412: unused: preconditions not predicted in AC
// CODE NOT IN USE 413: unused: AC size is already defined as 512
// CODE NOT IN USE 414: unused: AC size is already defined as 512
Expand Down
11 changes: 11 additions & 0 deletions Vendor/SRT/libsrt.xcframework/ios-arm64/Headers/api.h
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,15 @@ class CUDTSocket
/// to finish sending the data that were scheduled for sending so far.
void setClosed();

// This is necessary to be called from the group before the group clears
// the connection with the socket. As for managed groups (and there are
// currently no other group types), a socket disconnected from the group
// is no longer usable.
void setClosing()
{
core().m_bClosing = true;
}

/// This does the same as setClosed, plus sets the m_bBroken to true.
/// Such a socket can still be read from so that remaining data from
/// the receiver buffer can be read, but no longer sends anything.
Expand Down Expand Up @@ -447,6 +456,8 @@ class CUDTUnited
/// @param cfgSocket socket configuration.
/// @return tru if configurations match, false otherwise.
static bool channelSettingsMatch(const CSrtMuxerConfig& cfgMuxer, const CSrtConfig& cfgSocket);
static bool inet6SettingsCompat(const sockaddr_any& muxaddr, const CSrtMuxerConfig& cfgMuxer,
const sockaddr_any& reqaddr, const CSrtMuxerConfig& cfgSocket);

private:
std::map<int, CMultiplexer> m_mMultiplexer; // UDP multiplexer
Expand Down
Loading

0 comments on commit 0cf61b1

Please sign in to comment.