feat: Migrate WebRTC package namespace from org.webrtc to io.getstream.webrtc#1620
feat: Migrate WebRTC package namespace from org.webrtc to io.getstream.webrtc#1620PratimMallick wants to merge 12 commits intodevelop-v2from
Conversation
…amespace = "io.getstream.webrtc" instead of "org.webrtc"
…shing the repackaged webrtc
…m-video-android into repackaged_webrtc_branch # Conflicts: # build.gradle.kts
…nto repackaged_webrtc_branch # Conflicts: # build.gradle.kts # demo-app/src/main/kotlin/io/getstream/video/android/util/StreamVideoInitHelper.kt # stream-video-android-core/api/stream-video-android-core.api # stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/call/RtcSession.kt # stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/call/video/FilterVideoProcessor.kt # stream-video-android-core/src/test/kotlin/io/getstream/video/android/core/rtc/RtcSessionTest2.kt
…d into repackaged_webrtc_branch # Conflicts: # stream-video-android-core/build.gradle.kts
PR checklist ✅All required conditions are satisfied:
🎉 Great job! This PR is ready for review. |
|
Caution Review failedFailed to post review comments WalkthroughThis PR replaces Twilio's AudioSwitch library with a custom audio management system, migrates WebRTC dependencies from org.webrtc to io.getstream.webrtc packages, updates Bluetooth permission handling, and refactors audio device selection logic using new AudioDeviceManager interface with API-specific implementations. Changes
Sequence Diagram(s)sequenceDiagram
participant App as Application
participant MediaMgr as MediaManager
participant AudioSwitch as StreamAudioSwitch
participant AudioDevMgr as AudioDeviceManager<br/>(Modern/Legacy)
participant AudioMgr as Android AudioManager
App->>MediaMgr: Initialize audio
MediaMgr->>MediaMgr: Create preferredDeviceList
MediaMgr->>AudioSwitch: new StreamAudioSwitch(context, preferredDeviceList)
MediaMgr->>AudioSwitch: start(listener)
AudioSwitch->>AudioDevMgr: Delegate to appropriate implementation
AudioDevMgr->>AudioMgr: Query available devices
AudioMgr-->>AudioDevMgr: Return AudioDeviceInfo list
AudioDevMgr-->>AudioSwitch: Return StreamAudioDevice list
AudioSwitch-->>MediaMgr: onDeviceSelected callback
App->>MediaMgr: selectDevice(StreamAudioDevice)
MediaMgr->>AudioSwitch: selectDevice(device)
AudioSwitch->>AudioDevMgr: selectDevice(device)
AudioDevMgr->>AudioMgr: setCommunicationDevice (API 31+) or manage SCO (API 24-30)
AudioMgr-->>AudioDevMgr: Success/Failure
AudioDevMgr-->>AudioSwitch: Update selected device state
AudioSwitch-->>MediaMgr: Invoke onDeviceSelected callback
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Tip Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
SDK Size Comparison 📏
|
|
| replace_string_in_directory( | ||
| directory_path=project_root, | ||
| search_string="org.webrtc", | ||
| search_string="io.getstream.webrtc", |
There was a problem hiding this comment.
Both repackage scripts now replace io.getstream.webrtc with io.getstream.webrtc — same string. Are these scripts still needed, or can they be removed now that the repackaging is handled by the pre-built artifact?
| ituDate = { group = "com.ethlo.time", name = "itu", version.ref = "itu" } | ||
|
|
||
| stream-webrtc = { group = "io.getstream", name = "stream-video-webrtc-android", version.ref = "streamWebRTC" } | ||
| stream-webrtc = { group = "io.getstream", name = "stream-video-webrtc-android-repackaged", version.ref = "streamWebRTC" } |
There was a problem hiding this comment.
The dependency points to stream-video-webrtc-android-repackaged on Maven, but there's also a libs/libwebrtc_repackaged.aar binary committed to git. Shall we remove the AAR?
aleksandar-apostolov
left a comment
There was a problem hiding this comment.
LGTM — clean namespace migration. Left two questions about the repackage scripts and the local AAR.
aleksandar-apostolov
left a comment
There was a problem hiding this comment.
LGTM — clean namespace migration. Left two questions about the repackage scripts and the local AAR.


Goal
This PR replaces the upstream WebRTC dependency (
org.webrtc) with a repackaged version published under theio.getstream.webrtcnamespace.Implementation
io.getstream:stream-video-webrtc-androidwithio.getstream:stream-video-webrtc-android-repackaged(v137.1.1)org.webrtc.*→io.getstream.webrtc.*the new namespace
streamNoiseCancellationfrom1.0.4→2.0.0(having the same repackaged webrtc)build.gradle.kts): Updated class filter fromorg.webrtc.**→io.getstream.webrtc.**consumer-proguard-rules.pro): Updated keep rulefrom
-keep class org.webrtc.**→-keep class io.getstream.webrtc.**Breaking Changes⚠️
This is a breaking change for any app or library that:
Directly imports
org.webrtc.*— All such imports must be updatedto
io.getstream.webrtc.*Uses public APIs that expose WebRTC types — The following public
APIs have changed their parameter/return types from
org.webrtc.*to
io.getstream.webrtc.*Testing
./gradlew :stream-video-android-core:assembleDebug— confirmssuccessful compilation with the new package
./gradlew :stream-video-android-core:test— unit tests passwith repackaged WebRTC classes
./gradlew :stream-video-android-core:connectedDebugAndroidTest—instrumented tests pass on a real device (validates WebRTC at runtime)
screen share)
VideoFilter/AudioFiltercustom implementations compileagainst the new namespace
☑️Contributor Checklist
General
developbranchCode & documentation
stream-video-examples)☑️Reviewer Checklist
🎉 GIF
Please provide a suitable gif that describes your work on this pull request
Summary by CodeRabbit
Bug Fixes
Dependencies
Improvements