Skip to content

feat: allow setting custom WebRTC field trials on PeerConnectionFactory - #284

Merged
devopvoid merged 1 commit into
mainfrom
feature/216-field-trials
Sep 13, 2026
Merged

devopvoid merged 1 commit into
mainfrom
feature/216-field-trials

Conversation

@devopvoid

Copy link
Copy Markdown
Owner

Summary

  • Add PeerConnectionFactory constructor overloads accepting a Map<String, String> of field trials, forwarded to the native factory as a webrtc::FieldTrialsView so callers can enable experimental WebRTC features (e.g. message interleaving) without touching native code.
  • Add a small jni::FieldTrialsView (native, include/api/FieldTrialsView.h + src/api/FieldTrialsView.cpp) backed directly by the passed-in map, since webrtc::FieldTrials (api/field_trials.h) isn't linked into the webrtc archive for every build configuration of this project.
  • Add a docs page (docs/guide/advanced/field-trials.md) and tests covering valid, empty, and invalid field trial maps.

Resolves #216

Test plan

  • mvn -pl webrtc-jni package -DskipTests — native build succeeds and links
  • mvn -pl webrtc test -Dtest=PeerConnectionFactoryTests — 16/16 pass
  • mvn -pl webrtc test (full module suite) — 148/148 pass

Add PeerConnectionFactory constructor overloads that accept a
Map<String, String> of field trials, forwarded to the native factory as
a FieldTrialsView so callers can enable experimental WebRTC features
(e.g. message interleaving) without touching native code.

webrtc::FieldTrials (api/field_trials.h) isn't used on the native side
because its translation unit isn't linked into the webrtc archive for
every build configuration of this project; a small FieldTrialsView
backed directly by the passed-in map avoids that dependency.

Resolves #216
@devopvoid devopvoid changed the title Allow setting custom WebRTC field trials on PeerConnectionFactory feat: allow setting custom WebRTC field trials on PeerConnectionFactory Sep 13, 2026
@devopvoid
devopvoid merged commit dda69be into main Sep 13, 2026
11 checks passed
@devopvoid
devopvoid deleted the feature/216-field-trials branch September 13, 2026 22:44
SendableMetatype added a commit to EduGeyser/webrtc-java that referenced this pull request Sep 25, 2026
Brings in upstream 0.17.0 and 0.18.0 and the fixes after them: JNI
reference and thread safety fixes (devopvoid#283), field trials on
PeerConnectionFactory (devopvoid#284), CustomAudioSource and CustomVideoSource
synchronization (devopvoid#285, devopvoid#286), AudioTrackSource.dispose() (devopvoid#287),
device-captured audio kept out of sink-fed senders (devopvoid#289), and Map
method IDs taken from the interface (devopvoid#290).

Fork-side adaptations:
- The audio module proxy and the capture natives are media code: they
  are compiled out of the data channels variant, and
  ProxyAudioDeviceModule.cpp is excluded from its source list.
- The data channels variant passes the field trials through the
  factory's Environment, as CreatePeerConnectionFactory does.
- The Maven poms stay deleted; upstream's jni-check profile becomes the
  Gradle property -Pjni-check.
- The new tests that need audio or video carry the media tag.
- The changelog keeps upstream's 0.17.0 and 0.18.0 sections in date
  order next to the fork's 0.17.0-sm.1 section.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow setting field trials

1 participant