Unity-Technologies / com.unity.webrtc

WebRTC package for Unity
Other
738 stars 185 forks source link

fix: Create an empty candidate instance #988

Open karasusan opened 9 months ago

FabienDanieau commented 8 months ago

I have a new bug with this branch which I don't with pre-6.

ArgumentException: sdp is null or empty
  at Unity.WebRTC.RTCPeerConnection.SetLocalDescription (Unity.WebRTC.RTCSessionDescription& desc) [0x00027] in .\Library\PackageCache\com.unity.webrtc@3dddb5c3b6\Runtime\Scripts\RTCPeerConnection.cs:674 
  at WebRTCBase+<WebRTCGotOffer>d__24.MoveNext () [0x000c3] in C:\Users\Demo\Dev\WebRTC_Unity\Assets\Scripts\WebRTC\WebRTCBase.cs:227 
  at UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) [0x00026] in <56073df97ede4f769c2cc45d546d986d>:0 

(Filename: ./Library/PackageCache/com.unity.webrtc@3dddb5c3b6/Runtime/Scripts/RTCPeerConnection.cs Line: 674)
karasusan commented 8 months ago

@FabienDanieau SetLocalDescription throws the exception if the candidate is empty. Should this class ignores the sdp which has an empty candidate?

FabienDanieau commented 8 months ago

That's the message I receive from which I get the SDP.

{"type":"peer","sessionId":"be442724-9922-426b-bcd6-1b5cc5029b68","sdp":{"type":"offer","sdp":"v=0\r\no=- 3905918907 3905918907 IN IP4 0.0.0.0\r\ns=-\r\nt=0 0\r\na=group:BUNDLE 0 1\r\na=msid-semantic:WMS *\r\nm=video 57901 UDP/TLS/RTP/SAVPF 97 98 99 100\r\nc=IN IP4 10.0.0.105\r\na=sendrecv\r\na=extmap:1 urn:ietf:params:rtp-hdrext:sdes:mid\r\na=extmap:2 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time\r\na=mid:0\r\na=msid:eeb5809c-518a-47ee-a044-ebda1bef1a0d left\r\na=rtcp:9 IN IP4 0.0.0.0\r\na=rtcp-mux\r\na=ssrc-group:FID 1203755168 2621529188\r\na=ssrc:1203755168 cname:6b730837-1159-421d-808a-b5e2e9aa5b93\r\na=ssrc:2621529188 cname:6b730837-1159-421d-808a-b5e2e9aa5b93\r\na=rtpmap:97 H264/90000\r\na=rtcp-fb:97 nack\r\na=rtcp-fb:97 nack pli\r\na=rtcp-fb:97 goog-remb\r\na=fmtp:97 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42001f\r\na=rtpmap:98 rtx/90000\r\na=fmtp:98 apt=97\r\na=rtpmap:99 H264/90000\r\na=rtcp-fb:99 nack\r\na=rtcp-fb:99 nack pli\r\na=rtcp-fb:99 goog-remb\r\na=fmtp:99 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f\r\na=rtpmap:100 rtx/90000\r\na=fmtp:100 apt=99\r\na=candidate:2a7a19bd332bc64d904fba85851b1efd 1 udp 2130706431 10.0.0.105 57901 typ host\r\na=candidate:580b5f32035da7f14a30ea7a8d826c67 1 udp 2130706431 172.17.0.1 46869 typ host\r\na=candidate:0ad8db753210ce9554cf251a9e51e792 1 udp 1694498815 89.90.112.99 26075 typ srflx raddr 172.17.0.1 rport 46869\r\na=candidate:0229d315f377a86e03062c2be76274d1 1 udp 1694498815 89.90.112.99 26076 typ srflx raddr 10.0.0.105 rport 57901\r\na=end-of-candidates\r\na=ice-ufrag:hqKk\r\na=ice-pwd:8LJoMbTHmCcoUuINAdmwDu\r\na=fingerprint:sha-256 F5:59:20:9A:8F:2C:C6:FF:16:3B:C6:12:50:8F:8E:AA:97:F8:03:54:6B:80:99:1A:32:87:C2:13:FB:6A:F8:E7\r\na=setup:actpass\r\nm=video 44499 UDP/TLS/RTP/SAVPF 97 98 99 100\r\nc=IN IP4 10.0.0.105\r\na=sendrecv\r\na=extmap:1 urn:ietf:params:rtp-hdrext:sdes:mid\r\na=extmap:2 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time\r\na=mid:1\r\na=msid:eeb5809c-518a-47ee-a044-ebda1bef1a0d right\r\na=rtcp:9 IN IP4 0.0.0.0\r\na=rtcp-mux\r\na=ssrc-group:FID 229827020 3346325686\r\na=ssrc:229827020 cname:6b730837-1159-421d-808a-b5e2e9aa5b93\r\na=ssrc:3346325686 cname:6b730837-1159-421d-808a-b5e2e9aa5b93\r\na=rtpmap:97 H264/90000\r\na=rtcp-fb:97 nack\r\na=rtcp-fb:97 nack pli\r\na=rtcp-fb:97 goog-remb\r\na=fmtp:97 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42001f\r\na=rtpmap:98 rtx/90000\r\na=fmtp:98 apt=97\r\na=rtpmap:99 H264/90000\r\na=rtcp-fb:99 nack\r\na=rtcp-fb:99 nack pli\r\na=rtcp-fb:99 goog-remb\r\na=fmtp:99 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f\r\na=rtpmap:100 rtx/90000\r\na=fmtp:100 apt=99\r\na=candidate:2a7a19bd332bc64d904fba85851b1efd 1 udp 2130706431 10.0.0.105 44499 typ host\r\na=candidate:580b5f32035da7f14a30ea7a8d826c67 1 udp 2130706431 172.17.0.1 50178 typ host\r\na=candidate:0ad8db753210ce9554cf251a9e51e792 1 udp 1694498815 89.90.112.99 33317 typ srflx raddr 172.17.0.1 rport 50178\r\na=candidate:0229d315f377a86e03062c2be76274d1 1 udp 1694498815 89.90.112.99 33316 typ srflx raddr 10.0.0.105 rport 44499\r\na=end-of-candidates\r\na=ice-ufrag:G9KA\r\na=ice-pwd:9RlIuCyw1raEwVSpoKvQdx\r\na=fingerprint:sha-256 F5:59:20:9A:8F:2C:C6:FF:16:3B:C6:12:50:8F:8E:AA:97:F8:03:54:6B:80:99:1A:32:87:C2:13:FB:6A:F8:E7\r\na=setup:actpass\r\n"}}

FabienDanieau commented 8 months ago

Hmm I should build the native plugin right? image

karasusan commented 8 months ago

@FabienDanieau Try this. https://drive.google.com/file/d/1--4gR8iwH6srA2A6CgeCv5SCFCdmQf8f/view?usp=sharing

karasusan commented 8 months ago

@FabienDanieau I'm glad to hear that. However, we'll have to test more for this change. Currently, we are testing for the release for this month, it's difficult to put this change into it.

FabienDanieau commented 8 months ago

No worries I've a local workaround. Thanks!