Skip to content

Commit

Permalink
Merge branch 'LD-5065-vp9-svc'
Browse files Browse the repository at this point in the history
  • Loading branch information
fedulvtubudul committed Jan 22, 2024
2 parents 30d41bf + 4735d61 commit 75678a8
Show file tree
Hide file tree
Showing 54 changed files with 7,745 additions and 232 deletions.
4 changes: 2 additions & 2 deletions Example/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PODS:
- Mediasoup-Client-Swift (0.7.0)
- Mediasoup-Client-Swift (0.8.0)

DEPENDENCIES:
- Mediasoup-Client-Swift (from `../`)
Expand All @@ -9,7 +9,7 @@ EXTERNAL SOURCES:
:path: "../"

SPEC CHECKSUMS:
Mediasoup-Client-Swift: e8f187c336f948d8e865a198c85c02a1900a9455
Mediasoup-Client-Swift: c6c318be2f5940a25eac32ee983840603de7a56e

PODFILE CHECKSUM: d4fe3294dd9c7fc46519b6a7b26527f1f545e8d3

Expand Down
2 changes: 1 addition & 1 deletion Mediasoup-Client-Swift.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Pod::Spec.new do |spec|
}

spec.name = "Mediasoup-Client-Swift"
spec.version = "0.7.0"
spec.version = "0.8.0"
spec.platform = :ios, "14.0"
spec.module_name = "Mediasoup"
spec.module_map = "Mediasoup/Mediasoup.modulemap"
Expand Down
44 changes: 44 additions & 0 deletions Mediasoup.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,16 @@
FFCD791827F419E800D26B4C /* mediasoupclient.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = FFCD791727F419E800D26B4C /* mediasoupclient.xcframework */; };
FFCD791D27F41A0900D26B4C /* sdptransform.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = FFCD791B27F41A0900D26B4C /* sdptransform.xcframework */; };
FFCD791F27F41A0900D26B4C /* WebRTC.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = FFCD791C27F41A0900D26B4C /* WebRTC.xcframework */; };
FFF004F92B592424007BA500 /* RTPParameters.swift in Sources */ = {isa = PBXBuildFile; fileRef = FFF004F82B592424007BA500 /* RTPParameters.swift */; };
FFF004FB2B5986F6007BA500 /* ScalabilityMode.swift in Sources */ = {isa = PBXBuildFile; fileRef = FFF004FA2B5986F6007BA500 /* ScalabilityMode.swift */; };
FFF004FF2B598D59007BA500 /* ScalabilityMode.h in Headers */ = {isa = PBXBuildFile; fileRef = FFF004FE2B59881C007BA500 /* ScalabilityMode.h */; settings = {ATTRIBUTES = (Private, ); }; };
FFF005002B599102007BA500 /* ScalabilityMode.mm in Sources */ = {isa = PBXBuildFile; fileRef = FFF004FC2B598806007BA500 /* ScalabilityMode.mm */; };
FFF005022B5A2968007BA500 /* WrappedRTPParameters.hpp in Headers */ = {isa = PBXBuildFile; fileRef = FFF005012B5A2832007BA500 /* WrappedRTPParameters.hpp */; settings = {ATTRIBUTES = (Private, ); }; };
FFF005042B5A29B6007BA500 /* WrappedRTPParameters.mm in Sources */ = {isa = PBXBuildFile; fileRef = FFF005032B5A29B6007BA500 /* WrappedRTPParameters.mm */; };
FFF005072B5A4304007BA500 /* WrappedRTPParameters+Internal.mm in Sources */ = {isa = PBXBuildFile; fileRef = FFF005062B5A4304007BA500 /* WrappedRTPParameters+Internal.mm */; };
FFF0050B2B5A62FD007BA500 /* RTPEncodingParameters.mm in Sources */ = {isa = PBXBuildFile; fileRef = FFF0050A2B5A62FD007BA500 /* RTPEncodingParameters.mm */; };
FFF0050D2B5A631D007BA500 /* RTPEncodingParameters+Internal.mm in Sources */ = {isa = PBXBuildFile; fileRef = FFF0050C2B5A631D007BA500 /* RTPEncodingParameters+Internal.mm */; };
FFF0050E2B5A641C007BA500 /* RTPEncodingParameters.hpp in Headers */ = {isa = PBXBuildFile; fileRef = FFF005082B5A6192007BA500 /* RTPEncodingParameters.hpp */; settings = {ATTRIBUTES = (Private, ); }; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
Expand Down Expand Up @@ -143,6 +153,18 @@
FFCD791727F419E800D26B4C /* mediasoupclient.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = mediasoupclient.xcframework; path = bin/mediasoupclient.xcframework; sourceTree = "<group>"; };
FFCD791B27F41A0900D26B4C /* sdptransform.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = sdptransform.xcframework; path = bin/sdptransform.xcframework; sourceTree = "<group>"; };
FFCD791C27F41A0900D26B4C /* WebRTC.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = WebRTC.xcframework; path = bin/WebRTC.xcframework; sourceTree = "<group>"; };
FFF004F82B592424007BA500 /* RTPParameters.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RTPParameters.swift; sourceTree = "<group>"; };
FFF004FA2B5986F6007BA500 /* ScalabilityMode.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ScalabilityMode.swift; sourceTree = "<group>"; };
FFF004FC2B598806007BA500 /* ScalabilityMode.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = ScalabilityMode.mm; sourceTree = "<group>"; };
FFF004FE2B59881C007BA500 /* ScalabilityMode.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ScalabilityMode.h; sourceTree = "<group>"; };
FFF005012B5A2832007BA500 /* WrappedRTPParameters.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = WrappedRTPParameters.hpp; sourceTree = "<group>"; };
FFF005032B5A29B6007BA500 /* WrappedRTPParameters.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = WrappedRTPParameters.mm; sourceTree = "<group>"; };
FFF005052B5A332F007BA500 /* WrappedRTPParameters+Internal.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = "WrappedRTPParameters+Internal.hpp"; sourceTree = "<group>"; };
FFF005062B5A4304007BA500 /* WrappedRTPParameters+Internal.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = "WrappedRTPParameters+Internal.mm"; sourceTree = "<group>"; };
FFF005082B5A6192007BA500 /* RTPEncodingParameters.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = RTPEncodingParameters.hpp; sourceTree = "<group>"; };
FFF005092B5A62B0007BA500 /* RTPEncodingParameters+Internal.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = "RTPEncodingParameters+Internal.hpp"; sourceTree = "<group>"; };
FFF0050A2B5A62FD007BA500 /* RTPEncodingParameters.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = RTPEncodingParameters.mm; sourceTree = "<group>"; };
FFF0050C2B5A631D007BA500 /* RTPEncodingParameters+Internal.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = "RTPEncodingParameters+Internal.mm"; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -214,6 +236,8 @@
FF7FA6C327FD5ECD000B6470 /* Transport.swift */,
FFC5AC71282500A500C92A96 /* TransportConnectionState.swift */,
FF7FA6C127FD5EA5000B6470 /* TransportDelegate.swift */,
FFF004F82B592424007BA500 /* RTPParameters.swift */,
FFF004FA2B5986F6007BA500 /* ScalabilityMode.swift */,
);
path = Mediasoup;
sourceTree = "<group>";
Expand Down Expand Up @@ -246,6 +270,14 @@
FF7FA6CB27FE9681000B6470 /* ProducerWrapper.hpp */,
FF7FA6C927FE9674000B6470 /* ProducerWrapper.mm */,
FF7FA6D127FF1755000B6470 /* ProducerWrapperDelegate.h */,
FFF005082B5A6192007BA500 /* RTPEncodingParameters.hpp */,
FFF0050A2B5A62FD007BA500 /* RTPEncodingParameters.mm */,
FFF005092B5A62B0007BA500 /* RTPEncodingParameters+Internal.hpp */,
FFF0050C2B5A631D007BA500 /* RTPEncodingParameters+Internal.mm */,
FFF005012B5A2832007BA500 /* WrappedRTPParameters.hpp */,
FFF005032B5A29B6007BA500 /* WrappedRTPParameters.mm */,
FFF005052B5A332F007BA500 /* WrappedRTPParameters+Internal.hpp */,
FFF005062B5A4304007BA500 /* WrappedRTPParameters+Internal.mm */,
);
path = Producer;
sourceTree = "<group>";
Expand All @@ -264,6 +296,8 @@
FFC5AC732825025100C92A96 /* MediasoupClientTransportConnectionState.mm */,
FF89EFD127F5C97000EEF5CD /* MediasoupClientError */,
FF89EFD227F5C99C00EEF5CD /* Device */,
FFF004FC2B598806007BA500 /* ScalabilityMode.mm */,
FFF004FE2B59881C007BA500 /* ScalabilityMode.h */,
);
path = Mediasoup_Private;
sourceTree = "<group>";
Expand Down Expand Up @@ -325,11 +359,14 @@
FFB7DDBB28228BE400FE2CC2 /* ReceiveTransportWrapperDelegate.h in Headers */,
FFB7DDB828228ABA00FE2CC2 /* ReceiveTransportWrapper.hpp in Headers */,
FF1E63582A5655830022A44A /* DataConsumerWrapper.hpp in Headers */,
FFF004FF2B598D59007BA500 /* ScalabilityMode.h in Headers */,
FF89EFC027F462F200EEF5CD /* MediasoupClientError.h in Headers */,
FF7FA6A027FAAEF2000B6470 /* SendTransportWrapper.hpp in Headers */,
FF7FA6BD27FB0FB7000B6470 /* SendTransportWrapperDelegate.h in Headers */,
FF7FA6A427FAB838000B6470 /* SendTransportListenerAdapter.hpp in Headers */,
FFF0050E2B5A641C007BA500 /* RTPEncodingParameters.hpp in Headers */,
FF7FA6D427FF1A08000B6470 /* ProducerWrapperDelegate.h in Headers */,
FFF005022B5A2968007BA500 /* WrappedRTPParameters.hpp in Headers */,
FFB7DDBF28229BC100FE2CC2 /* ConsumerWrapperDelegate.h in Headers */,
FF7FA6CE27FE9A4B000B6470 /* ProducerWrapper.hpp in Headers */,
FF1E635B2A5655830022A44A /* DataConsumerWrapperDelegate.h in Headers */,
Expand Down Expand Up @@ -452,7 +489,10 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
FFF005042B5A29B6007BA500 /* WrappedRTPParameters.mm in Sources */,
FFF004FB2B5986F6007BA500 /* ScalabilityMode.swift in Sources */,
FFB7DDB32822893C00FE2CC2 /* ReceiveTransportDelegate.swift in Sources */,
FFF005072B5A4304007BA500 /* WrappedRTPParameters+Internal.mm in Sources */,
FFC5AC782825170500C92A96 /* ConsumerWrapper.mm in Sources */,
FFB7DDB12822891C00FE2CC2 /* ReceiveTransport.swift in Sources */,
FFC2452127F6E8DF008F61DE /* MediaKind.swift in Sources */,
Expand All @@ -461,8 +501,12 @@
FF7FA6C227FD5EA5000B6470 /* TransportDelegate.swift in Sources */,
FFB7DDC3282398A500FE2CC2 /* ReceiveTransportListenerAdapter.mm in Sources */,
FF7FA6A227FAB803000B6470 /* SendTransportListenerAdapter.mm in Sources */,
FFF005002B599102007BA500 /* ScalabilityMode.mm in Sources */,
FFC2452427F6E9DB008F61DE /* MediasoupClientMediaKind.mm in Sources */,
FFF004F92B592424007BA500 /* RTPParameters.swift in Sources */,
FF7FA6CA27FE9674000B6470 /* ProducerWrapper.mm in Sources */,
FFF0050D2B5A631D007BA500 /* RTPEncodingParameters+Internal.mm in Sources */,
FFF0050B2B5A62FD007BA500 /* RTPEncodingParameters.mm in Sources */,
FFC5AC72282500A500C92A96 /* TransportConnectionState.swift in Sources */,
FF7FA69A27FAACEE000B6470 /* SendTransportWrapper.mm in Sources */,
FF7FA69527FAA930000B6470 /* SendTransport.swift in Sources */,
Expand Down
26 changes: 26 additions & 0 deletions Mediasoup/Producer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,40 +6,50 @@ import WebRTC
public class Producer {
public weak var delegate: ProducerDelegate?

/// The audio or video track being transmitted.
public var track: RTCMediaStreamTrack {
return producer.track
}

/// Producer identifier (matches server-side producer id).
public var id: String {
return producer.id
}

/// Local producer identifier.
public var localId: String {
return producer.localId
}

/// Whether the producer is closed.
public var closed: Bool {
return producer.closed
}

/// Whether the producer is paused.
public var paused: Bool {
return producer.paused
}

/// The media kind ("audio" or "video").
public let kind: MediaKind

/// In case of simulcast, this value determines the highest stream (from 0 to N-1) being transmitted. See the `setMaxSpatialLayer` method for more about this.
public var maxSpatialLayer: UInt8 {
return producer.maxSpatialLayer
}

/// Custom data Object provided by the application in the producer factory method. The app can modify its content at any time.
public var appData: String {
return producer.appData
}

/// Producer RTP parameters. These parameters are internally built by the library and conform to the syntax and requirements of mediasoup, thus they can be transmitted to the server to invoke transport.produce() with them.
public var rtpParameters: String {
return producer.rtpParameters
}

/// Gets the local RTP sender statistics by calling getStats() in the underlying RTCRtpSender instance.
public var stats: String {
return producer.stats
}
Expand All @@ -52,29 +62,45 @@ public class Producer {
producer.delegate = self
}

/// Pauses the producer (no RTP is sent to the server). This method should be called when the server side producer has been paused (and vice-versa).
public func pause() {
producer.pause()
}

/// Resumes the producer (RTP is sent again to the server). This method should be called when the server side producer has been resumed (and vice-versa).
public func resume() {
producer.resume()
}

/// Closes the producer. No more media is transmitted. This method should be called when the server side producer has been closed (and vice-versa).
public func close() {
producer.close()
}

/// In case of simulcast, this method limits the highest RTP stream being transmitted to the server.
/// - Parameter layer: The index of the entry in encodings representing the highest RTP stream that will be transmitted.
public func setMaxSpatialLayer(_ layer: Int) throws {
guard let typedLayer = UInt8(exactly: layer) else {
throw MediasoupError.invalidParameters("Layer index can not be negative")
}
try producer.setMaxSpatialLayer(typedLayer)
}

public func updateSenderParameters(_ updater: @escaping (RTPParameters) -> RTPParameters) {
producer.updateRTPParameters({ oldValue in
let updatedValue = updater(RTPParameters(from: oldValue))
return updatedValue.wrappedValue
})
}

/// Replaces the audio or video track being transmitted. No negotiation with the server is needed.
/// - Parameter track: An audio or video track.
public func replaceTrack(_ track: RTCMediaStreamTrack) throws {
try producer.replaceTrack(track)
}

/// Gets the local RTP sender statistics by calling getStats() in the underlying RTCRtpSender instance.
/// - Returns: RTCStatsReport object serialized to JSON. See https://w3c.github.io/webrtc-pc/#dom-rtcstatsreport for format description.
public func getStats() throws -> String {
return try producer.getStats()
}
Expand Down
Loading

0 comments on commit 75678a8

Please sign in to comment.