简体   繁体   English

iOS Swift WebRTC - 无法设置远程报价 sdp:无法设置远程视频描述发送参数

[英]iOS Swift WebRTC - Failed to set remote offer sdp: Failed to set remote video description send parameters

I am trying webRTC video call between iPhone devices.我正在尝试 iPhone 设备之间的 webRTC 视频通话。 One application is creating the offer SDP as below.一个应用程序正在创建报价 SDP,如下所示。 When i tried to set this SDP, am getting error in another application as当我尝试设置此 SDP 时,在另一个应用程序中出现错误

Error Domain=org.webrtc.RTCPeerConnection Code=-1 "Failed to set remote offer sdp: Failed to set remote video description send parameters."错误域=org.webrtc.RTCPeerConnection Code=-1“无法设置远程报价sdp:无法设置远程视频描述发送参数。” UserInfo={NSLocalizedDescription=Failed to set remote offer sdp: Failed to set remote video description send parameters.} UserInfo={NSLocalizedDescription=无法设置远程报价sdp:无法设置远程视频描述发送参数。}

Following is the code used to set the offer and create the answer.以下是用于设置报价和创建答案的代码。 The second line self.peerConnection?.setRemoteDescription throws error.第二行self.peerConnection?.setRemoteDescription抛出错误。

 let sessionDescription = RTCSessionDescription(type: .offer, sdp: remoteSdp)
        self.peerConnection?.setRemoteDescription(sessionDescription, completionHandler: { [weak self] (error) in
            guard let this = self else { return }
            if let error = error {
                this.delegate?.webrtcClient(client: this, didReceiveError: error)
            } else {
                this.handleRemoteDescriptionSet()
                // create answer
                peerConnection.answer(for: this.callConstraint, completionHandler:
                    { (sdp, error) in
                        if let error = error {
                            this.delegate?.webrtcClient(client: this, didReceiveError: error)
                        } else {
                            this.handleSdpGenerated(sdpDescription: sdp)
                        }
                })
            }
        })

Following is the Offer SDP format以下是Offer SDP格式

v=0

o=- 271054486825926104 2 IN IP4 127.0.0.1

s=-

t=0 0

a=group:BUNDLE video

a=msid-semantic: WMS ARDAMS

m=video 9 UDP/TLS/RTP/SAVPF 100 101 116 117 96

c=IN IP4 0.0.0.0

a=rtcp:9 IN IP4 0.0.0.0

a=ice-ufrag:mwCLNm7ZLzmDrtCu

a=ice-pwd:+alfGXoarzyKjISWRYAGyIH4

a=fingerprint:sha-256 44:0D:11:54:EC:62:CD:51:D0:E3:BB:A5:47:35:D1:27:48:4E:08:3B:AD:98:72:98:02:BA:06:C8:CC:12:0E:C0

a=setup:actpass

a=mid:video

a=extmap:2 urn:ietf:params:rtp-hdrext:toffset

a=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time

a=extmap:4 urn:3gpp:video-orientation

a=sendrecv

a=rtcp-mux

a=rtpmap:100 VP8/90000

a=rtcp-fb:100 ccm fir

a=rtcp-fb:100 nack

a=rtcp-fb:100 nack pli

a=rtcp-fb:100 goog-remb

a=rtpmap:101 VP9/90000

a=rtcp-fb:101 ccm fir

a=rtcp-fb:101 nack

a=rtcp-fb:101 nack pli

a=rtcp-fb:101 goog-remb

a=rtpmap:116 red/90000

a=rtpmap:117 ulpfec/90000

a=rtpmap:96 rtx/90000

a=fmtp:96 apt=100

a=ssrc-group:FID 1767367305 3714792746

a=ssrc:1767367305 cname:9wPGj45IHVxtvO6N

a=ssrc:1767367305 msid:ARDAMS ARDAMSv0

a=ssrc:1767367305 mslabel:ARDAMS

a=ssrc:1767367305 label:ARDAMSv0

a=ssrc:3714792746 cname:9wPGj45IHVxtvO6N

a=ssrc:3714792746 msid:ARDAMS ARDAMSv0

a=ssrc:3714792746 mslabel:ARDAMS

a=ssrc:3714792746 label:ARDAMSv0

There is no candidate in your offer sdp.您的报价 sdp 中没有候选人 In your sdp generation you have to wait to generate candidate.在您的 sdp 生成中,您必须等待生成候选对象。 you can generate all candidate at one time , or gather it incrementally .您可以一次生成所有候选人,也可以逐步收集 Anyway i didn't see any ice candidate exchange.无论如何,我没有看到任何冰候选人交流。 Maybe check some open source project.也许检查一些开源项目。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM