I do not use the owt-server but write a simple nodejs version for test. (The server part should be irrelevant, since it only forwards signaling messages)
& Also due to only 1 android emulator there, i modified the p2p client sample code to let Activity contains 2 clients: one for publisher, the other consumer.
The key WebRTC signaling setup is:
publisher call createOffer to get SDP offer
publisher call preferCodecs to modify the SDP <--- HERE
publisher call setLocalDescription and then send SDP to consumer via signaling server
consumer receives SDP and call setRemoteDescription
The preferCodecs is very problematic, since it add 2 codecs for audio & video: ~/repo/open-webrtc-toolkit/owt-client-android/src/sdk/base/src/main/java/owt/base/PeerConnectionChannel.java
Note: I enable the WebRTC logging by Logging.enableLogToDebugOutput(Logging.Severity.LS_VERBOSE);, & AV1 codec needs added to ~/repo/open-webrtc-toolkit/owt-client-android/src/sdk/base/src/main/java/owt/base/MediaCodecs.java
The error log:
...
W/webrtc_sdp.cc: (line 3581): Ignore rtpmap line that did not appear in the <fmt> of the m-line: a=rtpmap:63 red/48000/2
E/webrtc_sdp.cc: (line 414): Failed to parse: "". Reason: Failed to parse audio codecs correctly.
So i remove the preferCodecs logic: ~/repo/open-webrtc-toolkit/owt-client-android/src/sdk/base/src/main/java/owt/base/PeerConnectionChannel.java
Due to networking limit, i cannot build OWT android sdk, so i use a prebuilt 3rd bundle: https://github.com/webrtc-sdk/android
I do not use the owt-server but write a simple nodejs version for test. (The server part should be irrelevant, since it only forwards signaling messages)
& Also due to only 1 android emulator there, i modified the p2p client sample code to let Activity contains 2 clients: one for publisher, the other consumer.
The key WebRTC signaling setup is:
The
preferCodecs
is very problematic, since it add 2 codecs for audio & video: ~/repo/open-webrtc-toolkit/owt-client-android/src/sdk/base/src/main/java/owt/base/PeerConnectionChannel.javaNote: I enable the WebRTC logging by
Logging.enableLogToDebugOutput(Logging.Severity.LS_VERBOSE);
, & AV1 codec needs added to ~/repo/open-webrtc-toolkit/owt-client-android/src/sdk/base/src/main/java/owt/base/MediaCodecs.javaThe error log:
So i remove the
preferCodecs
logic: ~/repo/open-webrtc-toolkit/owt-client-android/src/sdk/base/src/main/java/owt/base/PeerConnectionChannel.javaNow p2p connection is successful.