0

I am trying to create an application that uses webrtc data channels, to create a peer connection to an existing server. The client must run a native application on android (no Java of any kind, JNI might be acceptable though if it is the only way, that is not my choice it is a hard requirement on the project) while the server is running on windows.

The only problem is, I can not seems to find any minimal example that illustrates the steps to create one. By steps I mean Call method A, then Call method B then C and so on. Most of the examples are in JavaScript which is just a high-level overview of what needs to be done, it doesn't give enough information to translate it to C++.

The only example I can find was Example from webrtc which doesn't work at all, and crashes on the creation of the peer connection factory method, and after 2 days of debugging I found that the default parameters that were passed in, simply don't work (at least for Android).

So far I have a server when connected to (Through usual unix sockets) that automatically sends to me an SDP offer and 20 ICE candidates. how do I establish the connection after that? I do need to send an SDP Answer, and select Data Channel for communication, but I am not sure about the steps.

Kindly if you mark the question as Duplicate, please make sure the links in the duplicated Answer works, many of the old webrtc links are not reachable anymore.

Serilena
  • 66
  • 8
  • Did you see: https://groups.google.com/g/discuss-webrtc/c/XqlRMaQ9jxg/m/mIsszNU5AQAJ – Morrison Chang Sep 23 '22 at 08:46
  • @MorrisonChang AFAICS, the link it is related to the crash the person is having, but I don't have that problem (I already solved it) What I am looking for is just steps to create a peerconnection, the closest thing I am into, is actually the peer_connection_factory_interface.h file, which does have some explanations, but would really wish to have some code that I can see how that works. – Serilena Sep 23 '22 at 09:57
  • @Serilena In the example that you mentioned actually described the way how to get offer/answer/ICE and send to the other peer and receive from it as well. What exactly didn't work? – Artem Suprunov Nov 06 '22 at 23:56
  • @ArtemSuprunov Audio manager initialization is completely different from what is needed for windows or linux. You need a lot of extra work on top of that. if not, it crashes. – Serilena Nov 07 '22 at 14:20
  • @Serilena I think this method does all initialization including audio (encoders, decoders, device etc): https://chromium.googlesource.com/external/webrtc/+/HEAD/sdk/android/api/org/webrtc/PeerConnectionFactory.java#260 – Artem Suprunov Nov 07 '22 at 22:18

0 Answers0