-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Implement an abstraction layer for WebRTC stack #39953
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
The code changes introduce an abstraction layer for the WebRTC stack, decoupling the application from the libdatachannel library. This involves creating abstract interfaces for WebRTCPeerConnection and WebRTCTrack, along with a factory function to create WebRTCPeerConnection instances. The changes also include modifications to the WebRTC provider manager and transport classes to use the new abstraction layer. The review identified opportunities to improve error handling, code clarity, and efficiency.
examples/camera-app/linux/include/media-controller/default-media-controller.h
Show resolved
Hide resolved
examples/camera-app/linux/src/clusters/webrtc-provider/webrtc-provider-manager.cpp
Show resolved
Hide resolved
PR #39953: Size comparison from 00aa48e to b129c14 Full report (72 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
0eb849e
to
58e4758
Compare
PR #39953: Size comparison from 7490ecc to 0000f3c Full report (72 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
std::shared_ptr<rtc::PeerConnection> mPeerConnection; | ||
std::shared_ptr<rtc::Track> mVideoTrack; | ||
std::shared_ptr<rtc::Track> mAudioTrack; | ||
std::shared_ptr<WebRTCPeerConnection> mPeerConnection; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these required to be shared_ptrs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will take care of this in a follow-up PR
Summary
The current WebRTC implementation is tightly coupled with the libdatachannel library. This means that rtc:: types (like rtc::PeerConnection and rtc::Track) are used directly throughout the WebRTC provider manager and transport classes.
If the system were to integrate a different WebRTC stack, it would require significant effort. This is because:
To mitigate this tight coupling, we need to introduce an abstraction layer for WebRTC APIs.
Related issues
N/A
Testing
Validated by the CI