Skip to content

Build fixes for android + Refactoring to reduce merge conflict occurences in future#83

Merged
PratimMallick merged 23 commits into
iliaspavlidakis/merge-webrtc-m145from
pratim/m145_fixes
May 11, 2026
Merged

Build fixes for android + Refactoring to reduce merge conflict occurences in future#83
PratimMallick merged 23 commits into
iliaspavlidakis/merge-webrtc-m145from
pratim/m145_fixes

Conversation

@PratimMallick
Copy link
Copy Markdown
Contributor

No description provided.

PratimMallick and others added 23 commits May 4, 2026 15:42
The jni_zero template no longer accepts jni_generator_include as a
parameter (removed upstream in M145). These stale assignments cause
GN "assignment had no effect" errors and block the Android AAR build.

Co-authored-by: Cursor <cursoragent@cursor.com>
- Replace deprecated //system_wrappers:field_trial with
  //api/environment:deprecated_global_field_trials (3 occurrences)
- Restore //api/crypto:frame_crypto_transformer target that was lost
  during merge (sources still exist, target definition was dropped)
- Replace //test:scoped_key_value_config with
  //test:create_test_field_trials (renamed upstream in M145)

Co-authored-by: Cursor <cursoragent@cursor.com>
…dio_device_module

These targets don't need the field trial dep (upstream M145 doesn't
have it). The dep was only valid for peerconnection_jni which is in
the target's visibility list. base_jni already has api:field_trials_view.

Co-authored-by: Cursor <cursoragent@cursor.com>
… deps

- audio_device_module_base: replace default_task_queue_factory (which is
  poisonous) with api/task_queue + api/environment (matching upstream M145)
- api/crypto:frame_crypto_transformer: fix task_queue_base dep (no such
  target; task_queue_base.h lives in the api/task_queue target)

Co-authored-by: Cursor <cursoragent@cursor.com>
The Stream fork changed the @CalledByNative constructor to take 3 args
(name, params, scalabilityModes). Code throughout the codebase still
calls the 2-arg version. Add a convenience constructor that delegates
to the 3-arg version with an empty scalabilityModes list.

Co-authored-by: Cursor <cursoragent@cursor.com>
The M145 merge dropped the environment_java target and
AudioFrameProcessor.java from peerconnection_java sources.
PeerConnectionFactory.java references both classes, causing
compilation failure.

- Restore environment_java rtc_android_library target
- Add generated_environment_jni generate_jni target
- Add AudioFrameProcessor.java to peerconnection_java sources
- Add environment_java as dep of peerconnection_java

Co-authored-by: Cursor <cursoragent@cursor.com>
The AudioProcessingFactory interface now requires createNative(long
webrtcEnvRef) instead of createNative(). Update both custom
implementations to match the new signature.

Note: downstream ManagedAudioProcessingFactory implementations (e.g.
noise-cancellation library) will also need this update.

Co-authored-by: Cursor <cursoragent@cursor.com>
- Replace removed `rtc::` namespace with `webrtc::` (Buffer, Thread,
  ArrayView, ByteBufferWriter, scoped_refptr, TimeMillis)
- Replace `TransformableVideoFrameInterface::header().codec` with
  `Metadata().GetCodec()`
- Replace `header().video_type_header` with
  `Metadata().GetRTPVideoHeaderCodecSpecifics()`
- Add missing BUILD.gn deps for all included headers
- Add missing standard library includes in header

Co-authored-by: Cursor <cursoragent@cursor.com>
The previous bulk replace of rtc::ArrayView matched inside
webrtc::ArrayView, producing invalid webArrayView tokens.

Co-authored-by: Cursor <cursoragent@cursor.com>
Remove frame_crypto_transformer, frame_cryptor, and data_packet_cryptor
from the Android SDK build - matching iOS which also doesn't include
these modules. The E2EE frame cryptor code has M145 incompatibilities
that are not needed for the current build.

Co-authored-by: Cursor <cursoragent@cursor.com>
In M145, cricket namespace was merged into webrtc namespace.
kAv1CodecName is now in webrtc:: which is already imported via
'using namespace webrtc'.

Co-authored-by: Cursor <cursoragent@cursor.com>
In M145, JavaParamRef is aliased to jni_zero::JavaRef which has a
protected (env, obj) constructor. Use ScopedJavaLocalRef::Adopt with
a new local ref instead.

Co-authored-by: Cursor <cursoragent@cursor.com>
In external_audio_processing_factory.cc - the rtc namespace no longer
exists in M145.

Co-authored-by: Cursor <cursoragent@cursor.com>
…nges

Replace rtc::scoped_refptr with webrtc::scoped_refptr and convert raw
pointer management to scoped_refptr for proper ref-counted lifetime.

Co-authored-by: Cursor <cursoragent@cursor.com>
The Environment.java class was not included in the dist_jar (due to
direct_deps_only=true) and its native JNI implementation (environment.cc)
was not being compiled, causing NoClassDefFoundError at runtime.

Creates a separate environment_jni target matching upstream M145 structure
and adds it to libjingle_peerconnection_jni's public_deps.

Co-authored-by: Cursor <cursoragent@cursor.com>
Move simulcast and LiveKit audio processing code out of sdk/android/BUILD.gn
into self-contained extensions/ directories:

- extensions/android-simulcast/ — SimulcastVideoEncoder, SimulcastVideoEncoderFactory,
  SimulcastAlignedVideoEncoderFactory, DefaultAlignedVideoEncoderFactory (Java + JNI)
- extensions/android-livekit-audio-processing/ — ExternalAudioProcessingFactory (Java + JNI)

Add STREAM-CUSTOM marker comments to remaining custom lines in sdk/android/BUILD.gn
for easy post-merge verification.

This reduces custom lines in sdk/android/BUILD.gn from ~30 scattered entries to
~11 clearly-marked single-line deps, significantly reducing future merge conflict risk.

Co-authored-by: Cursor <cursoragent@cursor.com>
Use ../../modules/video_coding:webrtc_vp9 instead of the non-existent
../../modules/video_coding/codecs/vp9:libvpx_vp9 target.

Co-authored-by: Cursor <cursoragent@cursor.com>
…ssing

Consolidate android-external-audio-processing and android-livekit-audio-processing
into a single extensions/android-audio-processing/ with standard layout:

- java/org/webrtc/ — Java API classes
- src/ — all C++ sources (native plugin + audio effects)

Matches the same structure as android-simulcast. Removes confusing
"livekit" naming from public Stream repo.

Co-authored-by: Cursor <cursoragent@cursor.com>
…tility Java files

- Move extensions/android-audio-processing → extensions/android/audio-processing
- Move extensions/android-simulcast → extensions/android/simulcast
- Create extensions/android/utilities for pure Java custom classes:
  ResolutionAdjustment, ManagedAudioProcessingFactory, DefaultBlacklistedVideoDecoderFactory
- Update all relative paths in BUILD.gn files (../../ → ../../../)
- Update C++ #include paths for new directory structure
- Allows iOS extensions to use extensions/ios/ in the future

Co-authored-by: Cursor <cursoragent@cursor.com>
DefaultBlacklistedVideoDecoderFactory uses VideoCodecInfo which lives
in the video_api_java target.

Co-authored-by: Cursor <cursoragent@cursor.com>
…ment

SimulcastAlignedVideoEncoderFactory and DefaultAlignedVideoEncoderFactory
use ResolutionAdjustment which now lives in the utilities extension.

Co-authored-by: Cursor <cursoragent@cursor.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 8, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 37569680-3b8c-4787-b76e-87eca059a564

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch pratim/m145_fixes

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@ipavlidakis ipavlidakis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really like the seperation and grouping. Very nice work!

@PratimMallick PratimMallick merged commit 328a648 into iliaspavlidakis/merge-webrtc-m145 May 11, 2026
1 check passed
@PratimMallick PratimMallick deleted the pratim/m145_fixes branch May 11, 2026 07:17
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.

2 participants