Integrating NVidia provided libwebrtc library into C++ application

Hi all,

Does anyone have advice on what to look out for when integrating libwebrtc.a? Is there a guide to integrating the provided libwebrtc library into an application?

I’ve been working on integrating the provided libwebrtc.a library into my linux C++ application. I’ve been able to integrate it to the point where I can create and accept offers/answers, and create a data channel and video channels for my rtsp video sources.

Where my integration falls short is that it’s unable to renegotiate call details (ie adding new data or video channels), and I cannot add ice candidates to my peer connection. In both of these situations the application will segfault within the libwebrtc code. My code largely follows the example provided in google’s source code examples.

To be more specific, when crashing from adding an ICE candidate the stack trace is: webrtc::PeerConnection::AddIceCandidate(webrtc::IceCandidateInterface const)->webrtc::PeerConnection::ReadyToUseRemoteCandidate(webrtc::IceCandidateInterface const*, webrtc::SessionDescriptionInterface const*, bool*)->webrtc::PeerConnection::FindContentInfo(webrtc::SessionDescriptionInterface const*, webrtc::IceCandidateInterface const*)

After including libwebrtc in my project I had to fix some include paths and deal with missing preprocessor definitions in the provided headers (ie add #define WEBRTC_POSIX in a few select spots). Aside from that the libwebrtc headers are as provided. I’ve also had to include libraries -ldl and -lX11 when building my application for the Jetson. My application specifies use of c++17. Articles by Dr Alex G have been useful in this pursuit.

Has anyone else run into similar issues? Could I be forgetting a step when bringing in libwebrtc?

Any help or resources would be greatly appreciated.

Cheers!

1 Like

Hi,
For WebRTC, we have the package:
Jetson Linux R32.7.2 Release Page | NVIDIA Developer

NVIDIA Hardware Acceleration in the WebRTC Framework

Please check the guidance and see if it can be integrated into your use-case.

Thank you for responding DaneLLL, that package has been instrumental to helping me get webrtc working as well as it is in my application.

Is there any chance that the provided binaries (peerconnection_client and peerconnection_server in particular) have shareable source code? I would like to reference it to ensure my implementation of the provided webrtc library is sound. I will reiterate that I have been using this package and have it working in my application aside from crashes when adding ICE candidates and renegotiating call details between peers.

Following up;

I was able to solve my issues by compiling libwebrtc with debug symbols for my local environment. I had been using some of the smart pointers created by the webrtc library incorrectly when setting local/remote descriptions. This was the root cause of other crashes and issues I was seeing. Referencing the unit tests and example source code from the libwebrtc project (linked in original question) was helpful here.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.