Repository navigation
feat: map the remaining peer connection configuration fields - #317
Merged
Merged
Conversation
…erver When WebRTC rejected a configuration, createPeerConnection() threw with a message whose error type was garbage: the type name is a string_view, which was passed to a %s vararg as it was. It is now passed as a C string. The native observer made for the connection also leaked then, as no peer connection took it; it is now deleted.
RTCConfiguration gains the settings WebRTC has and the Java API did not: candidate gathering (iceCandidatePoolSize, tcpCandidatePolicy, candidateNetworkPolicy, continualGatheringPolicy, IPv6 limits, networkPreference, vpnPreference), the timing of ICE checks, TURN port pruning and logging, DSCP, CPU adaptation, suspension below the minimum bitrate, the screen share bitrate floor, the SRTP cipher suites and cryptex (RTCCryptoOptions), extmap-allow-mixed, implicit rollback and eager data channel negotiation. The new fields are unset by default, which keeps WebRTC's defaults, some of which are true; getConfiguration() returns the values in effect. Network adapter types are mapped explicitly, as their native values are bit flags. Frame encryption is left out: it needs a native frame encryptor, which the library does not expose, and would stop all sending otherwise. A new guide describes the peer connection configuration.
SendableMetatype
added a commit
to EduGeyser/webrtc-java
that referenced
this pull request
Oct 10, 2026
Brings in upstream 0.19.0 and the work after it: the FFmpeg-based webrtc-java-media module with its native extension API (devopvoid#291, devopvoid#292, devopvoid#299, devopvoid#300), encoded frame transforms (devopvoid#300), the remaining sender encoding parameters and RTCConfiguration fields (devopvoid#316, devopvoid#317), custom and hardware video codec factories (devopvoid#303, devopvoid#310 to devopvoid#315, devopvoid#318 to devopvoid#330), the log sink and 32-bit ARM stats fixes, and upstream's CI rework (devopvoid#294 to devopvoid#309). Fork-side adaptations: - The media module builds with Gradle, and only in the full variant: it needs audio and video. On Linux it links like the JNI library, since the Chromium sysroots no longer ship the static libgcc_eh.a. The sysroots carry stubs of glibc that no executable links against, so FFmpeg's configure links with lld and allows undefined symbols in shared libraries. - The data channels variant leaves out the new media sources, the codec factory setup and the hardware codec headers, and skips the new tests that need audio or video. - The module tests run on the module path with the test resources patched in, and the core tests open the internal package that NativeApi and NativeLoader are tested in. - The WebRTC checkout keeps this fork's sync, with upstream's checkout_instrumented_libraries setting. - CI builds all platforms from one reusable workflow, as upstream now does. The full variant also builds FFmpeg and tests the media module. The WebRTC and FFmpeg caches are saved as soon as their builds finish, and a release is prepared locally and pushed in one atomic push. - The Maven poms and upstream's Dependabot setup stay out, and the README is the fork's own; the rename script now leaves it alone.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
RTCConfigurationgains the settings WebRTC has and the Java API didn't, plus a fix for howcreatePeerConnection()reports a rejected configuration.API
iceCandidatePoolSize,tcpCandidatePolicy,candidateNetworkPolicy,continualGatheringPolicy,disableIpv6OnWifi,maxIpv6Networks,networkPreference,vpnPreference,surfaceIceCandidatesOnIceTransportTypeChangediceConnectionReceivingTimeout,iceBackupCandidatePairPingInterval,iceCheckIntervalStrongConnectivity,iceCheckIntervalWeakConnectivity,iceCheckMinInterval,iceUnwritableTimeout,iceUnwritableMinChecks,iceInactiveTimeout,stunCandidateKeepaliveInterval,stableWritableConnectionPingInterval,prioritizeMostLikelyIceCandidatePairs,enableIceRenominationpresumeWritableWhenFullyRelayed,turnPortPrunePolicy,turnLoggingIdenableDscp,enableCpuAdaptation,suspendBelowMinBitrate,screencastMinBitratecryptoOptions: the newRTCCryptoOptionsfor SRTP cipher suites and cryptex (RFC 9335)offerExtmapAllowMixed,enableImplicitRollback,alwaysNegotiateDataChannelsNew enums:
RTCTcpCandidatePolicy,RTCCandidateNetworkPolicy,RTCContinualGatheringPolicy,RTCPortPrunePolicy,RTCVpnPreference,RTCAdapterType,RTCCryptexPolicy.Design
true(DSCP, CPU adaptation, extmap-allow-mixed), and a plain Javabooleanwould have silently turned them off.getConfiguration()returns the values in effect, defaults included.RTCAdapterTypeis mapped explicitly, because the native adapter types are bit flags, which the by-ordinal enum conversion can't map.requireFrameEncryption: it needs a native frame encryptor, which the library doesn't expose (its encryption uses encoded transforms), so it would stop all sending.networkPreferencewins over pair priority and network cost rather than only breaking ties, andscreencastMinBitratepads screen share video up to that bitrate.Fix (separate commit)
createPeerConnection()threw with a garbled error type.ToString(RTCErrorType)returns astring_view, which was passed to a%svararg as it was (undefined behavior). It's now passed as a C string.Testing
RTCConfigurationFieldsTests(5 tests):trueones.getConfiguration().setConfiguration(): changes to modifiable fields are applied.tcpCandidatePolicy = DISABLED, gathering yields no TCP candidates.mvn -pl webrtc test: 189 tests pass.-Pjni-check: 189 tests pass, with noFATAL ERROR in native method.Docs
New guide:
docs/guide/networking/peer-connection-config.md(Peer Connection Configuration), linked from the sidebar and the guide index.