xref: /aosp_15_r20/external/webrtc/android_tools/instructions.txt (revision d9f758449e529ab9291ac668be2861e7a55c2422)
1*d9f75844SAndroid Build Coastguard WorkerFollow the following steps to update this project:
2*d9f75844SAndroid Build Coastguard Worker
3*d9f75844SAndroid Build Coastguard Worker1- Git merge aosp/upstream-main, resolving any conflicts, to obtain a recent enough version of the code.
4*d9f75844SAndroid Build Coastguard Worker2- Use an upstream checkout to generate the json files.
5*d9f75844SAndroid Build Coastguard Worker  2.1 - Follow instructions to download and build upstream webrtc from https://webrtc.googlesource.com/src/+/main/docs/native-code/development/index.md.
6*d9f75844SAndroid Build Coastguard Worker  2.2 - Generate the json files for each architecture.
7*d9f75844SAndroid Build Coastguard Worker    2.2.1 - Disable libaom (search for enable_libaom in all .gni/.gn files and set it to false).
8*d9f75844SAndroid Build Coastguard Worker    2.2.2 - Disable x11 (set rtc_use_x11 to false in webrtc.gni).
9*d9f75844SAndroid Build Coastguard Worker    2.2.3 - Disable pipewire (rtc_use_pipewire to false in webrtc.gni).
10*d9f75844SAndroid Build Coastguard Worker    2.2.4 - Enable dummy audio file (rtc_use_dummy_audio_file_devices to true in webrtc.gni).
11*d9f75844SAndroid Build Coastguard Worker    2.2.5 - Disable dav1d decoder (rtc_include_dav1d_in_internal_decoder_factory to false in webrtc.gni).
12*d9f75844SAndroid Build Coastguard Worker    2.2.6 - Disable protobuf (rtc_enable_protobuf to false in webrtc.gni).
13*d9f75844SAndroid Build Coastguard Worker    2.2.7 - Set is_clang to true unconditionally in build/config/BUILDCONFIG.gn
14*d9f75844SAndroid Build Coastguard Worker    2.2.8 - Run this command:
15*d9f75844SAndroid Build Coastguard Worker      for arch in x64 x86 arm64 arm riscv64; do
16*d9f75844SAndroid Build Coastguard Worker          gn gen out/Debug --args="target_os=\"linux\" target_cpu=\"${arch}\"" --json-file-name=project_${arch}.json --ide=json
17*d9f75844SAndroid Build Coastguard Worker      done
18*d9f75844SAndroid Build Coastguard Worker  2.3 Copy out/Debug/project_*.json into android_tools.
19*d9f75844SAndroid Build Coastguard Worker3- Run android_tools/generate_android_bp.sh.
20*d9f75844SAndroid Build Coastguard Worker4- Build cuttlefish and run it in all architectures to ensure webrtc is working correctly (connect to it, press a few buttons and make sure audio works).
21*d9f75844SAndroid Build Coastguard Worker5- The build in step number 4 likely failed, fix any errors. Make sure to not edit external/webrtc/Android.bp directly, but modify the generating script instead.
22*d9f75844SAndroid Build Coastguard Worker6- Update these instructions with any new steps needed.
23