Skip to content

Commit e6552eb

Browse files
authored
[Fix]Fallback to initial answer when failing to enable stereo (#874)
1 parent 03e5a68 commit e6552eb

File tree

7 files changed

+1
-545
lines changed

7 files changed

+1
-545
lines changed

Sources/StreamVideo/WebRTC/v2/PeerConnection/RTCPeerConnectionCoordinator.swift

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -772,27 +772,7 @@ class RTCPeerConnectionCoordinator: @unchecked Sendable {
772772
)
773773
)
774774

775-
var answer = try await createAnswer()
776-
777-
// Enable Stereo - Begin
778-
let sdpParser = SDPParser()
779-
let stereoEnableVisitor = StereoEnableVisitor()
780-
sdpParser.registerVisitor(stereoEnableVisitor)
781-
await sdpParser.parse(sdp: offerSdp)
782-
783-
if !stereoEnableVisitor.found.isEmpty {
784-
let sdpWriter = SDPWriter()
785-
let stereoEnableWriter = StereoEnableWriter(stereoEnableVisitor.found)
786-
sdpWriter.registerWriter(stereoEnableWriter)
787-
let modifiedAnswerSDP = await sdpWriter.write(sdp: answer.sdp)
788-
answer = .init(type: answer.type, sdp: modifiedAnswerSDP)
789-
log.debug(
790-
"Answer SDP has been modifier with enabled stereo for mid values:\(stereoEnableVisitor.found.keys.joined(separator: ","))",
791-
subsystems: .webRTC
792-
)
793-
}
794-
// Enable Stereo - End
795-
775+
let answer = try await createAnswer()
796776
try await setLocalDescription(answer)
797777

798778
try await sfuAdapter.sendAnswer(

Sources/StreamVideo/WebRTC/v2/SDP Parsing/Writer/SDPWriter.swift

Lines changed: 0 additions & 41 deletions
This file was deleted.

Sources/StreamVideo/WebRTC/v2/SDP Parsing/Writer/Writers/SDPLineWriter.swift

Lines changed: 0 additions & 12 deletions
This file was deleted.

Sources/StreamVideo/WebRTC/v2/SDP Parsing/Writer/Writers/StereoEnableWriter.swift

Lines changed: 0 additions & 66 deletions
This file was deleted.

StreamVideo.xcodeproj/project.pbxproj

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -398,11 +398,6 @@
398398
40916E782DA94A150061D860 /* Publisher+AsyncStream.swift in Sources */ = {isa = PBXBuildFile; fileRef = 40916E752DA94A150061D860 /* Publisher+AsyncStream.swift */; };
399399
409251772E05A75800DC0FB3 /* StereoEnableVisitor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 409251762E05A75800DC0FB3 /* StereoEnableVisitor.swift */; };
400400
4092517E2E05AFF000DC0FB3 /* MidStereoInformation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4092517C2E05AFBF00DC0FB3 /* MidStereoInformation.swift */; };
401-
4092517F2E05AFF500DC0FB3 /* StereoEnableWriter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 409251792E05AFB700DC0FB3 /* StereoEnableWriter.swift */; };
402-
409251812E05B00300DC0FB3 /* SDPLineWriter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 409251802E05B00300DC0FB3 /* SDPLineWriter.swift */; };
403-
409251852E05B03500DC0FB3 /* SDPWriter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 409251842E05B03500DC0FB3 /* SDPWriter.swift */; };
404-
4092518A2E05B11F00DC0FB3 /* StereoEnableVisitor_Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 409251892E05B11F00DC0FB3 /* StereoEnableVisitor_Tests.swift */; };
405-
4092518D2E05B40C00DC0FB3 /* StereoEnableWriter_Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4092518C2E05B40C00DC0FB3 /* StereoEnableWriter_Tests.swift */; };
406401
4093861A2AA09E4A00FF5AF4 /* MemoryLogDestination.swift in Sources */ = {isa = PBXBuildFile; fileRef = 409386192AA09E4A00FF5AF4 /* MemoryLogDestination.swift */; };
407402
4093861C2AA0A11500FF5AF4 /* LogQueue.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4093861B2AA0A11500FF5AF4 /* LogQueue.swift */; };
408403
4093861F2AA0A21800FF5AF4 /* MemoryLogViewer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4093861E2AA0A21800FF5AF4 /* MemoryLogViewer.swift */; };
@@ -1960,12 +1955,7 @@
19601955
40914C9B2B56AA6600F6A13E /* StreamBufferTransformerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StreamBufferTransformerTests.swift; sourceTree = "<group>"; };
19611956
40916E752DA94A150061D860 /* Publisher+AsyncStream.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Publisher+AsyncStream.swift"; sourceTree = "<group>"; };
19621957
409251762E05A75800DC0FB3 /* StereoEnableVisitor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StereoEnableVisitor.swift; sourceTree = "<group>"; };
1963-
409251792E05AFB700DC0FB3 /* StereoEnableWriter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StereoEnableWriter.swift; sourceTree = "<group>"; };
19641958
4092517C2E05AFBF00DC0FB3 /* MidStereoInformation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MidStereoInformation.swift; sourceTree = "<group>"; };
1965-
409251802E05B00300DC0FB3 /* SDPLineWriter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SDPLineWriter.swift; sourceTree = "<group>"; };
1966-
409251842E05B03500DC0FB3 /* SDPWriter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SDPWriter.swift; sourceTree = "<group>"; };
1967-
409251892E05B11F00DC0FB3 /* StereoEnableVisitor_Tests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StereoEnableVisitor_Tests.swift; sourceTree = "<group>"; };
1968-
4092518C2E05B40C00DC0FB3 /* StereoEnableWriter_Tests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StereoEnableWriter_Tests.swift; sourceTree = "<group>"; };
19691959
409386192AA09E4A00FF5AF4 /* MemoryLogDestination.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MemoryLogDestination.swift; sourceTree = "<group>"; };
19701960
4093861B2AA0A11500FF5AF4 /* LogQueue.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LogQueue.swift; sourceTree = "<group>"; };
19711961
4093861E2AA0A21800FF5AF4 /* MemoryLogViewer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MemoryLogViewer.swift; sourceTree = "<group>"; };
@@ -3701,7 +3691,6 @@
37013691
4061287F2CF32FE4007F5CDC /* SDP Parsing */ = {
37023692
isa = PBXGroup;
37033693
children = (
3704-
409251832E05B02900DC0FB3 /* Writer */,
37053694
409251822E05B02100DC0FB3 /* Parser */,
37063695
4092517B2E05AFBD00DC0FB3 /* Models */,
37073696
);
@@ -4176,15 +4165,6 @@
41764165
path = Extensions;
41774166
sourceTree = "<group>";
41784167
};
4179-
409251782E05AFB100DC0FB3 /* Writers */ = {
4180-
isa = PBXGroup;
4181-
children = (
4182-
409251802E05B00300DC0FB3 /* SDPLineWriter.swift */,
4183-
409251792E05AFB700DC0FB3 /* StereoEnableWriter.swift */,
4184-
);
4185-
path = Writers;
4186-
sourceTree = "<group>";
4187-
};
41884168
4092517B2E05AFBD00DC0FB3 /* Models */ = {
41894169
isa = PBXGroup;
41904170
children = (
@@ -4203,15 +4183,6 @@
42034183
path = Parser;
42044184
sourceTree = "<group>";
42054185
};
4206-
409251832E05B02900DC0FB3 /* Writer */ = {
4207-
isa = PBXGroup;
4208-
children = (
4209-
409251842E05B03500DC0FB3 /* SDPWriter.swift */,
4210-
409251782E05AFB100DC0FB3 /* Writers */,
4211-
);
4212-
path = Writer;
4213-
sourceTree = "<group>";
4214-
};
42154186
409251862E05B08000DC0FB3 /* Parser */ = {
42164187
isa = PBXGroup;
42174188
children = (
@@ -4221,14 +4192,6 @@
42214192
path = Parser;
42224193
sourceTree = "<group>";
42234194
};
4224-
409251872E05B08500DC0FB3 /* Writer */ = {
4225-
isa = PBXGroup;
4226-
children = (
4227-
4092518B2E05B3FE00DC0FB3 /* Writers */,
4228-
);
4229-
path = Writer;
4230-
sourceTree = "<group>";
4231-
};
42324195
409251882E05B09300DC0FB3 /* Models */ = {
42334196
isa = PBXGroup;
42344197
children = (
@@ -4237,14 +4200,6 @@
42374200
path = Models;
42384201
sourceTree = "<group>";
42394202
};
4240-
4092518B2E05B3FE00DC0FB3 /* Writers */ = {
4241-
isa = PBXGroup;
4242-
children = (
4243-
4092518C2E05B40C00DC0FB3 /* StereoEnableWriter_Tests.swift */,
4244-
);
4245-
path = Writers;
4246-
sourceTree = "<group>";
4247-
};
42484203
409386182AA09E3900FF5AF4 /* MemoryLogDestination */ = {
42494204
isa = PBXGroup;
42504205
children = (
@@ -4639,7 +4594,6 @@
46394594
isa = PBXGroup;
46404595
children = (
46414596
409251882E05B09300DC0FB3 /* Models */,
4642-
409251872E05B08500DC0FB3 /* Writer */,
46434597
409251862E05B08000DC0FB3 /* Parser */,
46444598
);
46454599
path = "SDP Parsing";
@@ -4648,7 +4602,6 @@
46484602
40B48C4D2D14F76A002C4EAB /* Visitors */ = {
46494603
isa = PBXGroup;
46504604
children = (
4651-
409251892E05B11F00DC0FB3 /* StereoEnableVisitor_Tests.swift */,
46524605
40B48C4B2D14F721002C4EAB /* RTPMapVisitorTests.swift */,
46534606
);
46544607
path = Visitors;
@@ -7628,7 +7581,6 @@
76287581
40382F2E2C88B87D00C2D00F /* ReflectiveStringConvertible.swift in Sources */,
76297582
4035AD732DE640F300F56FAB /* Task+DisposableBag.swift in Sources */,
76307583
40BBC48F2C623C6E002AEF92 /* StreamRTCPeerConnection+Events.swift in Sources */,
7631-
409251852E05B03500DC0FB3 /* SDPWriter.swift in Sources */,
76327584
40FF825F2D63532C0029AA80 /* Participants.swift in Sources */,
76337585
4013A8ED2D81E43E00F81C15 /* WebRTCCoordinator+Blocked.swift in Sources */,
76347586
40034C2C2CFE157300A318B1 /* CallKitAlwaysAvailabilityPolicy.swift in Sources */,
@@ -7721,7 +7673,6 @@
77217673
8490DD1F298D39D9007E53D2 /* JsonEventDecoder.swift in Sources */,
77227674
40FB15192BF77EE700D5E580 /* Call+Idle.swift in Sources */,
77237675
40ADB85C2D64B00E00B06AAF /* CGSize+Hashable.swift in Sources */,
7724-
4092517F2E05AFF500DC0FB3 /* StereoEnableWriter.swift in Sources */,
77257676
40E3633E2D09EF560028C52A /* CMVideoDimensions+DefaultValues.swift in Sources */,
77267677
40382F2B2C88B84800C2D00F /* Stream_Video_Sfu_Event_SfuEvent.OneOf_EventPayload+Payload.swift in Sources */,
77277678
40FB8FF82D661E2000F4390A /* String+OpenApiExtensions.swift in Sources */,
@@ -7880,7 +7831,6 @@
78807831
84DCA2152A38A79E000C3411 /* Token.swift in Sources */,
78817832
40FB151B2BF77EEE00D5E580 /* Call+JoiningStage.swift in Sources */,
78827833
402B34C02DCDEE9000574663 /* WebRTCUpdateSubscriptionsAdapter.swift in Sources */,
7883-
409251812E05B00300DC0FB3 /* SDPLineWriter.swift in Sources */,
78847834
40AB34E22C5E742400B5B6B3 /* Publisher+Logger.swift in Sources */,
78857835
40382F352C89A6C500C2D00F /* AudioSettings+Convenience.swift in Sources */,
78867836
840F59902A77FDCB00EF3EB2 /* UnpinRequest.swift in Sources */,
@@ -8356,7 +8306,6 @@
83568306
4065688A2E04275F00A67EAC /* IdleTimerAdapter_Tests.swift in Sources */,
83578307
84F58B7C29EE979F00010C4C /* VirtualTime.swift in Sources */,
83588308
40B3E5492DBBD2CA00DE8F50 /* SpeakerProximityPolicy_Tests.swift in Sources */,
8359-
4092518A2E05B11F00DC0FB3 /* StereoEnableVisitor_Tests.swift in Sources */,
83608309
40F0173E2BBEB86800E89FD1 /* TestsAuthenticationProvider.swift in Sources */,
83618310
401338762BF2489C007318BD /* MockCXCallController.swift in Sources */,
83628311
842747FC29EEECBA00E063AD /* AssertTestQueue.swift in Sources */,
@@ -8457,7 +8406,6 @@
84578406
40B48C2C2D14D0FF002C4EAB /* StreamVideoSfuModelsPublishOption_ConvenienceTests.swift in Sources */,
84588407
406B3C1C2C903A2B00FC93A1 /* MockVideoCapturerFactory.swift in Sources */,
84598408
84BB570E2A20D7BB0002C123 /* Mapping_Tests.swift in Sources */,
8460-
4092518D2E05B40C00DC0FB3 /* StereoEnableWriter_Tests.swift in Sources */,
84618409
8251E62F2A17BEEF00E7257A /* ImageFactory.swift in Sources */,
84628410
401C1EF02D493DCA00304609 /* OrderedCapacityQueueTests.swift in Sources */,
84638411
40E9B3B32BCD93AE00ACF18F /* JoinCallResponse+Dummy.swift in Sources */,

0 commit comments

Comments
 (0)