Skip to content

fix: make CustomVideoSource's frame_id_ counter thread-safe - #286

Merged
devopvoid merged 1 commit into
mainfrom
fix/custom-video-source-frame-id-race
Sep 14, 2026
Merged

devopvoid merged 1 commit into
mainfrom
fix/custom-video-source-frame-id-race

Conversation

@devopvoid

Copy link
Copy Markdown
Owner

Summary

Test plan

  • mvn -pl webrtc-jni -am install -DskipTests — native build succeeds
  • mvn -pl webrtc test -Dtest=CustomVideoSourceTest,CustomAudioSourceTest — all tests pass

PushFrame() is callable from any Java thread; incrementing a plain
uint16_t there was an unsynchronized read-modify-write, the same
class of race just fixed in CustomAudioSource (#285).
@devopvoid
devopvoid merged commit 7a7c2f3 into main Sep 14, 2026
11 checks passed
@devopvoid
devopvoid deleted the fix/custom-video-source-frame-id-race branch September 15, 2026 08:20
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.

1 participant