diff --git a/.github/workflows/webrtc-builds.yml b/.github/workflows/webrtc-builds.yml index def67d31d..b6c97b1f6 100644 --- a/.github/workflows/webrtc-builds.yml +++ b/.github/workflows/webrtc-builds.yml @@ -26,12 +26,12 @@ jobs: matrix: target: - name: win - os: windows-latest + os: windows-2022 cmd: .\build_windows.cmd arch: x64 - name: win - os: windows-latest + os: windows-2022 cmd: .\build_windows.cmd arch: arm64 @@ -104,17 +104,38 @@ jobs: echo "OutName: ${{ steps.setup.outputs.OUT }}" echo "OutZip: ${{ steps.setup.outputs.ZIP }}" - - uses: actions/checkout@v4 - with: - submodules: true - - - uses: actions/setup-python@v4 + - uses: actions/checkout@v5 + - uses: actions/setup-python@v5 - name: install setuptools (none-macOS) if: ${{ matrix.target.os != 'macos-latest' }} run: | pip3 install setuptools # pkg_resources is sometimes not found? + - name: Add GCC PPA and install GCC 14 + if: ${{ matrix.target.os == 'ubuntu-latest' }} + run: | + sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y + sudo apt update + sudo apt install gcc-14 g++-14 g++-14-aarch64-linux-gnu -y + + - name: Verify GCC 14 installation + if: ${{ matrix.target.os == 'ubuntu-latest' }} + run: | + gcc-14 --version + g++-14 --version + aarch64-linux-gnu-g++-14 --version + + - name: Set GCC 14 as default (optional) + if: ${{ matrix.target.os == 'ubuntu-latest' }} + run: | + sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 140 --slave /usr/bin/g++ g++ /usr/bin/g++-14 + sudo update-alternatives --config gcc + gcc --version + sudo update-alternatives --install /usr/bin/aarch64-linux-gnu-gcc aarch64-linux-gnu-gcc /usr/bin/aarch64-linux-gnu-gcc-14 140 --slave /usr/bin/aarch64-linux-gnu-g++ aarch64-linux-gnu-g++ /usr/bin/aarch64-linux-gnu-g++-14 + sudo update-alternatives --config aarch64-linux-gnu-gcc + aarch64-linux-gnu-gcc --version + - name: Install linux dependencies if: ${{ matrix.target.os == 'ubuntu-latest' }} run: | @@ -126,7 +147,7 @@ jobs: run: brew install ninja - name: Install windows dependencies - if: ${{ matrix.target.os == 'windows-latest' }} + if: ${{ matrix.target.os == 'windows-2022' }} run: | Invoke-WebRequest -Uri "https://github.com/ninja-build/ninja/releases/latest/download/ninja-win.zip" -OutFile ninja.zip Expand-Archive -Path ninja.zip -DestinationPath ${{ github.workspace }}\ninja @@ -145,13 +166,13 @@ jobs: working-directory: webrtc-sys/libwebrtc - name: Zip artifact (Unix) - if: ${{ matrix.target.os != 'windows-latest' }} + if: ${{ matrix.target.os != 'windows-2022' }} run: | cd webrtc-sys/libwebrtc zip ${{ github.workspace }}/${{ steps.setup.outputs.ZIP }} ${{ steps.setup.outputs.OUT }} -r - name: Zip artifact (Windows) - if: ${{ matrix.target.os == 'windows-latest' }} + if: ${{ matrix.target.os == 'windows-2022' }} run: Compress-Archive -Path .\webrtc-sys\libwebrtc\${{ steps.setup.outputs.OUT }} -DestinationPath ${{ steps.setup.outputs.ZIP }} - name: Upload artifacts diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 000000000..2e0006786 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,12 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "type": "lldb", + "request": "launch", + "name": "wgpu_room(debug)", + "program": "${workspaceFolder}/examples/target/debug/wgpu_room", + "preLaunchTask": "build" + } + ] +} \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 000000000..900d036c6 --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,33 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "build", + "type": "shell", + "command": "cargo", + "args": [ + "build" + ], + "options": { + "env": { + // cd webrtc-sys/libwebrtc && ./build_macos.sh --arch arm64 --profile debug + "LK_CUSTOM_WEBRTC": "${workspaceFolder}/webrtc-sys/libwebrtc/mac-arm64-debug" + }, + "cwd": "${workspaceFolder}/examples" + }, + "dependsOn": ["libwebrtc-build"] + }, + { + "label": "libwebrtc-build", + "type": "shell", + "command": "./build_macos.sh", + "args": [ + "--arch", "arm64", + "--profile", "debug" + ], + "options": { + "cwd": "${workspaceFolder}/webrtc-sys/libwebrtc" + }, + } + ] +} \ No newline at end of file diff --git a/examples/Cargo.lock b/examples/Cargo.lock index eab9084ad..4e0647a5c 100644 --- a/examples/Cargo.lock +++ b/examples/Cargo.lock @@ -126,12 +126,6 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc7eb209b1518d6bb87b283c20095f5228ecda460da70b44f0802523dea6da04" -[[package]] -name = "android-tzdata" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" - [[package]] name = "android_log-sys" version = "0.3.2" @@ -231,7 +225,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0348a1c054491f4bfe6ab86a7b6ab1e44e45d899005de92f58b3df180b36ddaf" dependencies = [ "clipboard-win", - "image 0.25.6", + "image 0.25.8", "log", "objc2 0.6.2", "objc2-app-kit 0.3.1", @@ -325,20 +319,20 @@ dependencies = [ [[package]] name = "async-io" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19634d6336019ef220f09fd31168ce5c184b295cbf80345437cc36094ef223ca" +checksum = "456b8a8feb6f42d237746d4b3e9a178494627745c3c56c6ea55d92ba50d026fc" dependencies = [ - "async-lock", + "autocfg", "cfg-if", "concurrent-queue", "futures-io", "futures-lite", "parking", "polling", - "rustix 1.0.8", + "rustix 1.1.2", "slab", - "windows-sys 0.60.2", + "windows-sys 0.61.0", ] [[package]] @@ -716,9 +710,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.35" +version = "1.2.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "590f9024a68a8c40351881787f1934dc11afd69090f5edb6831464694d836ea3" +checksum = "65193589c6404eb80b450d618eaf9a2cafaaafd57ecce47370519ef674a7bd44" dependencies = [ "find-msvc-tools", "jobserver", @@ -755,16 +749,15 @@ checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" [[package]] name = "chrono" -version = "0.4.41" +version = "0.4.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c469d952047f47f91b68d1cba3f10d63c11d73e4636f24f08daf0278abf01c4d" +checksum = "145052bdd345b87320e369255277e3fb5152762ad123a901ef5c262dd38fe8d2" dependencies = [ - "android-tzdata", "iana-time-zone", "js-sys", "num-traits", "wasm-bindgen", - "windows-link", + "windows-link 0.2.0", ] [[package]] @@ -1101,11 +1094,12 @@ checksum = "f27ae1dd37df86211c42e150270f82743308803d90a6f6e6651cd730d5e1732f" [[package]] name = "cxx" -version = "1.0.174" +version = "1.0.184" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5ba77f286ce5c44c7ba02de894b057bc0a605a210e3d81fa83b92d94586c0e1" +checksum = "be4a0beb369d20d0de6aa7084ee523e4c9a31d7d8c61ba357b119bb574d7f368" dependencies = [ "cc", + "cxx-build", "cxxbridge-cmd", "cxxbridge-flags", "cxxbridge-macro", @@ -1115,13 +1109,13 @@ dependencies = [ [[package]] name = "cxx-build" -version = "1.0.174" +version = "1.0.184" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c56fdf6fba27288d1fda3384062692e66dc40ca41bafd15f616dd4e8b0ac909" +checksum = "27d955b93e56a8e45cbc34df0ae920d8b5ad01541a4571222c78527c00e1a40a" dependencies = [ "cc", "codespan-reporting 0.12.0", - "indexmap 2.11.0", + "indexmap 2.11.3", "proc-macro2", "quote", "scratch", @@ -1130,13 +1124,13 @@ dependencies = [ [[package]] name = "cxxbridge-cmd" -version = "1.0.174" +version = "1.0.184" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19ade5eb6d6e6ef9c5631eff7e4f74e0e7109140e775f124d76904c0e5e6a202" +checksum = "052f6c468d9dabdc2b8b228bcb2d7843b2bea0f3fb9c4e2c6ba5852574ec0150" dependencies = [ "clap", "codespan-reporting 0.12.0", - "indexmap 2.11.0", + "indexmap 2.11.3", "proc-macro2", "quote", "syn 2.0.106", @@ -1144,17 +1138,17 @@ dependencies = [ [[package]] name = "cxxbridge-flags" -version = "1.0.174" +version = "1.0.184" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99f99fe2f3f76a2ba40c5431f854efe3725c19a89f4d59966bca3ec561be940e" +checksum = "0fd145fa180986cb8002c63217d03b2c782fdcd5fa323adcd1f62d2d6ece6144" [[package]] name = "cxxbridge-macro" -version = "1.0.174" +version = "1.0.184" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b6e5fa0545804d2d8d398a1e995203a1f2403a9f0651d50546462e61a28340e" +checksum = "02ac4a3bc4484a2daa0a8421c9588bd26522be9682a2fe02c7087bc4e8bc3c60" dependencies = [ - "indexmap 2.11.0", + "indexmap 2.11.3", "proc-macro2", "quote", "rustversion", @@ -1274,7 +1268,7 @@ dependencies = [ "egui-wgpu", "egui-winit", "home", - "image 0.25.6", + "image 0.25.8", "js-sys", "log", "objc2 0.5.2", @@ -1438,12 +1432,12 @@ checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" [[package]] name = "errno" -version = "0.3.13" +version = "0.3.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "778e2ac28f6c47af28e4907f13ffd1e1ddbd400980a9abd7c8df189bf578a5ad" +checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys 0.60.2", + "windows-sys 0.61.0", ] [[package]] @@ -1500,6 +1494,26 @@ version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" +[[package]] +name = "fax" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f05de7d48f37cd6730705cbca900770cab77a89f413d23e100ad7fad7795a0ab" +dependencies = [ + "fax_derive", +] + +[[package]] +name = "fax_derive" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0aca10fb742cb43f9e7bb8467c91aa9bcb8e3ffbc6a6f7389bb93ffc920577d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.106", +] + [[package]] name = "fdeflate" version = "0.3.7" @@ -1511,9 +1525,9 @@ dependencies = [ [[package]] name = "find-msvc-tools" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e178e4fba8a2726903f6ba98a6d221e76f9c12c650d5dc0e6afdc50677b49650" +checksum = "7fd99930f64d146689264c637b5af2f0233a933bef0d8570e2526bf9e083192d" [[package]] name = "fixedbitset" @@ -1728,7 +1742,7 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc257fdb4038301ce4b9cd1b3b51704509692bb3ff716a410cbd07925d9dae55" dependencies = [ - "rustix 1.0.8", + "rustix 1.1.2", "windows-targets 0.52.6", ] @@ -1754,7 +1768,7 @@ dependencies = [ "cfg-if", "libc", "r-efi", - "wasi 0.14.3+wasi-0.2.4", + "wasi 0.14.7+wasi-0.2.4", ] [[package]] @@ -1886,7 +1900,7 @@ dependencies = [ "futures-sink", "futures-util", "http 0.2.12", - "indexmap 2.11.0", + "indexmap 2.11.3", "slab", "tokio", "tokio-util", @@ -2021,9 +2035,9 @@ checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "humantime" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b112acc8b3adf4b107a8ec20977da0273a8c386765a3ec0229bd500a1443f9f" +checksum = "135b12329e5e3ce057a9f972339ea52bc954fe1e9358ef27f95e89716fbc5424" [[package]] name = "hyper" @@ -2090,9 +2104,9 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.63" +version = "0.1.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0c919e5debc312ad217002b8048a17b7d83f80703865bbfcfebb0458b0b27d8" +checksum = "33e57f83510bb73707521ebaffa789ec8caf86f9657cad665b092b581d40e9fb" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -2100,7 +2114,7 @@ dependencies = [ "js-sys", "log", "wasm-bindgen", - "windows-core 0.61.2", + "windows-core 0.62.0", ] [[package]] @@ -2232,22 +2246,23 @@ dependencies = [ "gif", "jpeg-decoder", "num-traits", - "png", + "png 0.17.16", "qoi", - "tiff", + "tiff 0.9.1", ] [[package]] name = "image" -version = "0.25.6" +version = "0.25.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db35664ce6b9810857a38a906215e75a9c879f0696556a39f59c62829710251a" +checksum = "529feb3e6769d234375c4cf1ee2ce713682b8e76538cb13f9fc23e1400a591e7" dependencies = [ "bytemuck", "byteorder-lite", + "moxcms", "num-traits", - "png", - "tiff", + "png 0.18.0", + "tiff 0.10.3", ] [[package]] @@ -2262,9 +2277,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.11.0" +version = "2.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2481980430f9f78649238835720ddccc57e52df14ffce1c6f37391d61b563e9" +checksum = "92119844f513ffa41556430369ab02c295a3578af21cf945caa3e9e0c2481ac3" dependencies = [ "equivalent", "hashbrown 0.15.5", @@ -2398,9 +2413,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.77" +version = "0.3.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" +checksum = "6247da8b8658ad4e73a186e747fcc5fc2a29f979d6fe6269127fdb5fd08298d0" dependencies = [ "once_cell", "wasm-bindgen", @@ -2453,9 +2468,9 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "lebe" -version = "0.5.2" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03087c2bad5e1034e8cace5926dec053fb3790248370865f5117a7d0213354c8" +checksum = "7a79a3332a6609480d7d0c9eab957bca6b455b91bb84e66d19f5ff66294b85b8" [[package]] name = "libc" @@ -2481,9 +2496,9 @@ checksum = "f9fbbcab51052fe104eb5e5d351cf728d30a5be1fe14d9be8a3b097481fb97de" [[package]] name = "libredox" -version = "0.1.9" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "391290121bad3d37fbddad76d8f5d1c1c314cfc646d143d7e07a3086ddff0ce3" +checksum = "416f7e718bdb06000964960ffa43b4335ad4012ae8b99060261aa4a8088d5ccb" dependencies = [ "bitflags 2.9.4", "libc", @@ -2492,7 +2507,7 @@ dependencies = [ [[package]] name = "libwebrtc" -version = "0.3.12" +version = "0.3.14" dependencies = [ "cxx", "jni", @@ -2514,9 +2529,9 @@ dependencies = [ [[package]] name = "link-cplusplus" -version = "1.0.11" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c349c75e1ab4a03bd6b33fe6cbd3c479c5dd443e44ad732664d72cb0e755475" +checksum = "7f78c730aaa7d0b9336a299029ea49f9ee53b0ed06e9202e8cb7db9bae7b8c82" dependencies = [ "cc", ] @@ -2529,9 +2544,9 @@ checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" [[package]] name = "linux-raw-sys" -version = "0.9.4" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12" +checksum = "df1d3c3b53da64cf5760482273a98e575c651a67eec7f77df96b5b642de8f039" [[package]] name = "litemap" @@ -2547,7 +2562,7 @@ checksum = "f5e54036fe321fd421e10d732f155734c4e4afd610dd556d9a82833ab3ee0bed" [[package]] name = "livekit" -version = "0.7.16" +version = "0.7.18" dependencies = [ "bmrng", "bytes", @@ -2571,7 +2586,7 @@ dependencies = [ [[package]] name = "livekit-api" -version = "0.4.5" +version = "0.4.6" dependencies = [ "async-tungstenite", "base64 0.21.7", @@ -2650,9 +2665,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.27" +version = "0.4.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" +checksum = "34080505efa8e45a4b816c349525ebe327ceaa8559756f0356cba97ef3bf7432" dependencies = [ "value-bag", ] @@ -2766,6 +2781,16 @@ dependencies = [ "webrtc-sys-build", ] +[[package]] +name = "moxcms" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddd32fa8935aeadb8a8a6b6b351e40225570a37c43de67690383d87ef170cd08" +dependencies = [ + "num-traits", + "pxfm", +] + [[package]] name = "multimap" version = "0.10.1" @@ -2784,7 +2809,7 @@ dependencies = [ "cfg_aliases", "codespan-reporting 0.11.1", "hexf-parse", - "indexmap 2.11.0", + "indexmap 2.11.3", "log", "rustc-hash 1.1.0", "spirv", @@ -2808,7 +2833,7 @@ dependencies = [ "half", "hashbrown 0.15.5", "hexf-parse", - "indexmap 2.11.0", + "indexmap 2.11.3", "log", "num-traits", "once_cell", @@ -3459,7 +3484,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" dependencies = [ "fixedbitset", - "indexmap 2.11.0", + "indexmap 2.11.3", ] [[package]] @@ -3524,18 +3549,31 @@ dependencies = [ "miniz_oxide", ] +[[package]] +name = "png" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97baced388464909d42d89643fe4361939af9b7ce7a31ee32a168f832a70f2a0" +dependencies = [ + "bitflags 2.9.4", + "crc32fast", + "fdeflate", + "flate2", + "miniz_oxide", +] + [[package]] name = "polling" -version = "3.10.0" +version = "3.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5bd19146350fe804f7cb2669c851c03d69da628803dab0d98018142aaa5d829" +checksum = "5d0e4f59085d47d8241c88ead0f274e8a0cb551f3625263c05eb8dd897c34218" dependencies = [ "cfg-if", "concurrent-queue", "hermit-abi", "pin-project-lite", - "rustix 1.0.8", - "windows-sys 0.60.2", + "rustix 1.1.2", + "windows-sys 0.61.0", ] [[package]] @@ -3592,9 +3630,9 @@ dependencies = [ [[package]] name = "proc-macro-crate" -version = "3.3.0" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edce586971a4dfaa28950c6f18ed55e0406c1ab88bbce2c6f6293a7aaba73d35" +checksum = "219cb19e96be00ab2e37d6e299658a0cfa83e52429179969b0f0121b4ac46983" dependencies = [ "toml_edit", ] @@ -3699,6 +3737,15 @@ dependencies = [ "prost 0.12.6", ] +[[package]] +name = "pxfm" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f55f4fedc84ed39cb7a489322318976425e42a147e2be79d8f878e2884f94e84" +dependencies = [ + "num-traits", +] + [[package]] name = "qoi" version = "0.4.1" @@ -3708,6 +3755,12 @@ dependencies = [ "bytemuck", ] +[[package]] +name = "quick-error" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a993555f31e5a609f617c12db6250dedcac1b0a85076912c436e6fc9b2c8e6a3" + [[package]] name = "quick-xml" version = "0.37.5" @@ -3993,15 +4046,15 @@ dependencies = [ [[package]] name = "rustix" -version = "1.0.8" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11181fbabf243db407ef8df94a6ce0b2f9a733bd8be4ad02b4eda9602296cac8" +checksum = "cd15f8a2c5551a84d56efdc1cd049089e409ac19a3072d5037a17fd70719ff3e" dependencies = [ "bitflags 2.9.4", "errno", "libc", - "linux-raw-sys 0.9.4", - "windows-sys 0.60.2", + "linux-raw-sys 0.11.0", + "windows-sys 0.61.0", ] [[package]] @@ -4081,11 +4134,11 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.27" +version = "0.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f29ebaa345f945cec9fbbc532eb307f0fdad8161f281b6369539c8d84876b3d" +checksum = "891d81b926048e76efe18581bf793546b4c0eaf8448d72be8de2bbee5fd166e1" dependencies = [ - "windows-sys 0.59.0", + "windows-sys 0.61.0", ] [[package]] @@ -4144,9 +4197,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.14.0" +version = "2.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49db231d56a190491cb4aeda9527f1ad45345af50b0851622a7adb8c03b01c32" +checksum = "cc1f0cbffaac4852523ce30d8bd3c5cdc873501d96ff467ca09b6767bb8cd5c0" dependencies = [ "core-foundation-sys", "libc", @@ -4154,24 +4207,34 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.26" +version = "1.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0" +checksum = "d767eb0aabc880b29956c35734170f26ed551a859dbd361d140cdbeca61ab1e2" [[package]] name = "serde" -version = "1.0.219" +version = "1.0.225" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" +checksum = "fd6c24dee235d0da097043389623fb913daddf92c76e9f5a1db88607a0bcbd1d" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde_core" +version = "1.0.225" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "659356f9a0cb1e529b24c01e43ad2bdf520ec4ceaf83047b83ddcc2251f96383" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.219" +version = "1.0.225" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" +checksum = "0ea936adf78b1f766949a4977b91d2f5595825bd6ec079aa9543ad2685fc4516" dependencies = [ "proc-macro2", "quote", @@ -4180,14 +4243,15 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.143" +version = "1.0.145" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d401abef1d108fbd9cbaebc3e46611f4b1021f714a0597a71f41ee463f5f4a5a" +checksum = "402a6f66d8c709116cf22f558eab210f5a50187f702eb4d7e5ef38d9a7f1c79c" dependencies = [ "itoa", "memchr", "ryu", "serde", + "serde_core", ] [[package]] @@ -4463,15 +4527,15 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.21.0" +version = "3.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15b61f8f20e3a6f7e0649d825294eaf317edce30f82cf6026e7e4cb9222a7d1e" +checksum = "84fa4d11fadde498443cca10fd3ac23c951f0dc59e080e9f4b93d4df4e4eea53" dependencies = [ "fastrand", "getrandom 0.3.3", "once_cell", - "rustix 1.0.8", - "windows-sys 0.60.2", + "rustix 1.1.2", + "windows-sys 0.61.0", ] [[package]] @@ -4553,6 +4617,20 @@ dependencies = [ "weezl", ] +[[package]] +name = "tiff" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af9605de7fee8d9551863fd692cce7637f548dbd9db9180fcc07ccc6d26c336f" +dependencies = [ + "fax", + "flate2", + "half", + "quick-error", + "weezl", + "zune-jpeg", +] + [[package]] name = "time" version = "0.3.43" @@ -4713,18 +4791,31 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.6.11" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22cddaf88f4fbc13c51aebbf5f8eceb5c7c5a9da2ac40a13519eb5b0a0e8f11c" +checksum = "a197c0ec7d131bfc6f7e82c8442ba1595aeab35da7adbf05b6b73cd06a16b6be" +dependencies = [ + "serde_core", +] [[package]] name = "toml_edit" -version = "0.22.27" +version = "0.23.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a" +checksum = "c2ad0b7ae9cfeef5605163839cb9221f453399f15cfb5c10be9885fcf56611f9" dependencies = [ - "indexmap 2.11.0", + "indexmap 2.11.3", "toml_datetime", + "toml_parser", + "winnow", +] + +[[package]] +name = "toml_parser" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b551886f449aa90d4fe2bdaa9f4a2577ad2dde302c61ecf262d80b116db95c10" +dependencies = [ "winnow", ] @@ -4906,9 +4997,9 @@ checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" [[package]] name = "unicode-ident" -version = "1.0.18" +version = "1.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" +checksum = "f63a545481291138910575129486daeaf8ac54aee4387fe7906919f7830c7d9d" [[package]] name = "unicode-segmentation" @@ -5021,30 +5112,40 @@ checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" [[package]] name = "wasi" -version = "0.14.3+wasi-0.2.4" +version = "0.14.7+wasi-0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "883478de20367e224c0090af9cf5f9fa85bed63a95c1abf3afc5c083ebc06e8c" +dependencies = [ + "wasip2", +] + +[[package]] +name = "wasip2" +version = "1.0.1+wasi-0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a51ae83037bdd272a9e28ce236db8c07016dd0d50c27038b3f407533c030c95" +checksum = "0562428422c63773dad2c345a1882263bbf4d65cf3f42e90921f787ef5ad58e7" dependencies = [ "wit-bindgen", ] [[package]] name = "wasm-bindgen" -version = "0.2.100" +version = "0.2.102" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" +checksum = "4ad224d2776649cfb4f4471124f8176e54c1cca67a88108e30a0cd98b90e7ad3" dependencies = [ "cfg-if", "once_cell", "rustversion", "wasm-bindgen-macro", + "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.100" +version = "0.2.102" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" +checksum = "3a1364104bdcd3c03f22b16a3b1c9620891469f5e9f09bc38b2db121e593e732" dependencies = [ "bumpalo", "log", @@ -5056,9 +5157,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.50" +version = "0.4.52" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "555d470ec0bc3bb57890405e5d4322cc9ea83cebb085523ced7be4144dac1e61" +checksum = "9c0a08ecf5d99d5604a6666a70b3cde6ab7cc6142f5e641a8ef48fc744ce8854" dependencies = [ "cfg-if", "js-sys", @@ -5069,9 +5170,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.100" +version = "0.2.102" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" +checksum = "0d7ab4ca3e367bb1ed84ddbd83cc6e41e115f8337ed047239578210214e36c76" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -5079,9 +5180,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.100" +version = "0.2.102" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" +checksum = "4a518014843a19e2dbbd0ed5dfb6b99b23fb886b14e6192a00803a3e14c552b0" dependencies = [ "proc-macro2", "quote", @@ -5092,9 +5193,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.100" +version = "0.2.102" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" +checksum = "255eb0aa4cc2eea3662a00c2bbd66e93911b7361d5e0fcd62385acfd7e15dcee" dependencies = [ "unicode-ident", ] @@ -5107,7 +5208,7 @@ checksum = "673a33c33048a5ade91a6b139580fa174e19fb0d23f396dca9fa15f2e1e49b35" dependencies = [ "cc", "downcast-rs", - "rustix 1.0.8", + "rustix 1.1.2", "scoped-tls", "smallvec", "wayland-sys", @@ -5120,7 +5221,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c66a47e840dc20793f2264eb4b3e4ecb4b75d91c0dd4af04b456128e0bdd449d" dependencies = [ "bitflags 2.9.4", - "rustix 1.0.8", + "rustix 1.1.2", "wayland-backend", "wayland-scanner", ] @@ -5142,7 +5243,7 @@ version = "0.31.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "447ccc440a881271b19e9989f75726d60faa09b95b0200a9b7eb5cc47c3eeb29" dependencies = [ - "rustix 1.0.8", + "rustix 1.1.2", "wayland-client", "xcursor", ] @@ -5210,9 +5311,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.77" +version = "0.3.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33b6dd2ef9186f1f2072e409e99cd22a975331a6b3591b12c764e0e55c60d5d2" +checksum = "50462a022f46851b81d5441d1a6f5bac0b21a1d72d64bd4906fbdd4bf7230ec7" dependencies = [ "js-sys", "wasm-bindgen", @@ -5261,7 +5362,7 @@ checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" [[package]] name = "webrtc-sys" -version = "0.3.9" +version = "0.3.11" dependencies = [ "cc", "cxx", @@ -5355,7 +5456,7 @@ dependencies = [ "bitflags 2.9.4", "cfg_aliases", "document-features", - "indexmap 2.11.0", + "indexmap 2.11.3", "log", "naga 24.0.0", "once_cell", @@ -5382,7 +5483,7 @@ dependencies = [ "cfg_aliases", "document-features", "hashbrown 0.15.5", - "indexmap 2.11.0", + "indexmap 2.11.3", "log", "naga 25.0.1", "once_cell", @@ -5555,9 +5656,11 @@ dependencies = [ "image 0.24.9", "livekit", "log", + "objc2 0.6.2", "parking_lot", "serde", "tokio", + "webrtc-sys", "wgpu 25.0.2", "winit", ] @@ -5580,11 +5683,11 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.10" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0978bf7171b3d90bac376700cb56d606feb40f251a475a5d6634613564460b22" +checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" dependencies = [ - "windows-sys 0.60.2", + "windows-sys 0.61.0", ] [[package]] @@ -5638,15 +5741,15 @@ dependencies = [ [[package]] name = "windows-core" -version = "0.61.2" +version = "0.62.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0fdd3ddb90610c7638aa2b3a3ab2904fb9e5cdbecc643ddb3647212781c4ae3" +checksum = "57fe7168f7de578d2d8a05b07fd61870d2e73b4020e9f49aa00da8471723497c" dependencies = [ "windows-implement 0.60.0", "windows-interface 0.59.1", - "windows-link", - "windows-result 0.3.4", - "windows-strings 0.4.2", + "windows-link 0.2.0", + "windows-result 0.4.0", + "windows-strings 0.5.0", ] [[package]] @@ -5699,6 +5802,12 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a" +[[package]] +name = "windows-link" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45e46c0661abb7180e7b9c281db115305d49ca1709ab8242adf09666d2173c65" + [[package]] name = "windows-result" version = "0.1.2" @@ -5719,11 +5828,11 @@ dependencies = [ [[package]] name = "windows-result" -version = "0.3.4" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56f42bd332cc6c8eac5af113fc0c1fd6a8fd2aa08a0119358686e5160d0586c6" +checksum = "7084dcc306f89883455a206237404d3eaf961e5bd7e0f312f7c91f57eb44167f" dependencies = [ - "windows-link", + "windows-link 0.2.0", ] [[package]] @@ -5738,11 +5847,11 @@ dependencies = [ [[package]] name = "windows-strings" -version = "0.4.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56e6c93f3a0c3b36176cb1327a4958a0353d5d166c2a35cb268ace15e91d3b57" +checksum = "7218c655a553b0bed4426cf54b20d7ba363ef543b52d515b3e48d7fd55318dda" dependencies = [ - "windows-link", + "windows-link 0.2.0", ] [[package]] @@ -5790,6 +5899,15 @@ dependencies = [ "windows-targets 0.53.3", ] +[[package]] +name = "windows-sys" +version = "0.61.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e201184e40b2ede64bc2ea34968b28e33622acdbbf37104f0e4a33f7abe657aa" +dependencies = [ + "windows-link 0.2.0", +] + [[package]] name = "windows-targets" version = "0.42.2" @@ -5842,7 +5960,7 @@ version = "0.53.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d5fe6031c4041849d7c496a8ded650796e7b6ecc19df1a431c1a363342e5dc91" dependencies = [ - "windows-link", + "windows-link 0.1.3", "windows_aarch64_gnullvm 0.53.0", "windows_aarch64_msvc 0.53.0", "windows_i686_gnu 0.53.0", @@ -6106,9 +6224,9 @@ dependencies = [ [[package]] name = "wit-bindgen" -version = "0.45.0" +version = "0.46.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "052283831dbae3d879dc7f51f3d92703a316ca49f91540417d38591826127814" +checksum = "f17a85883d4e6d00e8a97c586de764dabcc06133f7f1d55dce5cdc070ad7fe59" [[package]] name = "writeable" @@ -6138,7 +6256,7 @@ dependencies = [ "libc", "libloading", "once_cell", - "rustix 1.0.8", + "rustix 1.1.2", "x11rb-protocol", ] @@ -6205,18 +6323,18 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.8.26" +version = "0.8.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1039dd0d3c310cf05de012d8a39ff557cb0d23087fd44cad61df08fc31907a2f" +checksum = "0894878a5fa3edfd6da3f88c4805f4c8558e2b996227a3d864f47fe11e38282c" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.8.26" +version = "0.8.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ecf5b4cc5364572d7f4c329661bcc82724222973f2cab6f050a4e5c22f75181" +checksum = "88d2b8d9c68ad2b9e4340d7832716a4d21a22a1154777ad56ea55c51a9cf3831" dependencies = [ "proc-macro2", "quote", @@ -6318,14 +6436,20 @@ dependencies = [ [[package]] name = "zstd-sys" -version = "2.0.15+zstd.1.5.7" +version = "2.0.16+zstd.1.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb81183ddd97d0c74cedf1d50d85c8d08c1b8b68ee863bdee9e706eedba1a237" +checksum = "91e19ebc2adc8f83e43039e79776e3fda8ca919132d68a1fed6a5faca2683748" dependencies = [ "cc", "pkg-config", ] +[[package]] +name = "zune-core" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f423a2c17029964870cfaabb1f13dfab7d092a62a29a89264f4d36990ca414a" + [[package]] name = "zune-inflate" version = "0.2.54" @@ -6334,3 +6458,12 @@ checksum = "73ab332fe2f6680068f3582b16a24f90ad7096d5d39b974d1c0aff0125116f02" dependencies = [ "simd-adler32", ] + +[[package]] +name = "zune-jpeg" +version = "0.4.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29ce2c8a9384ad323cf564b67da86e21d3cfdff87908bc1223ed5c99bc792713" +dependencies = [ + "zune-core", +] diff --git a/examples/wgpu_room/Cargo.toml b/examples/wgpu_room/Cargo.toml index 6030d64cd..de3cb3996 100644 --- a/examples/wgpu_room/Cargo.toml +++ b/examples/wgpu_room/Cargo.toml @@ -23,3 +23,7 @@ serde = { version = "1", features = ["derive"] } log = "0.4" env_logger = "0.10.0" console-subscriber = { version = "0.1.10", features = ["parking_lot"], optional = true } + +[target.'cfg(target_os = "macos")'.dependencies] +# On macos use feature relax-sign-encoding to avoid runtime crash (https://github.com/rust-windowing/winit/pull/4302) +objc2 = { version = "0.6.0", features = ["relax-sign-encoding"] } \ No newline at end of file diff --git a/webrtc-sys/build.rs b/webrtc-sys/build.rs index b022ea7d3..e2a3dcdfd 100644 --- a/webrtc-sys/build.rs +++ b/webrtc-sys/build.rs @@ -190,7 +190,7 @@ fn main() { _ => {} } - builder.flag("-std=c++2a"); + builder.flag("-Wno-changes-meaning").flag("-std=c++20"); } "macos" => { println!("cargo:rustc-link-lib=framework=Foundation"); @@ -208,6 +208,7 @@ fn main() { println!("cargo:rustc-link-lib=framework=QuartzCore"); println!("cargo:rustc-link-lib=framework=IOKit"); println!("cargo:rustc-link-lib=framework=IOSurface"); + println!("cargo:rustc-link-lib=framework=ScreenCaptureKit"); configure_darwin_sysroot(&mut builder); diff --git a/webrtc-sys/build/src/lib.rs b/webrtc-sys/build/src/lib.rs index 87cbeb48e..6b858ef2c 100644 --- a/webrtc-sys/build/src/lib.rs +++ b/webrtc-sys/build/src/lib.rs @@ -27,7 +27,7 @@ use regex::Regex; use reqwest::StatusCode; pub const SCRATH_PATH: &str = "livekit_webrtc"; -pub const WEBRTC_TAG: &str = "webrtc-ed96590"; +pub const WEBRTC_TAG: &str = "webrtc-f4967ef"; pub const IGNORE_DEFINES: [&str; 2] = ["CR_CLANG_REVISION", "CR_XCODE_VERSION"]; pub fn target_os() -> String { diff --git a/webrtc-sys/include/livekit/apm.h b/webrtc-sys/include/livekit/apm.h index 5f0e17eca..57cd6ea5c 100644 --- a/webrtc-sys/include/livekit/apm.h +++ b/webrtc-sys/include/livekit/apm.h @@ -63,7 +63,7 @@ class AudioProcessingModule { int set_stream_delay_ms(int delay_ms); private: - rtc::scoped_refptr apm_; + webrtc::scoped_refptr apm_; }; std::unique_ptr create_apm( diff --git a/webrtc-sys/include/livekit/audio_device.h b/webrtc-sys/include/livekit/audio_device.h index 74d76823a..d0ae2ded1 100644 --- a/webrtc-sys/include/livekit/audio_device.h +++ b/webrtc-sys/include/livekit/audio_device.h @@ -114,7 +114,7 @@ class AudioDevice : public webrtc::AudioDeviceModule { int GetRecordAudioParameters(webrtc::AudioParameters* params) const override; #endif // WEBRTC_IOS - int32_t SetAudioDeviceSink(webrtc::AudioDeviceSink* sink) const override; + int32_t SetObserver(webrtc::AudioDeviceObserver* sink) override; private: mutable webrtc::Mutex mutex_; diff --git a/webrtc-sys/include/livekit/audio_track.h b/webrtc-sys/include/livekit/audio_track.h index c780b7797..349bb7cea 100644 --- a/webrtc-sys/include/livekit/audio_track.h +++ b/webrtc-sys/include/livekit/audio_track.h @@ -48,7 +48,7 @@ class AudioTrack : public MediaStreamTrack { private: friend RtcRuntime; AudioTrack(std::shared_ptr rtc_runtime, - rtc::scoped_refptr track); + webrtc::scoped_refptr track); public: ~AudioTrack(); @@ -167,10 +167,10 @@ class AudioTrackSource { void clear_buffer() const; - rtc::scoped_refptr get() const; + webrtc::scoped_refptr get() const; private: - rtc::scoped_refptr source_; + webrtc::scoped_refptr source_; }; std::shared_ptr new_audio_track_source( diff --git a/webrtc-sys/include/livekit/data_channel.h b/webrtc-sys/include/livekit/data_channel.h index 33fea51b4..e511dc7e8 100644 --- a/webrtc-sys/include/livekit/data_channel.h +++ b/webrtc-sys/include/livekit/data_channel.h @@ -39,7 +39,7 @@ class DataChannel { public: explicit DataChannel( std::shared_ptr rtc_runtime, - rtc::scoped_refptr data_channel); + webrtc::scoped_refptr data_channel); ~DataChannel(); void register_observer(rust::Box observer) const; @@ -54,7 +54,7 @@ class DataChannel { private: mutable webrtc::Mutex mutex_; std::shared_ptr rtc_runtime_; - rtc::scoped_refptr data_channel_; + webrtc::scoped_refptr data_channel_; mutable std::unique_ptr observer_; }; diff --git a/webrtc-sys/include/livekit/frame_cryptor.h b/webrtc-sys/include/livekit/frame_cryptor.h index 43102d3cf..f7ba3584b 100644 --- a/webrtc-sys/include/livekit/frame_cryptor.h +++ b/webrtc-sys/include/livekit/frame_cryptor.h @@ -116,10 +116,10 @@ class KeyProvider { impl_->SetSifTrailer(trailer_vec); } - rtc::scoped_refptr rtc_key_provider() { return impl_; } + webrtc::scoped_refptr rtc_key_provider() { return impl_; } private: - rtc::scoped_refptr impl_; + webrtc::scoped_refptr impl_; }; class FrameCryptor { @@ -127,14 +127,14 @@ class FrameCryptor { FrameCryptor(std::shared_ptr rtc_runtime, const std::string participant_id, webrtc::FrameCryptorTransformer::Algorithm algorithm, - rtc::scoped_refptr key_provider, - rtc::scoped_refptr sender); + webrtc::scoped_refptr key_provider, + webrtc::scoped_refptr sender); FrameCryptor(std::shared_ptr rtc_runtime, const std::string participant_id, webrtc::FrameCryptorTransformer::Algorithm algorithm, - rtc::scoped_refptr key_provider, - rtc::scoped_refptr receiver); + webrtc::scoped_refptr key_provider, + webrtc::scoped_refptr receiver); ~FrameCryptor(); /// Enable/Disable frame crypto for the sender or receiver. @@ -161,11 +161,11 @@ class FrameCryptor { std::shared_ptr rtc_runtime_; const rust::String participant_id_; mutable webrtc::Mutex mutex_; - rtc::scoped_refptr e2ee_transformer_; - rtc::scoped_refptr key_provider_; - rtc::scoped_refptr sender_; - rtc::scoped_refptr receiver_; - mutable rtc::scoped_refptr observer_; + webrtc::scoped_refptr e2ee_transformer_; + webrtc::scoped_refptr key_provider_; + webrtc::scoped_refptr sender_; + webrtc::scoped_refptr receiver_; + mutable webrtc::scoped_refptr observer_; }; class NativeFrameCryptorObserver diff --git a/webrtc-sys/include/livekit/jsep.h b/webrtc-sys/include/livekit/jsep.h index 6f100f43e..62ec36669 100644 --- a/webrtc-sys/include/livekit/jsep.h +++ b/webrtc-sys/include/livekit/jsep.h @@ -139,7 +139,7 @@ class NativeRtcStatsCollector : public webrtc::RTCStatsCollectorCallback { : ctx_(std::move(ctx)), on_stats_(on_stats) {} void OnStatsDelivered( - const rtc::scoped_refptr& report) override { + const webrtc::scoped_refptr& report) override { on_stats_(std::move(ctx_), report->ToJson()); } diff --git a/webrtc-sys/include/livekit/media_stream.h b/webrtc-sys/include/livekit/media_stream.h index fe64dbe6a..fcfd09762 100644 --- a/webrtc-sys/include/livekit/media_stream.h +++ b/webrtc-sys/include/livekit/media_stream.h @@ -33,7 +33,7 @@ namespace livekit { class MediaStream { public: MediaStream(std::shared_ptr rtc_runtime, - rtc::scoped_refptr stream); + webrtc::scoped_refptr stream); rust::String id() const; rust::Vec get_video_tracks() const; @@ -47,7 +47,7 @@ class MediaStream { private: std::shared_ptr rtc_runtime_; - rtc::scoped_refptr media_stream_; + webrtc::scoped_refptr media_stream_; }; static std::shared_ptr _shared_media_stream() { diff --git a/webrtc-sys/include/livekit/media_stream_track.h b/webrtc-sys/include/livekit/media_stream_track.h index 6be69047a..1b86c6165 100644 --- a/webrtc-sys/include/livekit/media_stream_track.h +++ b/webrtc-sys/include/livekit/media_stream_track.h @@ -33,7 +33,7 @@ namespace livekit { class MediaStreamTrack { protected: MediaStreamTrack(std::shared_ptr, - rtc::scoped_refptr track); + webrtc::scoped_refptr track); public: rust::String kind() const; @@ -44,13 +44,13 @@ class MediaStreamTrack { TrackState state() const; - rtc::scoped_refptr rtc_track() const { + webrtc::scoped_refptr rtc_track() const { return track_; } protected: std::shared_ptr rtc_runtime_; - rtc::scoped_refptr track_; + webrtc::scoped_refptr track_; }; static std::shared_ptr _shared_media_stream_track() { diff --git a/webrtc-sys/include/livekit/peer_connection.h b/webrtc-sys/include/livekit/peer_connection.h index 32496ca00..6e7587b50 100644 --- a/webrtc-sys/include/livekit/peer_connection.h +++ b/webrtc-sys/include/livekit/peer_connection.h @@ -48,7 +48,7 @@ class PeerConnection : webrtc::PeerConnectionObserver { public: PeerConnection( std::shared_ptr rtc_runtime, - rtc::scoped_refptr pc_factory, + webrtc::scoped_refptr pc_factory, rust::Box observer); ~PeerConnection(); @@ -141,13 +141,13 @@ class PeerConnection : webrtc::PeerConnectionObserver { webrtc::PeerConnectionInterface::SignalingState new_state) override; void OnAddStream( - rtc::scoped_refptr stream) override; + webrtc::scoped_refptr stream) override; void OnRemoveStream( - rtc::scoped_refptr stream) override; + webrtc::scoped_refptr stream) override; void OnDataChannel( - rtc::scoped_refptr data_channel) override; + webrtc::scoped_refptr data_channel) override; void OnRenegotiationNeeded() override; @@ -182,23 +182,23 @@ class PeerConnection : webrtc::PeerConnectionObserver { const cricket::CandidatePairChangeEvent& event) override; void OnAddTrack( - rtc::scoped_refptr receiver, - const std::vector>& + webrtc::scoped_refptr receiver, + const std::vector>& streams) override; void OnTrack( - rtc::scoped_refptr transceiver) override; + webrtc::scoped_refptr transceiver) override; void OnRemoveTrack( - rtc::scoped_refptr receiver) override; + webrtc::scoped_refptr receiver) override; void OnInterestingUsage(int usage_pattern) override; private: std::shared_ptr rtc_runtime_; - rtc::scoped_refptr pc_factory_; + webrtc::scoped_refptr pc_factory_; rust::Box observer_; - rtc::scoped_refptr peer_connection_; + webrtc::scoped_refptr peer_connection_; }; static std::shared_ptr _shared_peer_connection() { diff --git a/webrtc-sys/include/livekit/peer_connection_factory.h b/webrtc-sys/include/livekit/peer_connection_factory.h index ae49842ba..2a4bf8539 100644 --- a/webrtc-sys/include/livekit/peer_connection_factory.h +++ b/webrtc-sys/include/livekit/peer_connection_factory.h @@ -64,8 +64,8 @@ class PeerConnectionFactory { private: std::shared_ptr rtc_runtime_; - rtc::scoped_refptr audio_device_; - rtc::scoped_refptr peer_factory_; + webrtc::scoped_refptr audio_device_; + webrtc::scoped_refptr peer_factory_; webrtc::TaskQueueFactory* task_queue_factory_; }; diff --git a/webrtc-sys/include/livekit/rtp_receiver.h b/webrtc-sys/include/livekit/rtp_receiver.h index 1bec92b8f..25181680d 100644 --- a/webrtc-sys/include/livekit/rtp_receiver.h +++ b/webrtc-sys/include/livekit/rtp_receiver.h @@ -40,8 +40,8 @@ class RtpReceiver { public: RtpReceiver( std::shared_ptr rtc_runtime, - rtc::scoped_refptr receiver, - rtc::scoped_refptr peer_connection); + webrtc::scoped_refptr receiver, + webrtc::scoped_refptr peer_connection); std::shared_ptr track() const; @@ -62,14 +62,14 @@ class RtpReceiver { void set_jitter_buffer_minimum_delay(bool is_some, double delay_seconds) const; - rtc::scoped_refptr rtc_receiver() const { + webrtc::scoped_refptr rtc_receiver() const { return receiver_; } private: std::shared_ptr rtc_runtime_; - rtc::scoped_refptr receiver_; - rtc::scoped_refptr peer_connection_; + webrtc::scoped_refptr receiver_; + webrtc::scoped_refptr peer_connection_; }; static std::shared_ptr _shared_rtp_receiver() { diff --git a/webrtc-sys/include/livekit/rtp_sender.h b/webrtc-sys/include/livekit/rtp_sender.h index b9ff44e29..80363942b 100644 --- a/webrtc-sys/include/livekit/rtp_sender.h +++ b/webrtc-sys/include/livekit/rtp_sender.h @@ -38,8 +38,8 @@ class RtpSender { public: RtpSender( std::shared_ptr rtc_runtime, - rtc::scoped_refptr sender, - rtc::scoped_refptr peer_connection); + webrtc::scoped_refptr sender, + webrtc::scoped_refptr peer_connection); bool set_track(std::shared_ptr track) const; @@ -65,14 +65,14 @@ class RtpSender { void set_parameters(RtpParameters params) const; - rtc::scoped_refptr rtc_sender() const { + webrtc::scoped_refptr rtc_sender() const { return sender_; } private: std::shared_ptr rtc_runtime_; - rtc::scoped_refptr sender_; - rtc::scoped_refptr peer_connection_; + webrtc::scoped_refptr sender_; + webrtc::scoped_refptr peer_connection_; }; static std::shared_ptr _shared_rtp_sender() { diff --git a/webrtc-sys/include/livekit/rtp_transceiver.h b/webrtc-sys/include/livekit/rtp_transceiver.h index 0eba06fb2..99a994ccc 100644 --- a/webrtc-sys/include/livekit/rtp_transceiver.h +++ b/webrtc-sys/include/livekit/rtp_transceiver.h @@ -43,8 +43,8 @@ class RtpTransceiver { public: RtpTransceiver( std::shared_ptr rtc_runtime, - rtc::scoped_refptr transceiver, - rtc::scoped_refptr peer_connection); + webrtc::scoped_refptr transceiver, + webrtc::scoped_refptr peer_connection); MediaType media_type() const; @@ -82,8 +82,8 @@ class RtpTransceiver { private: std::shared_ptr rtc_runtime_; - rtc::scoped_refptr transceiver_; - rtc::scoped_refptr peer_connection_; + webrtc::scoped_refptr transceiver_; + webrtc::scoped_refptr peer_connection_; }; static std::shared_ptr _shared_rtp_transceiver() { diff --git a/webrtc-sys/include/livekit/video_encoder_factory.h b/webrtc-sys/include/livekit/video_encoder_factory.h index f1e8bc84a..902049e3a 100644 --- a/webrtc-sys/include/livekit/video_encoder_factory.h +++ b/webrtc-sys/include/livekit/video_encoder_factory.h @@ -29,7 +29,7 @@ class VideoEncoderFactory : public webrtc::VideoEncoderFactory { CodecSupport QueryCodecSupport( const webrtc::SdpVideoFormat& format, - absl::optional scalability_mode) const override; + std::optional scalability_mode) const override; std::unique_ptr Create( const webrtc::Environment& env, const webrtc::SdpVideoFormat& format) override; @@ -45,7 +45,7 @@ class VideoEncoderFactory : public webrtc::VideoEncoderFactory { CodecSupport QueryCodecSupport( const webrtc::SdpVideoFormat& format, - absl::optional scalability_mode) const override; + std::optional scalability_mode) const override; std::unique_ptr Create( const webrtc::Environment& env, const webrtc::SdpVideoFormat& format) override; diff --git a/webrtc-sys/include/livekit/video_frame_buffer.h b/webrtc-sys/include/livekit/video_frame_buffer.h index a7e25fdf5..0a612b324 100644 --- a/webrtc-sys/include/livekit/video_frame_buffer.h +++ b/webrtc-sys/include/livekit/video_frame_buffer.h @@ -58,7 +58,7 @@ namespace livekit { class VideoFrameBuffer { public: explicit VideoFrameBuffer( - rtc::scoped_refptr buffer); + webrtc::scoped_refptr buffer); VideoFrameBufferType buffer_type() const; @@ -74,15 +74,15 @@ class VideoFrameBuffer { std::unique_ptr get_i444(); std::unique_ptr get_i010(); std::unique_ptr get_nv12(); - rtc::scoped_refptr get() const; + webrtc::scoped_refptr get() const; protected: - rtc::scoped_refptr buffer_; + webrtc::scoped_refptr buffer_; }; class PlanarYuvBuffer : public VideoFrameBuffer { public: - explicit PlanarYuvBuffer(rtc::scoped_refptr buffer); + explicit PlanarYuvBuffer(webrtc::scoped_refptr buffer); unsigned int chroma_width() const; unsigned int chroma_height() const; @@ -98,7 +98,7 @@ class PlanarYuvBuffer : public VideoFrameBuffer { class PlanarYuv8Buffer : public PlanarYuvBuffer { public: explicit PlanarYuv8Buffer( - rtc::scoped_refptr buffer); + webrtc::scoped_refptr buffer); const uint8_t* data_y() const; const uint8_t* data_u() const; @@ -111,7 +111,7 @@ class PlanarYuv8Buffer : public PlanarYuvBuffer { class PlanarYuv16BBuffer : public PlanarYuvBuffer { public: explicit PlanarYuv16BBuffer( - rtc::scoped_refptr buffer); + webrtc::scoped_refptr buffer); const uint16_t* data_y() const; const uint16_t* data_u() const; @@ -124,7 +124,7 @@ class PlanarYuv16BBuffer : public PlanarYuvBuffer { class BiplanarYuvBuffer : public VideoFrameBuffer { public: explicit BiplanarYuvBuffer( - rtc::scoped_refptr buffer); + webrtc::scoped_refptr buffer); unsigned int chroma_width() const; unsigned int chroma_height() const; @@ -139,7 +139,7 @@ class BiplanarYuvBuffer : public VideoFrameBuffer { class BiplanarYuv8Buffer : public BiplanarYuvBuffer { public: explicit BiplanarYuv8Buffer( - rtc::scoped_refptr buffer); + webrtc::scoped_refptr buffer); const uint8_t* data_y() const; const uint8_t* data_uv() const; @@ -150,12 +150,12 @@ class BiplanarYuv8Buffer : public BiplanarYuvBuffer { class I420Buffer : public PlanarYuv8Buffer { public: - explicit I420Buffer(rtc::scoped_refptr buffer); + explicit I420Buffer(webrtc::scoped_refptr buffer); }; class I420ABuffer : public I420Buffer { public: - explicit I420ABuffer(rtc::scoped_refptr buffer); + explicit I420ABuffer(webrtc::scoped_refptr buffer); unsigned int stride_a() const; const uint8_t* data_a() const; @@ -166,22 +166,22 @@ class I420ABuffer : public I420Buffer { class I422Buffer : public PlanarYuv8Buffer { public: - explicit I422Buffer(rtc::scoped_refptr buffer); + explicit I422Buffer(webrtc::scoped_refptr buffer); }; class I444Buffer : public PlanarYuv8Buffer { public: - explicit I444Buffer(rtc::scoped_refptr buffer); + explicit I444Buffer(webrtc::scoped_refptr buffer); }; class I010Buffer : public PlanarYuv16BBuffer { public: - explicit I010Buffer(rtc::scoped_refptr buffer); + explicit I010Buffer(webrtc::scoped_refptr buffer); }; class NV12Buffer : public BiplanarYuv8Buffer { public: - explicit NV12Buffer(rtc::scoped_refptr buffer); + explicit NV12Buffer(webrtc::scoped_refptr buffer); }; std::unique_ptr copy_i420_buffer( diff --git a/webrtc-sys/include/livekit/video_track.h b/webrtc-sys/include/livekit/video_track.h index f60c3dd91..ac74b79c9 100644 --- a/webrtc-sys/include/livekit/video_track.h +++ b/webrtc-sys/include/livekit/video_track.h @@ -42,7 +42,7 @@ class VideoTrack : public MediaStreamTrack { private: friend RtcRuntime; VideoTrack(std::shared_ptr rtc_runtime, - rtc::scoped_refptr track); + webrtc::scoped_refptr track); public: ~VideoTrack(); @@ -68,7 +68,7 @@ class VideoTrack : public MediaStreamTrack { mutable std::vector> sinks_; }; -class NativeVideoSink : public rtc::VideoSinkInterface { +class NativeVideoSink : public webrtc::VideoSinkInterface { public: explicit NativeVideoSink(rust::Box observer); @@ -85,7 +85,7 @@ std::shared_ptr new_native_video_sink( rust::Box observer); class VideoTrackSource { - class InternalSource : public rtc::AdaptedVideoTrackSource { + class InternalSource : public webrtc::AdaptedVideoTrackSource { public: InternalSource(const VideoResolution& resolution); // (0, 0) means no resolution/optional, the @@ -94,7 +94,7 @@ class VideoTrackSource { ~InternalSource() override; bool is_screencast() const override; - absl::optional needs_denoising() const override; + std::optional needs_denoising() const override; SourceState state() const override; bool remote() const override; VideoResolution video_resolution() const; @@ -102,7 +102,7 @@ class VideoTrackSource { private: mutable webrtc::Mutex mutex_; - rtc::TimestampAligner timestamp_aligner_; + webrtc::TimestampAligner timestamp_aligner_; VideoResolution resolution_; }; @@ -114,10 +114,10 @@ class VideoTrackSource { bool on_captured_frame(const std::unique_ptr& frame) const; // frames pushed from Rust (+interior mutability) - rtc::scoped_refptr get() const; + webrtc::scoped_refptr get() const; private: - rtc::scoped_refptr source_; + webrtc::scoped_refptr source_; }; std::shared_ptr new_video_track_source( diff --git a/webrtc-sys/include/livekit/webrtc.h b/webrtc-sys/include/livekit/webrtc.h index 88ad1027e..afa86e1fd 100644 --- a/webrtc-sys/include/livekit/webrtc.h +++ b/webrtc-sys/include/livekit/webrtc.h @@ -25,6 +25,7 @@ #include "rtc_base/logging.h" #include "rtc_base/physical_socket_server.h" #include "rtc_base/ssl_adapter.h" +#include "rtc_base/thread.h" #include "rust/cxx.h" #ifdef WEBRTC_WIN @@ -55,25 +56,25 @@ class RtcRuntime : public std::enable_shared_from_this { RtcRuntime& operator=(const RtcRuntime&) = delete; ~RtcRuntime(); - rtc::Thread* network_thread() const; - rtc::Thread* worker_thread() const; - rtc::Thread* signaling_thread() const; + webrtc::Thread* network_thread() const; + webrtc::Thread* worker_thread() const; + webrtc::Thread* signaling_thread() const; std::shared_ptr get_or_create_media_stream_track( - rtc::scoped_refptr track); + webrtc::scoped_refptr track); std::shared_ptr get_or_create_audio_track( - rtc::scoped_refptr track); + webrtc::scoped_refptr track); std::shared_ptr get_or_create_video_track( - rtc::scoped_refptr track); + webrtc::scoped_refptr track); private: RtcRuntime(); - std::unique_ptr network_thread_; - std::unique_ptr worker_thread_; - std::unique_ptr signaling_thread_; + std::unique_ptr network_thread_; + std::unique_ptr worker_thread_; + std::unique_ptr signaling_thread_; // Lists used to make sure we don't create multiple wrappers for one // underlying webrtc object. (e.g: webrtc::VideoTrackInterface should only @@ -89,19 +90,20 @@ class RtcRuntime : public std::enable_shared_from_this { // std::vector> rtp_senders_; #ifdef WEBRTC_WIN - // rtc::WinsockInitializer winsock_; - // rtc::PhysicalSocketServer ss_; - // rtc::AutoSocketServerThread main_thread_{&ss_}; + // webrtc::WinsockInitializer winsock_; + // webrtc::PhysicalSocketServer ss_; + // webrtc::AutoSocketServerThread main_thread_{&ss_}; #endif }; -class LogSink : public rtc::LogSink { +class LogSink : public webrtc::LogSink { public: LogSink(rust::Fn fnc); ~LogSink(); void OnLogMessage(const std::string& message, - rtc::LoggingSeverity severity) override; + webrtc::LoggingSeverity severity) override; + void OnLogMessage(const std::string& message) override {} private: diff --git a/webrtc-sys/libwebrtc/.gclient b/webrtc-sys/libwebrtc/.gclient index b4fbb1f00..2cdc191a5 100644 --- a/webrtc-sys/libwebrtc/.gclient +++ b/webrtc-sys/libwebrtc/.gclient @@ -1,7 +1,7 @@ solutions = [ { "name": 'src', - "url": 'https://github.com/webrtc-sdk/webrtc.git@m125_release', + "url": 'https://github.com/webrtc-sdk/webrtc.git@m137_release', "custom_deps": {}, "deps_file": "DEPS", "managed": False, diff --git a/webrtc-sys/libwebrtc/build_android.sh b/webrtc-sys/libwebrtc/build_android.sh index 0b7006fcc..1222cfdfb 100755 --- a/webrtc-sys/libwebrtc/build_android.sh +++ b/webrtc-sys/libwebrtc/build_android.sh @@ -72,10 +72,6 @@ git apply "$COMMAND_DIR/patches/ssl_verify_callback_with_native_handle.patch" -v git apply "$COMMAND_DIR/patches/add_deps.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn git apply "$COMMAND_DIR/patches/android_use_libunwind.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn -cd third_party -git apply "$COMMAND_DIR/patches/abseil_use_optional.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn -cd .. - cd .. mkdir -p "$ARTIFACTS_DIR/lib" @@ -98,7 +94,6 @@ args="is_debug=$debug \ rtc_libvpx_build_vp9=false \ is_component_build=false \ enable_stripping=true \ - use_goma=false \ rtc_use_h264=false \ rtc_use_pipewire=false \ symbol_level=0 \ @@ -113,7 +108,7 @@ fi gn gen "$OUTPUT_DIR" --root="src" --args="${args}" # build shared library -ninja -C "$OUTPUT_DIR" :default \ +autoninja -C "$OUTPUT_DIR" :default \ sdk/android:native_api \ sdk/android:libwebrtc \ sdk/android:libjingle_peerconnection_so @@ -134,4 +129,4 @@ cp "src/sdk/android/AndroidManifest.xml" "$ARTIFACTS_DIR" cd src find . -name "*.h" -print | cpio -pd "$ARTIFACTS_DIR/include" - +find . -name "*.inc" -print | cpio -pd "$ARTIFACTS_DIR/include" diff --git a/webrtc-sys/libwebrtc/build_ios.sh b/webrtc-sys/libwebrtc/build_ios.sh index 6db1ce21f..28173b1fb 100755 --- a/webrtc-sys/libwebrtc/build_ios.sh +++ b/webrtc-sys/libwebrtc/build_ios.sh @@ -82,10 +82,6 @@ cd src git apply "$COMMAND_DIR/patches/ssl_verify_callback_with_native_handle.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn git apply "$COMMAND_DIR/patches/add_deps.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn -cd third_party -git apply "$COMMAND_DIR/patches/abseil_use_optional.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn -cd .. - cd .. mkdir -p "$ARTIFACTS_DIR/lib" @@ -142,4 +138,4 @@ cp "$OUTPUT_DIR/LICENSE.md" "$ARTIFACTS_DIR" cd src find . -name "*.h" -print | cpio -pd "$ARTIFACTS_DIR/include" - +find . -name "*.inc" -print | cpio -pd "$ARTIFACTS_DIR/include" diff --git a/webrtc-sys/libwebrtc/build_linux.sh b/webrtc-sys/libwebrtc/build_linux.sh index b08e29890..8baa7c6be 100755 --- a/webrtc-sys/libwebrtc/build_linux.sh +++ b/webrtc-sys/libwebrtc/build_linux.sh @@ -71,11 +71,12 @@ git apply "$COMMAND_DIR/patches/add_licenses.patch" -v --ignore-space-change --i git apply "$COMMAND_DIR/patches/ssl_verify_callback_with_native_handle.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn git apply "$COMMAND_DIR/patches/add_deps.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn -cd third_party -git apply "$COMMAND_DIR/patches/abseil_use_optional.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn -cd .. +cd build + +git apply "$COMMAND_DIR/patches/force_gcc.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn + +cd ../.. -cd .. mkdir -p "$ARTIFACTS_DIR/lib" @@ -92,6 +93,9 @@ args="is_debug=$debug \ rtc_enable_protobuf=false \ treat_warnings_as_errors=false \ use_custom_libcxx=false \ + use_llvm_libatomic=false \ + use_libcxx_modules=false \ + use_custom_libcxx_for_host=false \ rtc_include_tests=false \ rtc_build_tools=false \ rtc_build_examples=false \ @@ -99,13 +103,14 @@ args="is_debug=$debug \ enable_libaom=true \ is_component_build=false \ enable_stripping=true \ - use_goma=false \ ffmpeg_branding=\"Chrome\" \ rtc_use_h264=true \ + rtc_use_h265=true \ rtc_use_pipewire=false \ symbol_level=0 \ enable_iterator_debugging=false \ use_rtti=true \ + is_clang=false \ rtc_use_x11=false" # generate ninja files @@ -128,4 +133,4 @@ cp "$OUTPUT_DIR/LICENSE.md" "$ARTIFACTS_DIR" cd src find . -name "*.h" -print | cpio -pd "$ARTIFACTS_DIR/include" - +find . -name "*.inc" -print | cpio -pd "$ARTIFACTS_DIR/include" diff --git a/webrtc-sys/libwebrtc/build_macos.sh b/webrtc-sys/libwebrtc/build_macos.sh index c4ba72bd6..6a9f672b4 100755 --- a/webrtc-sys/libwebrtc/build_macos.sh +++ b/webrtc-sys/libwebrtc/build_macos.sh @@ -71,10 +71,6 @@ git apply "$COMMAND_DIR/patches/add_licenses.patch" -v --ignore-space-change --i git apply "$COMMAND_DIR/patches/ssl_verify_callback_with_native_handle.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn git apply "$COMMAND_DIR/patches/add_deps.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn -cd third_party -git apply "$COMMAND_DIR/patches/abseil_use_optional.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn -cd .. - cd .. mkdir -p "$ARTIFACTS_DIR/lib" @@ -104,6 +100,7 @@ gn gen "$OUTPUT_DIR" --root="src" \ rtc_enable_objc_symbol_export=false \ rtc_include_dav1d_in_internal_decoder_factory = true \ rtc_use_h264=true \ + rtc_use_h265=true \ use_custom_libcxx=false \ clang_use_chrome_plugins=false \ use_rtti=true \ @@ -117,7 +114,8 @@ ninja -C "$OUTPUT_DIR" :default \ sdk:default_codec_factory_objc \ pc:peer_connection \ sdk:videocapture_objc \ - sdk:mac_framework_objc + sdk:mac_framework_objc \ + desktop_capture_objc # make libwebrtc.a # don't include nasm @@ -132,4 +130,4 @@ cp "$OUTPUT_DIR/LICENSE.md" "$ARTIFACTS_DIR" cd src find . -name "*.h" -print | cpio -pd "$ARTIFACTS_DIR/include" - +find . -name "*.inc" -print | cpio -pd "$ARTIFACTS_DIR/include" diff --git a/webrtc-sys/libwebrtc/build_windows.cmd b/webrtc-sys/libwebrtc/build_windows.cmd index add24f4e9..1de0d83a1 100644 --- a/webrtc-sys/libwebrtc/build_windows.cmd +++ b/webrtc-sys/libwebrtc/build_windows.cmd @@ -40,10 +40,10 @@ set COMMAND_DIR=%~dp0 set PATH=%cd%\depot_tools;%PATH% set DEPOT_TOOLS_WIN_TOOLCHAIN=0 set GYP_GENERATORS=ninja,msvs-ninja -set GYP_MSVS_VERSION=2019 +set GYP_MSVS_VERSION=2022 set OUTPUT_DIR=src\out-!arch!-!profile! set ARTIFACTS_DIR=%cd%\win-!arch!-!profile! -set vs2019_install=C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional +set vs2019_install=C:\Program Files\Microsoft Visual Studio\2022\Enterprise if not exist src ( call gclient.bat sync -D --with_branch_heads --with_tags @@ -55,10 +55,6 @@ call git apply "%COMMAND_DIR%/patches/add_deps.patch" -v --ignore-space-change - call git apply "%COMMAND_DIR%/patches/windows_silence_warnings.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn call git apply "%COMMAND_DIR%/patches/ssl_verify_callback_with_native_handle.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn -cd third_party -call git apply "%COMMAND_DIR%/patches/abseil_use_optional.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn -cd .. - cd .. mkdir "%ARTIFACTS_DIR%\lib" @@ -88,4 +84,4 @@ copy "%OUTPUT_DIR%\LICENSE.md" "%ARTIFACTS_DIR%" rem copy header xcopy src\*.h "%ARTIFACTS_DIR%\include" /C /S /I /F /H - +xcopy src\*.inc "%ARTIFACTS_DIR%\include" /C /S /I /F /H diff --git a/webrtc-sys/libwebrtc/patches/abseil_use_optional.patch b/webrtc-sys/libwebrtc/patches/abseil_use_optional.patch deleted file mode 100644 index 476ad2619..000000000 --- a/webrtc-sys/libwebrtc/patches/abseil_use_optional.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/abseil-cpp/absl/base/options.h b/abseil-cpp/absl/base/options.h -index bd43b6ef0..ab5917e75 100644 ---- a/abseil-cpp/absl/base/options.h -+++ b/abseil-cpp/absl/base/options.h -@@ -121,7 +121,7 @@ - // absl::optional is a typedef of std::optional, use the feature macro - // ABSL_USES_STD_OPTIONAL. - --#define ABSL_OPTION_USE_STD_OPTIONAL 2 -+#define ABSL_OPTION_USE_STD_OPTIONAL 0 - - - // ABSL_OPTION_USE_STD_STRING_VIEW diff --git a/webrtc-sys/libwebrtc/patches/add_deps.patch b/webrtc-sys/libwebrtc/patches/add_deps.patch index 1b383de4e..92ae3fa8f 100644 --- a/webrtc-sys/libwebrtc/patches/add_deps.patch +++ b/webrtc-sys/libwebrtc/patches/add_deps.patch @@ -1,5 +1,5 @@ diff --git a/BUILD.gn b/BUILD.gn -index d5289b85d7..76823f6cff 100644 +index ca8d8faa61..13e07a2f28 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -24,6 +24,9 @@ @@ -12,7 +12,7 @@ index d5289b85d7..76823f6cff 100644 if (rtc_enable_protobuf) { import("//third_party/protobuf/proto_library.gni") } -@@ -292,6 +295,10 @@ config("common_config") { +@@ -331,6 +334,10 @@ config("common_config") { defines += [ "WEBRTC_INCLUDE_INTERNAL_AUDIO_DEVICE" ] } @@ -23,7 +23,7 @@ index d5289b85d7..76823f6cff 100644 if (rtc_libvpx_build_vp9) { defines += [ "RTC_ENABLE_VP9" ] } -@@ -517,6 +524,10 @@ if (!build_with_chromium) { +@@ -565,6 +572,10 @@ if (!build_with_chromium) { "pc:rtc_pc", "sdk", "video", diff --git a/webrtc-sys/libwebrtc/patches/android_use_libunwind.patch b/webrtc-sys/libwebrtc/patches/android_use_libunwind.patch index 82512a2fc..1339b31d8 100644 --- a/webrtc-sys/libwebrtc/patches/android_use_libunwind.patch +++ b/webrtc-sys/libwebrtc/patches/android_use_libunwind.patch @@ -2,7 +2,7 @@ +++ src/buildtools/third_party/libunwind/BUILD.gn 2023-07-10 10:19:23 @@ -21,7 +21,7 @@ config("libunwind_config") { - # TODO(crbug.com/1458042): Move this build file to third_party/libc++/BUILD.gn once submodule migration is done + # TODO(crbug.com/40273848): Move this build file to third_party/libc++/BUILD.gn once submodule migration is done source_set("libunwind") { - visibility = [ "//buildtools/third_party/libc++abi" ] + visibility = [ "//buildtools/third_party/libc++abi", "//build/config:common_deps" ] @@ -11,7 +11,7 @@ } --- src/build/config/BUILD.gn 2023-07-10 10:23:49 +++ src/build/config/BUILD.gn 2023-07-10 10:23:54 -@@ -246,6 +246,8 @@ group("common_deps") { +@@ -296,6 +296,8 @@ group("common_deps") { if (use_custom_libcxx) { public_deps += [ "//buildtools/third_party/libc++" ] @@ -19,4 +19,4 @@ + public_deps += [ "//buildtools/third_party/libunwind" ] } - if (use_afl) { + if (use_llvm_libatomic) { diff --git a/webrtc-sys/libwebrtc/patches/force_gcc.patch b/webrtc-sys/libwebrtc/patches/force_gcc.patch new file mode 100644 index 000000000..c409737d3 --- /dev/null +++ b/webrtc-sys/libwebrtc/patches/force_gcc.patch @@ -0,0 +1,25 @@ +diff --git a/config/c++/c++.gni b/config/c++/c++.gni +index c29d898fb..5ef014e51 100644 +--- a/config/c++/c++.gni ++++ b/config/c++/c++.gni +@@ -62,7 +62,7 @@ declare_args() { + # case. + # We disable that on LibFuzzer builds because it breaks the libfuzzer + # runtime. See crbug.com/411020147. +- use_llvm_libatomic = !is_apple && !is_nacl && !use_libfuzzer ++ use_llvm_libatomic = !is_apple && !is_nacl && !use_libfuzzer && !is_linux + } + + if (use_implicit_libcxx_modules) { +diff --git a/config/linux/BUILD.gn b/config/linux/BUILD.gn +index 131bb71d1..36c86c48e 100644 +--- a/config/linux/BUILD.gn ++++ b/config/linux/BUILD.gn +@@ -15,6 +15,7 @@ group("linux") { + # is applied to all targets. It is here to separate out the logic that is + # Linux-only. This is not applied to Android, but is applied to ChromeOS. + config("compiler") { ++ cflags_cc = [ "-Wno-changes-meaning" ] + if (current_cpu == "arm64") { + import("//build/config/arm.gni") + cflags = [] diff --git a/webrtc-sys/libwebrtc/patches/ssl_verify_callback_with_native_handle.patch b/webrtc-sys/libwebrtc/patches/ssl_verify_callback_with_native_handle.patch index ccfb138f7..df2a8ed69 100644 --- a/webrtc-sys/libwebrtc/patches/ssl_verify_callback_with_native_handle.patch +++ b/webrtc-sys/libwebrtc/patches/ssl_verify_callback_with_native_handle.patch @@ -1,8 +1,8 @@ diff --git a/rtc_base/boringssl_certificate.cc b/rtc_base/boringssl_certificate.cc -index 99b2ab3e24..c37d6d963f 100644 +index 016b4dabba..1a0c1b8d42 100644 --- a/rtc_base/boringssl_certificate.cc +++ b/rtc_base/boringssl_certificate.cc -@@ -253,6 +253,12 @@ BoringSSLCertificate::BoringSSLCertificate( +@@ -259,6 +259,12 @@ BoringSSLCertificate::BoringSSLCertificate( RTC_DCHECK(cert_buffer_ != nullptr); } @@ -16,10 +16,10 @@ index 99b2ab3e24..c37d6d963f 100644 OpenSSLKeyPair* key_pair, const SSLIdentityParams& params) { diff --git a/rtc_base/boringssl_certificate.h b/rtc_base/boringssl_certificate.h -index 8b4577a17c..e1fe26cba5 100644 +index 926dd332ec..5c62c63390 100644 --- a/rtc_base/boringssl_certificate.h +++ b/rtc_base/boringssl_certificate.h -@@ -33,6 +33,7 @@ class OpenSSLKeyPair; +@@ -34,6 +34,7 @@ namespace webrtc { class BoringSSLCertificate final : public SSLCertificate { public: explicit BoringSSLCertificate(bssl::UniquePtr cert_buffer); @@ -27,7 +27,7 @@ index 8b4577a17c..e1fe26cba5 100644 static std::unique_ptr Generate( OpenSSLKeyPair* key_pair, -@@ -74,6 +75,11 @@ class BoringSSLCertificate final : public SSLCertificate { +@@ -66,6 +67,11 @@ class BoringSSLCertificate final : public SSLCertificate { private: // A handle to the DER encoded certificate data. bssl::UniquePtr cert_buffer_; @@ -38,12 +38,12 @@ index 8b4577a17c..e1fe26cba5 100644 + SSL* ssl() const { return ssl_; } }; - } // namespace rtc + } // namespace webrtc diff --git a/rtc_base/openssl_adapter.cc b/rtc_base/openssl_adapter.cc -index bc10e619eb..836ef9ea18 100644 +index cb5dfc6a85..a2de51ee74 100644 --- a/rtc_base/openssl_adapter.cc +++ b/rtc_base/openssl_adapter.cc -@@ -822,7 +822,7 @@ enum ssl_verify_result_t OpenSSLAdapter::SSLVerifyInternal(SSL* ssl, +@@ -840,7 +840,7 @@ enum ssl_verify_result_t OpenSSLAdapter::SSLVerifyInternal(SSL* ssl, return ssl_verify_invalid; } @@ -52,20 +52,20 @@ index bc10e619eb..836ef9ea18 100644 if (!ssl_cert_verifier_->Verify(cert)) { RTC_LOG(LS_WARNING) << "Failed to verify certificate using custom callback"; return ssl_verify_invalid; -@@ -894,7 +894,7 @@ int OpenSSLAdapter::SSLVerifyInternal(int previous_status, +@@ -912,7 +912,7 @@ int OpenSSLAdapter::SSLVerifyInternal(int previous_status, RTC_LOG(LS_ERROR) << "Failed to allocate CRYPTO_BUFFER."; return previous_status; } - const BoringSSLCertificate cert(std::move(crypto_buffer)); + const BoringSSLCertificate cert(std::move(crypto_buffer), ssl); #else - const OpenSSLCertificate cert(X509_STORE_CTX_get_current_cert(store)); + const webrtc::OpenSSLCertificate cert(X509_STORE_CTX_get_current_cert(store)); #endif diff --git a/rtc_base/openssl_stream_adapter.cc b/rtc_base/openssl_stream_adapter.cc -index dd82e4f061..6d7e39c534 100644 +index b46faff911..537171b1f3 100644 --- a/rtc_base/openssl_stream_adapter.cc +++ b/rtc_base/openssl_stream_adapter.cc -@@ -1154,7 +1154,7 @@ enum ssl_verify_result_t OpenSSLStreamAdapter::SSLVerifyCallback( +@@ -1181,7 +1181,7 @@ enum ssl_verify_result_t OpenSSLStreamAdapter::SSLVerifyCallback( // Creates certificate chain. std::vector> cert_chain; for (CRYPTO_BUFFER* cert : chain) { diff --git a/webrtc-sys/src/apm.cpp b/webrtc-sys/src/apm.cpp index 0c6bcd1ec..4fe34d2be 100644 --- a/webrtc-sys/src/apm.cpp +++ b/webrtc-sys/src/apm.cpp @@ -1,5 +1,8 @@ #include "livekit/apm.h" +#include "api/audio/builtin_audio_processing_builder.h" +#include "api/environment/environment_factory.h" + #include #include @@ -7,7 +10,8 @@ namespace livekit { AudioProcessingModule::AudioProcessingModule( const AudioProcessingConfig& config) { - apm_ = webrtc::AudioProcessingBuilder().Create(); + apm_ = webrtc::BuiltinAudioProcessingBuilder() + .Build(webrtc::CreateEnvironment()); apm_->ApplyConfig(config.ToWebrtcConfig()); apm_->Initialize(); diff --git a/webrtc-sys/src/audio_device.cpp b/webrtc-sys/src/audio_device.cpp index d146a0c8a..364ca01f7 100644 --- a/webrtc-sys/src/audio_device.cpp +++ b/webrtc-sys/src/audio_device.cpp @@ -328,7 +328,7 @@ int AudioDevice::GetRecordAudioParameters( } #endif // WEBRTC_IOS -int32_t AudioDevice::SetAudioDeviceSink(webrtc::AudioDeviceSink* sink) const { +int32_t AudioDevice::SetObserver(webrtc::AudioDeviceObserver* observer) { return 0; } diff --git a/webrtc-sys/src/audio_resampler.cpp b/webrtc-sys/src/audio_resampler.cpp index cbb6060d4..8618018c8 100644 --- a/webrtc-sys/src/audio_resampler.cpp +++ b/webrtc-sys/src/audio_resampler.cpp @@ -19,6 +19,7 @@ #include #include "audio/remix_resample.h" +#include "api/audio/audio_view.h" namespace livekit { @@ -30,8 +31,10 @@ size_t AudioResampler::remix_and_resample(const int16_t* src, int dest_sample_rate) { frame_.num_channels_ = dest_num_channels; frame_.sample_rate_hz_ = dest_sample_rate; - webrtc::voe::RemixAndResample(src, samples_per_channel, num_channels, - sample_rate, &resampler_, &frame_); + webrtc::InterleavedView source(static_cast(src), + samples_per_channel, + num_channels); + webrtc::voe::RemixAndResample(source, sample_rate, &resampler_, &frame_); return frame_.num_channels() * frame_.samples_per_channel() * sizeof(int16_t); } diff --git a/webrtc-sys/src/audio_track.cpp b/webrtc-sys/src/audio_track.cpp index 8ca76e801..16e62f4c2 100644 --- a/webrtc-sys/src/audio_track.cpp +++ b/webrtc-sys/src/audio_track.cpp @@ -56,7 +56,7 @@ inline AudioSourceOptions to_rust_audio_options( } AudioTrack::AudioTrack(std::shared_ptr rtc_runtime, - rtc::scoped_refptr track) + webrtc::scoped_refptr track) : MediaStreamTrack(rtc_runtime, std::move(track)) {} AudioTrack::~AudioTrack() { @@ -99,9 +99,11 @@ void NativeAudioSink::OnData(const void* audio_data, const int16_t* data = static_cast(audio_data); if (sample_rate_ != sample_rate || num_channels_ != number_of_channels) { + webrtc::InterleavedView source(static_cast(data), + number_of_frames, + number_of_channels); // resample/remix before capturing - webrtc::voe::RemixAndResample(data, number_of_frames, number_of_channels, - sample_rate, &resampler_, &frame_); + webrtc::voe::RemixAndResample(source, sample_rate, &resampler_, &frame_); rust::Slice rust_slice( frame_.data(), frame_.num_channels() * frame_.samples_per_channel()); @@ -270,7 +272,7 @@ AudioTrackSource::AudioTrackSource(AudioSourceOptions options, int num_channels, int queue_size_ms, webrtc::TaskQueueFactory* task_queue_factory) - : source_(rtc::make_ref_counted( + : source_(webrtc::make_ref_counted( to_native_audio_options(options), sample_rate, num_channels, @@ -311,7 +313,7 @@ std::shared_ptr new_audio_track_source( GetGlobalTaskQueueFactory()); } -rtc::scoped_refptr AudioTrackSource::get() +webrtc::scoped_refptr AudioTrackSource::get() const { return source_; } diff --git a/webrtc-sys/src/data_channel.cpp b/webrtc-sys/src/data_channel.cpp index bec5cef4e..70d15122e 100644 --- a/webrtc-sys/src/data_channel.cpp +++ b/webrtc-sys/src/data_channel.cpp @@ -37,14 +37,14 @@ webrtc::DataChannelInit to_native_data_channel_init(DataChannelInit init) { rtc_init.maxRetransmits = init.max_retransmits; if (init.has_priority) - rtc_init.priority = static_cast(init.priority); + rtc_init.priority = webrtc::PriorityValue(static_cast(init.priority)); return rtc_init; } DataChannel::DataChannel( std::shared_ptr rtc_runtime, - rtc::scoped_refptr data_channel) + webrtc::scoped_refptr data_channel) : rtc_runtime_(rtc_runtime), data_channel_(std::move(data_channel)) { RTC_LOG(LS_VERBOSE) << "DataChannel::DataChannel()"; } @@ -73,7 +73,7 @@ void DataChannel::unregister_observer() const { bool DataChannel::send(const DataBuffer& buffer) const { return data_channel_->Send(webrtc::DataBuffer{ - rtc::CopyOnWriteBuffer(buffer.ptr, buffer.len), buffer.binary}); + webrtc::CopyOnWriteBuffer(buffer.ptr, buffer.len), buffer.binary}); } int DataChannel::id() const { diff --git a/webrtc-sys/src/media_stream.cpp b/webrtc-sys/src/media_stream.cpp index ed6f78e10..3a4ad1275 100644 --- a/webrtc-sys/src/media_stream.cpp +++ b/webrtc-sys/src/media_stream.cpp @@ -33,7 +33,7 @@ namespace livekit { MediaStream::MediaStream( std::shared_ptr rtc_runtime, - rtc::scoped_refptr stream) + webrtc::scoped_refptr stream) : rtc_runtime_(rtc_runtime), media_stream_(std::move(stream)) {} rust::String MediaStream::id() const { @@ -73,12 +73,12 @@ std::shared_ptr MediaStream::find_video_track( bool MediaStream::add_track(std::shared_ptr track) const { if (track->kind() == webrtc::MediaStreamTrackInterface::kVideoKind) { return media_stream_->AddTrack( - rtc::scoped_refptr( + webrtc::scoped_refptr( static_cast( track->rtc_track().get()))); } else { return media_stream_->AddTrack( - rtc::scoped_refptr( + webrtc::scoped_refptr( static_cast( track->rtc_track().get()))); } @@ -87,12 +87,12 @@ bool MediaStream::add_track(std::shared_ptr track) const { bool MediaStream::remove_track(std::shared_ptr track) const { if (track->kind() == webrtc::MediaStreamTrackInterface::kVideoKind) { return media_stream_->RemoveTrack( - rtc::scoped_refptr( + webrtc::scoped_refptr( static_cast( track->rtc_track().get()))); } else { return media_stream_->RemoveTrack( - rtc::scoped_refptr( + webrtc::scoped_refptr( static_cast( track->rtc_track().get()))); } diff --git a/webrtc-sys/src/media_stream_track.cpp b/webrtc-sys/src/media_stream_track.cpp index dafefca60..1f9fc1e3c 100644 --- a/webrtc-sys/src/media_stream_track.cpp +++ b/webrtc-sys/src/media_stream_track.cpp @@ -32,7 +32,7 @@ namespace livekit { MediaStreamTrack::MediaStreamTrack( std::shared_ptr rtc_runtime, - rtc::scoped_refptr track) + webrtc::scoped_refptr track) : rtc_runtime_(rtc_runtime), track_(std::move(track)) {} rust::String MediaStreamTrack::kind() const { diff --git a/webrtc-sys/src/nvidia/h264_decoder_impl.cpp b/webrtc-sys/src/nvidia/h264_decoder_impl.cpp index 3ba449b38..af716c503 100644 --- a/webrtc-sys/src/nvidia/h264_decoder_impl.cpp +++ b/webrtc-sys/src/nvidia/h264_decoder_impl.cpp @@ -110,8 +110,8 @@ int32_t NvidiaH264DecoderImpl::Decode(const EncodedImage& input_image, } h264_bitstream_parser_.ParseBitstream(input_image); - absl::optional qp = h264_bitstream_parser_.GetLastSliceQp(); - absl::optional sps = h264_bitstream_parser_.sps(); + std::optional qp = h264_bitstream_parser_.GetLastSliceQp(); + std::optional sps = h264_bitstream_parser_.sps(); if (is_configured_decoder_) { if (!sps || @@ -149,7 +149,7 @@ int32_t NvidiaH264DecoderImpl::Decode(const EncodedImage& input_image, int64_t timeStamp; uint8_t* pFrame = decoder_->GetFrame(&timeStamp); - rtc::scoped_refptr i420_buffer = + webrtc::scoped_refptr i420_buffer = buffer_pool_.CreateI420Buffer(decoder_->GetWidth(), decoder_->GetHeight()); @@ -176,7 +176,7 @@ int32_t NvidiaH264DecoderImpl::Decode(const EncodedImage& input_image, .build(); // todo: measurement decoding time - absl::optional decodetime; + std::optional decodetime; decoded_complete_callback_->Decoded(decoded_frame, decodetime, qp); } diff --git a/webrtc-sys/src/nvidia/h264_decoder_impl.h b/webrtc-sys/src/nvidia/h264_decoder_impl.h index 882f8f0f7..4674a3b5c 100644 --- a/webrtc-sys/src/nvidia/h264_decoder_impl.h +++ b/webrtc-sys/src/nvidia/h264_decoder_impl.h @@ -20,8 +20,8 @@ namespace webrtc { class H264BitstreamParserEx : public ::webrtc::H264BitstreamParser { public: - absl::optional sps() { return sps_; } - absl::optional pps() { return pps_; } + std::optional sps() { return sps_; } + std::optional pps() { return pps_; } }; class NvidiaH264DecoderImpl : public VideoDecoder { diff --git a/webrtc-sys/src/nvidia/h264_encoder_impl.cpp b/webrtc-sys/src/nvidia/h264_encoder_impl.cpp index f32e72a42..cd8ed881c 100644 --- a/webrtc-sys/src/nvidia/h264_encoder_impl.cpp +++ b/webrtc-sys/src/nvidia/h264_encoder_impl.cpp @@ -80,7 +80,8 @@ NvidiaH264EncoderImpl::NvidiaH264EncoderImpl( CUmemorytype memory_type, NV_ENC_BUFFER_FORMAT nv_format, const SdpVideoFormat& format) - : encoder_(nullptr), + : env_(env), + encoder_(nullptr), cu_context_(context), cu_memory_type_(memory_type), cu_scaled_array_(nullptr), @@ -89,7 +90,7 @@ NvidiaH264EncoderImpl::NvidiaH264EncoderImpl( H264EncoderSettings::Parse(format).packetization_mode), format_(format) { std::string hexString = format_.parameters.at("profile-level-id"); - absl::optional profile_level_id = + std::optional profile_level_id = webrtc::ParseH264ProfileLevelId(hexString.c_str()); if (profile_level_id.has_value()) { profile_ = profile_level_id->profile; @@ -237,7 +238,7 @@ int32_t NvidiaH264EncoderImpl::InitEncode( return WEBRTC_VIDEO_CODEC_ERROR; } - SimulcastRateAllocator init_allocator(codec_); + SimulcastRateAllocator init_allocator(env_, codec_); VideoBitrateAllocation allocation = init_allocator.Allocate(VideoBitrateAllocationParameters( DataRate::KilobitsPerSec(codec_.startBitrate), codec_.maxFramerate)); @@ -279,7 +280,7 @@ int32_t NvidiaH264EncoderImpl::Encode( return WEBRTC_VIDEO_CODEC_UNINITIALIZED; } - rtc::scoped_refptr frame_buffer = + webrtc::scoped_refptr frame_buffer = input_frame.video_frame_buffer()->ToI420(); if (!frame_buffer) { RTC_LOG(LS_ERROR) << "Failed to convert " @@ -361,7 +362,7 @@ int32_t NvidiaH264EncoderImpl::ProcessEncodedFrame( const ::webrtc::VideoFrame& inputFrame) { encoded_image_._encodedWidth = encoder_->GetEncodeWidth(); encoded_image_._encodedHeight = encoder_->GetEncodeHeight(); - encoded_image_.SetRtpTimestamp(inputFrame.timestamp()); + encoded_image_.SetRtpTimestamp(inputFrame.rtp_timestamp()); encoded_image_.SetSimulcastIndex(0); encoded_image_.ntp_time_ms_ = inputFrame.ntp_time_ms(); encoded_image_.capture_time_ms_ = inputFrame.render_time_ms(); @@ -371,7 +372,7 @@ int32_t NvidiaH264EncoderImpl::ProcessEncodedFrame( encoded_image_._frameType = VideoFrameType::kVideoFrameDelta; encoded_image_.SetColorSpace(inputFrame.color_space()); std::vector naluIndices = - H264::FindNaluIndices(packet.data(), packet.size()); + H264::FindNaluIndices(MakeArrayView(packet.data(), packet.size())); for (uint32_t i = 0; i < naluIndices.size(); i++) { const H264::NaluType naluType = H264::ParseNaluType(packet[naluIndices[i].payload_start_offset]); diff --git a/webrtc-sys/src/nvidia/h264_encoder_impl.h b/webrtc-sys/src/nvidia/h264_encoder_impl.h index d1009fbb1..b50a7e308 100644 --- a/webrtc-sys/src/nvidia/h264_encoder_impl.h +++ b/webrtc-sys/src/nvidia/h264_encoder_impl.h @@ -67,6 +67,7 @@ class NvidiaH264EncoderImpl : public VideoEncoder { int32_t ProcessEncodedFrame(std::vector& packet, const ::webrtc::VideoFrame& inputFrame); private: + const webrtc::Environment& env_; EncodedImageCallback* encoded_image_callback_ = nullptr; std::unique_ptr encoder_; diff --git a/webrtc-sys/src/objc_video_frame_buffer.mm b/webrtc-sys/src/objc_video_frame_buffer.mm index e8490beb1..6621b0f8e 100644 --- a/webrtc-sys/src/objc_video_frame_buffer.mm +++ b/webrtc-sys/src/objc_video_frame_buffer.mm @@ -26,7 +26,7 @@ CVPixelBufferRef pixelBuffer ) { RTCCVPixelBuffer *buffer = [[RTCCVPixelBuffer alloc] initWithPixelBuffer:pixelBuffer]; - rtc::scoped_refptr frame_buffer = webrtc::ObjCToNativeVideoFrameBuffer(buffer); + webrtc::scoped_refptr frame_buffer = webrtc::ObjCToNativeVideoFrameBuffer(buffer); [buffer release]; CVPixelBufferRelease(pixelBuffer); return std::make_unique(frame_buffer); diff --git a/webrtc-sys/src/peer_connection.cpp b/webrtc-sys/src/peer_connection.cpp index a3de766c6..17944ebf9 100644 --- a/webrtc-sys/src/peer_connection.cpp +++ b/webrtc-sys/src/peer_connection.cpp @@ -73,7 +73,7 @@ to_native_offer_answer_options(const RtcOfferAnswerOptions& options) { PeerConnection::PeerConnection( std::shared_ptr rtc_runtime, - rtc::scoped_refptr pc_factory, + webrtc::scoped_refptr pc_factory, rust::Box observer) : rtc_runtime_(std::move(rtc_runtime)), pc_factory_(std::move(pc_factory)), @@ -115,8 +115,8 @@ void PeerConnection::create_offer( rust::Fn, std::unique_ptr)> on_success, rust::Fn, RtcError)> on_error) const { - rtc::scoped_refptr observer = - rtc::make_ref_counted(std::move(ctx), on_success, + webrtc::scoped_refptr observer = + webrtc::make_ref_counted(std::move(ctx), on_success, on_error); peer_connection_->CreateOffer(observer.get(), @@ -129,8 +129,8 @@ void PeerConnection::create_answer( rust::Fn, std::unique_ptr)> on_success, rust::Fn, RtcError)> on_error) const { - rtc::scoped_refptr observer = - rtc::make_ref_counted(std::move(ctx), on_success, + webrtc::scoped_refptr observer = + webrtc::make_ref_counted(std::move(ctx), on_success, on_error); peer_connection_->CreateAnswer(observer.get(), @@ -141,8 +141,8 @@ void PeerConnection::set_local_description( std::unique_ptr desc, rust::Box ctx, rust::Fn, RtcError)> on_complete) const { - rtc::scoped_refptr observer = - rtc::make_ref_counted(std::move(ctx), + webrtc::scoped_refptr observer = + webrtc::make_ref_counted(std::move(ctx), on_complete); peer_connection_->SetLocalDescription(desc->clone()->release(), observer); @@ -152,8 +152,8 @@ void PeerConnection::set_remote_description( std::unique_ptr desc, rust::Box ctx, rust::Fn, RtcError)> on_complete) const { - rtc::scoped_refptr observer = - rtc::make_ref_counted(std::move(ctx), + webrtc::scoped_refptr observer = + webrtc::make_ref_counted(std::move(ctx), on_complete); peer_connection_->SetRemoteDescription(desc->clone()->release(), observer); @@ -209,7 +209,7 @@ void PeerConnection::remove_track(std::shared_ptr sender) const { void PeerConnection::get_stats( rust::Box ctx, rust::Fn, rust::String)> on_stats) const { - auto observer = rtc::make_ref_counted>( + auto observer = webrtc::make_ref_counted>( std::move(ctx), on_stats); peer_connection_->GetStats(observer.get()); } @@ -230,7 +230,7 @@ std::shared_ptr PeerConnection::add_transceiver_for_media( MediaType media_type, RtpTransceiverInit init) const { auto result = peer_connection_->AddTransceiver( - static_cast(media_type), + static_cast(media_type), to_native_rtp_transceiver_init(init)); if (!result.ok()) @@ -350,19 +350,19 @@ void PeerConnection::OnSignalingChange( } void PeerConnection::OnAddStream( - rtc::scoped_refptr stream) { + webrtc::scoped_refptr stream) { observer_->on_add_stream(std::make_unique(rtc_runtime_, stream)); } void PeerConnection::OnRemoveStream( - rtc::scoped_refptr stream) { + webrtc::scoped_refptr stream) { // Find current MediaStream // observer_->on_remove_stream(std::make_unique(rtc_runtime_, // stream)); } void PeerConnection::OnDataChannel( - rtc::scoped_refptr data_channel) { + webrtc::scoped_refptr data_channel) { observer_->on_data_channel( std::make_shared(rtc_runtime_, data_channel)); } @@ -444,8 +444,8 @@ void PeerConnection::OnIceSelectedCandidatePairChanged( } void PeerConnection::OnAddTrack( - rtc::scoped_refptr receiver, - const std::vector>& + webrtc::scoped_refptr receiver, + const std::vector>& streams) { rust::Vec vec; @@ -460,13 +460,13 @@ void PeerConnection::OnAddTrack( } void PeerConnection::OnTrack( - rtc::scoped_refptr transceiver) { + webrtc::scoped_refptr transceiver) { observer_->on_track(std::make_unique( rtc_runtime_, transceiver, peer_connection_)); } void PeerConnection::OnRemoveTrack( - rtc::scoped_refptr receiver) { + webrtc::scoped_refptr receiver) { observer_->on_remove_track( std::make_unique(rtc_runtime_, receiver, peer_connection_)); } diff --git a/webrtc-sys/src/peer_connection_factory.cpp b/webrtc-sys/src/peer_connection_factory.cpp index 31b32729e..2980a36e5 100644 --- a/webrtc-sys/src/peer_connection_factory.cpp +++ b/webrtc-sys/src/peer_connection_factory.cpp @@ -21,7 +21,10 @@ #include "api/audio_codecs/builtin_audio_decoder_factory.h" #include "api/audio_codecs/builtin_audio_encoder_factory.h" +#include "api/audio/builtin_audio_processing_builder.h" +#include "api/environment/environment_factory.h" #include "api/peer_connection_interface.h" +#include "api/transport/field_trial_based_config.h" #include "api/rtc_error.h" #include "api/enable_media.h" #include "api/rtc_event_log/rtc_event_log_factory.h" @@ -59,7 +62,7 @@ PeerConnectionFactory::PeerConnectionFactory( dependencies.trials = std::make_unique(); audio_device_ = rtc_runtime_->worker_thread()->BlockingCall([&] { - return rtc::make_ref_counted( + return webrtc::make_ref_counted( dependencies.task_queue_factory.get()); }); @@ -71,7 +74,8 @@ PeerConnectionFactory::PeerConnectionFactory( std::move(std::make_unique()); dependencies.audio_encoder_factory = webrtc::CreateBuiltinAudioEncoderFactory(); dependencies.audio_decoder_factory = webrtc::CreateBuiltinAudioDecoderFactory(); - dependencies.audio_processing = webrtc::AudioProcessingBuilder().Create(); + dependencies.audio_processing = webrtc::BuiltinAudioProcessingBuilder() + .Build(webrtc::CreateEnvironment()); webrtc::EnableMedia(dependencies); peer_factory_ = @@ -127,13 +131,13 @@ std::shared_ptr PeerConnectionFactory::create_audio_track( RtpCapabilities PeerConnectionFactory::rtp_sender_capabilities( MediaType type) const { return to_rust_rtp_capabilities(peer_factory_->GetRtpSenderCapabilities( - static_cast(type))); + static_cast(type))); } RtpCapabilities PeerConnectionFactory::rtp_receiver_capabilities( MediaType type) const { return to_rust_rtp_capabilities(peer_factory_->GetRtpReceiverCapabilities( - static_cast(type))); + static_cast(type))); } std::shared_ptr create_peer_connection_factory() { diff --git a/webrtc-sys/src/rtp_parameters.cpp b/webrtc-sys/src/rtp_parameters.cpp index 75bbcd4c9..66ffe0d99 100644 --- a/webrtc-sys/src/rtp_parameters.cpp +++ b/webrtc-sys/src/rtp_parameters.cpp @@ -34,7 +34,7 @@ webrtc::RtpCodecCapability to_native_rtp_codec_capability( // native.mime_type(); IGNORED native.name = capability.name.c_str(); - native.kind = static_cast(capability.kind); + native.kind = static_cast(capability.kind); if (capability.has_clock_rate) native.clock_rate = capability.clock_rate; @@ -133,7 +133,7 @@ webrtc::RtpCodecParameters to_native_rtp_codec_parameters( RtpCodecParameters params) { webrtc::RtpCodecParameters native{}; native.name = params.name.c_str(); - native.kind = static_cast(params.kind); + native.kind = static_cast(params.kind); native.payload_type = params.payload_type; for (auto pair : params.parameters) diff --git a/webrtc-sys/src/rtp_receiver.cpp b/webrtc-sys/src/rtp_receiver.cpp index 857f7a71a..04524c0c9 100644 --- a/webrtc-sys/src/rtp_receiver.cpp +++ b/webrtc-sys/src/rtp_receiver.cpp @@ -27,8 +27,8 @@ namespace livekit { RtpReceiver::RtpReceiver( std::shared_ptr rtc_runtime, - rtc::scoped_refptr receiver, - rtc::scoped_refptr peer_connection) + webrtc::scoped_refptr receiver, + webrtc::scoped_refptr peer_connection) : rtc_runtime_(rtc_runtime), receiver_(std::move(receiver)), peer_connection_(std::move(peer_connection)) {} @@ -48,7 +48,7 @@ void RtpReceiver::get_stats( rust::Box ctx, rust::Fn, rust::String)> on_stats) const { auto observer = - rtc::make_ref_counted>(std::move(ctx), on_stats); + webrtc::make_ref_counted>(std::move(ctx), on_stats); peer_connection_->GetStats(receiver_, observer); } diff --git a/webrtc-sys/src/rtp_sender.cpp b/webrtc-sys/src/rtp_sender.cpp index 8d5008f81..f56477466 100644 --- a/webrtc-sys/src/rtp_sender.cpp +++ b/webrtc-sys/src/rtp_sender.cpp @@ -26,8 +26,8 @@ namespace livekit { RtpSender::RtpSender( std::shared_ptr rtc_runtime, - rtc::scoped_refptr sender, - rtc::scoped_refptr peer_connection) + webrtc::scoped_refptr sender, + webrtc::scoped_refptr peer_connection) : rtc_runtime_(rtc_runtime), sender_(std::move(sender)), peer_connection_(std::move(peer_connection)) {} @@ -48,7 +48,7 @@ void RtpSender::get_stats( rust::Box ctx, rust::Fn, rust::String)> on_stats) const { auto observer = - rtc::make_ref_counted>(std::move(ctx), on_stats); + webrtc::make_ref_counted>(std::move(ctx), on_stats); peer_connection_->GetStats(sender_, observer); } diff --git a/webrtc-sys/src/rtp_transceiver.cpp b/webrtc-sys/src/rtp_transceiver.cpp index 82eb73b2f..62c20dcb2 100644 --- a/webrtc-sys/src/rtp_transceiver.cpp +++ b/webrtc-sys/src/rtp_transceiver.cpp @@ -38,8 +38,8 @@ webrtc::RtpTransceiverInit to_native_rtp_transceiver_init( RtpTransceiver::RtpTransceiver( std::shared_ptr rtc_runtime, - rtc::scoped_refptr transceiver, - rtc::scoped_refptr peer_connection) + webrtc::scoped_refptr transceiver, + webrtc::scoped_refptr peer_connection) : rtc_runtime_(rtc_runtime), transceiver_(std::move(transceiver)), peer_connection_(std::move(peer_connection)) {} diff --git a/webrtc-sys/src/vaapi/h264_encoder_impl.cpp b/webrtc-sys/src/vaapi/h264_encoder_impl.cpp index ec7965997..b2232bdcd 100644 --- a/webrtc-sys/src/vaapi/h264_encoder_impl.cpp +++ b/webrtc-sys/src/vaapi/h264_encoder_impl.cpp @@ -34,12 +34,13 @@ enum H264EncoderImplEvent { VAAPIH264EncoderWrapper::VAAPIH264EncoderWrapper(const webrtc::Environment& env, const SdpVideoFormat& format) - : encoder_(new livekit::VaapiH264EncoderWrapper()), + : env_(env), + encoder_(new livekit::VaapiH264EncoderWrapper()), packetization_mode_( H264EncoderSettings::Parse(format).packetization_mode), format_(format) { std::string hexString = format_.parameters.at("profile-level-id"); - absl::optional profile_level_id = + std::optional profile_level_id = webrtc::ParseH264ProfileLevelId(hexString.c_str()); if (profile_level_id.has_value()) { profile_ = profile_level_id->profile; @@ -152,7 +153,7 @@ int32_t VAAPIH264EncoderWrapper::InitEncode( va_profile, VA_RC_CBR); } - SimulcastRateAllocator init_allocator(codec_); + SimulcastRateAllocator init_allocator(env_, codec_); VideoBitrateAllocation allocation = init_allocator.Allocate(VideoBitrateAllocationParameters( DataRate::KilobitsPerSec(codec_.startBitrate), codec_.maxFramerate)); @@ -189,7 +190,7 @@ int32_t VAAPIH264EncoderWrapper::Encode( return WEBRTC_VIDEO_CODEC_UNINITIALIZED; } - rtc::scoped_refptr frame_buffer = + webrtc::scoped_refptr frame_buffer = input_frame.video_frame_buffer()->ToI420(); if (!frame_buffer) { RTC_LOG(LS_ERROR) << "Failed to convert " diff --git a/webrtc-sys/src/vaapi/h264_encoder_impl.h b/webrtc-sys/src/vaapi/h264_encoder_impl.h index ad67e7fb5..be800a757 100644 --- a/webrtc-sys/src/vaapi/h264_encoder_impl.h +++ b/webrtc-sys/src/vaapi/h264_encoder_impl.h @@ -61,6 +61,7 @@ class VAAPIH264EncoderWrapper : public VideoEncoder { VAProfile GetVAProfile() const; private: + const webrtc::Environment& env_; EncodedImageCallback* encoded_image_callback_ = nullptr; std::unique_ptr encoder_; LayerConfig configuration_; diff --git a/webrtc-sys/src/video_encoder_factory.cpp b/webrtc-sys/src/video_encoder_factory.cpp index 351a5c79f..953c9be6d 100644 --- a/webrtc-sys/src/video_encoder_factory.cpp +++ b/webrtc-sys/src/video_encoder_factory.cpp @@ -98,7 +98,7 @@ VideoEncoderFactory::InternalFactory::GetSupportedFormats() const { VideoEncoderFactory::CodecSupport VideoEncoderFactory::InternalFactory::QueryCodecSupport( const webrtc::SdpVideoFormat& format, - absl::optional scalability_mode) const { + std::optional scalability_mode) const { auto original_format = webrtc::FuzzyMatchSdpVideoFormat(Factory().GetSupportedFormats(), format); return original_format @@ -139,7 +139,7 @@ std::vector VideoEncoderFactory::GetSupportedFormats() VideoEncoderFactory::CodecSupport VideoEncoderFactory::QueryCodecSupport( const webrtc::SdpVideoFormat& format, - absl::optional scalability_mode) const { + std::optional scalability_mode) const { return internal_factory_->QueryCodecSupport(format, scalability_mode); } diff --git a/webrtc-sys/src/video_frame.cpp b/webrtc-sys/src/video_frame.cpp index ad082bdb8..e2dfc0a1c 100644 --- a/webrtc-sys/src/video_frame.cpp +++ b/webrtc-sys/src/video_frame.cpp @@ -43,7 +43,7 @@ int64_t VideoFrame::ntp_time_ms() const { return frame_.ntp_time_ms(); } uint32_t VideoFrame::timestamp() const { - return frame_.timestamp(); + return frame_.rtp_timestamp(); } VideoRotation VideoFrame::rotation() const { diff --git a/webrtc-sys/src/video_frame_buffer.cpp b/webrtc-sys/src/video_frame_buffer.cpp index b33ccf18a..32d5c0320 100644 --- a/webrtc-sys/src/video_frame_buffer.cpp +++ b/webrtc-sys/src/video_frame_buffer.cpp @@ -21,7 +21,7 @@ namespace livekit { VideoFrameBuffer::VideoFrameBuffer( - rtc::scoped_refptr buffer) + webrtc::scoped_refptr buffer) : buffer_(std::move(buffer)) {} VideoFrameBufferType VideoFrameBuffer::buffer_type() const { @@ -43,46 +43,46 @@ std::unique_ptr VideoFrameBuffer::to_i420() const { // const_cast is valid here because we take the ownership on the rust side std::unique_ptr VideoFrameBuffer::get_i420() { return std::make_unique( - rtc::scoped_refptr( + webrtc::scoped_refptr( const_cast(buffer_->GetI420()))); } std::unique_ptr VideoFrameBuffer::get_i420a() { return std::make_unique( - rtc::scoped_refptr( + webrtc::scoped_refptr( const_cast(buffer_->GetI420A()))); } std::unique_ptr VideoFrameBuffer::get_i422() { return std::make_unique( - rtc::scoped_refptr( + webrtc::scoped_refptr( const_cast(buffer_->GetI422()))); } std::unique_ptr VideoFrameBuffer::get_i444() { return std::make_unique( - rtc::scoped_refptr( + webrtc::scoped_refptr( const_cast(buffer_->GetI444()))); } std::unique_ptr VideoFrameBuffer::get_i010() { return std::make_unique( - rtc::scoped_refptr( + webrtc::scoped_refptr( const_cast(buffer_->GetI010()))); } std::unique_ptr VideoFrameBuffer::get_nv12() { return std::make_unique( - rtc::scoped_refptr( + webrtc::scoped_refptr( const_cast(buffer_->GetNV12()))); } -rtc::scoped_refptr VideoFrameBuffer::get() const { +webrtc::scoped_refptr VideoFrameBuffer::get() const { return buffer_; } PlanarYuvBuffer::PlanarYuvBuffer( - rtc::scoped_refptr buffer) + webrtc::scoped_refptr buffer) : VideoFrameBuffer(buffer) {} unsigned int PlanarYuvBuffer::chroma_width() const { @@ -110,7 +110,7 @@ webrtc::PlanarYuvBuffer* PlanarYuvBuffer::buffer() const { } PlanarYuv8Buffer::PlanarYuv8Buffer( - rtc::scoped_refptr buffer) + webrtc::scoped_refptr buffer) : PlanarYuvBuffer(buffer) {} const uint8_t* PlanarYuv8Buffer::data_y() const { @@ -130,7 +130,7 @@ webrtc::PlanarYuv8Buffer* PlanarYuv8Buffer::buffer() const { } PlanarYuv16BBuffer::PlanarYuv16BBuffer( - rtc::scoped_refptr buffer) + webrtc::scoped_refptr buffer) : PlanarYuvBuffer(buffer) {} const uint16_t* PlanarYuv16BBuffer::data_y() const { @@ -150,7 +150,7 @@ webrtc::PlanarYuv16BBuffer* PlanarYuv16BBuffer::buffer() const { } BiplanarYuvBuffer::BiplanarYuvBuffer( - rtc::scoped_refptr buffer) + webrtc::scoped_refptr buffer) : VideoFrameBuffer(buffer) {} unsigned int BiplanarYuvBuffer::chroma_width() const { @@ -174,7 +174,7 @@ webrtc::BiplanarYuvBuffer* BiplanarYuvBuffer::buffer() const { } BiplanarYuv8Buffer::BiplanarYuv8Buffer( - rtc::scoped_refptr buffer) + webrtc::scoped_refptr buffer) : BiplanarYuvBuffer(buffer) {} const uint8_t* BiplanarYuv8Buffer::data_y() const { @@ -189,11 +189,11 @@ webrtc::BiplanarYuv8Buffer* BiplanarYuv8Buffer::buffer() const { return static_cast(buffer_.get()); } -I420Buffer::I420Buffer(rtc::scoped_refptr buffer) +I420Buffer::I420Buffer(webrtc::scoped_refptr buffer) : PlanarYuv8Buffer(buffer) {} I420ABuffer::I420ABuffer( - rtc::scoped_refptr buffer) + webrtc::scoped_refptr buffer) : I420Buffer(buffer) {} unsigned int I420ABuffer::stride_a() const { @@ -208,16 +208,16 @@ webrtc::I420ABufferInterface* I420ABuffer::buffer() const { return static_cast(buffer_.get()); } -I422Buffer::I422Buffer(rtc::scoped_refptr buffer) +I422Buffer::I422Buffer(webrtc::scoped_refptr buffer) : PlanarYuv8Buffer(buffer) {} -I444Buffer::I444Buffer(rtc::scoped_refptr buffer) +I444Buffer::I444Buffer(webrtc::scoped_refptr buffer) : PlanarYuv8Buffer(buffer) {} -I010Buffer::I010Buffer(rtc::scoped_refptr buffer) +I010Buffer::I010Buffer(webrtc::scoped_refptr buffer) : PlanarYuv16BBuffer(buffer) {} -NV12Buffer::NV12Buffer(rtc::scoped_refptr buffer) +NV12Buffer::NV12Buffer(webrtc::scoped_refptr buffer) : BiplanarYuv8Buffer(buffer) {} std::unique_ptr copy_i420_buffer( @@ -257,7 +257,7 @@ std::unique_ptr new_i010_buffer(int width, int stride_y, int stride_u, int stride_v) { - return std::make_unique(rtc::make_ref_counted( + return std::make_unique(webrtc::make_ref_counted( width, height, stride_y, stride_u, stride_v)); } diff --git a/webrtc-sys/src/video_track.cpp b/webrtc-sys/src/video_track.cpp index 45e07dcae..cd83a1640 100644 --- a/webrtc-sys/src/video_track.cpp +++ b/webrtc-sys/src/video_track.cpp @@ -36,7 +36,7 @@ namespace livekit { VideoTrack::VideoTrack(std::shared_ptr rtc_runtime, - rtc::scoped_refptr track) + webrtc::scoped_refptr track) : MediaStreamTrack(rtc_runtime, std::move(track)) {} VideoTrack::~VideoTrack() { @@ -49,7 +49,7 @@ VideoTrack::~VideoTrack() { void VideoTrack::add_sink(const std::shared_ptr& sink) const { webrtc::MutexLock lock(&mutex_); track()->AddOrUpdateSink(sink.get(), - rtc::VideoSinkWants()); // TODO(theomonnom): Expose + webrtc::VideoSinkWants()); // TODO(theomonnom): Expose // VideoSinkWants to Rust? sinks_.push_back(sink); } @@ -106,7 +106,7 @@ std::shared_ptr new_native_video_sink( VideoTrackSource::InternalSource::InternalSource( const VideoResolution& resolution) - : rtc::AdaptedVideoTrackSource(4), resolution_(resolution) {} + : webrtc::AdaptedVideoTrackSource(4), resolution_(resolution) {} VideoTrackSource::InternalSource::~InternalSource() {} @@ -114,7 +114,7 @@ bool VideoTrackSource::InternalSource::is_screencast() const { return false; } -absl::optional VideoTrackSource::InternalSource::needs_denoising() const { +std::optional VideoTrackSource::InternalSource::needs_denoising() const { return false; } @@ -137,9 +137,9 @@ bool VideoTrackSource::InternalSource::on_captured_frame( webrtc::MutexLock lock(&mutex_); int64_t aligned_timestamp_us = timestamp_aligner_.TranslateTimestamp( - frame.timestamp_us(), rtc::TimeMicros()); + frame.timestamp_us(), webrtc::TimeMicros()); - rtc::scoped_refptr buffer = + webrtc::scoped_refptr buffer = frame.video_frame_buffer(); if (resolution_.height == 0 || resolution_.width == 0) { @@ -161,7 +161,7 @@ bool VideoTrackSource::InternalSource::on_captured_frame( webrtc::VideoRotation rotation = frame.rotation(); if (apply_rotation() && rotation != webrtc::kVideoRotation_0) { - // If the buffer is I420, rtc::AdaptedVideoTrackSource will handle the + // If the buffer is I420, webrtc::AdaptedVideoTrackSource will handle the // rotation for us. buffer = buffer->ToI420(); } @@ -176,7 +176,7 @@ bool VideoTrackSource::InternalSource::on_captured_frame( } VideoTrackSource::VideoTrackSource(const VideoResolution& resolution) { - source_ = rtc::make_ref_counted(resolution); + source_ = webrtc::make_ref_counted(resolution); } VideoResolution VideoTrackSource::video_resolution() const { @@ -189,7 +189,7 @@ bool VideoTrackSource::on_captured_frame( return source_->on_captured_frame(rtc_frame); } -rtc::scoped_refptr VideoTrackSource::get() +webrtc::scoped_refptr VideoTrackSource::get() const { return source_; } diff --git a/webrtc-sys/src/webrtc.cpp b/webrtc-sys/src/webrtc.cpp index 7305741c5..0b9491ff8 100644 --- a/webrtc-sys/src/webrtc.cpp +++ b/webrtc-sys/src/webrtc.cpp @@ -26,8 +26,8 @@ #include "livekit/rtp_receiver.h" #include "livekit/rtp_sender.h" #include "livekit/video_track.h" -#include "rtc_base/helpers.h" #include "rtc_base/logging.h" +#include "rtc_base/crypto_random.h" #include "rtc_base/synchronization/mutex.h" #ifdef WEBRTC_WIN @@ -48,7 +48,7 @@ RtcRuntime::RtcRuntime() { // Not the best way to do it... webrtc::MutexLock lock(&g_mutex); if (g_release_counter == 0) { - RTC_CHECK(rtc::InitializeSSL()) << "Failed to InitializeSSL()"; + RTC_CHECK(webrtc::InitializeSSL()) << "Failed to InitializeSSL()"; #ifdef WEBRTC_WIN WSADATA data; @@ -58,13 +58,13 @@ RtcRuntime::RtcRuntime() { g_release_counter++; } - network_thread_ = rtc::Thread::CreateWithSocketServer(); + network_thread_ = webrtc::Thread::CreateWithSocketServer(); network_thread_->SetName("network_thread", &network_thread_); network_thread_->Start(); - worker_thread_ = rtc::Thread::Create(); + worker_thread_ = webrtc::Thread::Create(); worker_thread_->SetName("worker_thread", &worker_thread_); worker_thread_->Start(); - signaling_thread_ = rtc::Thread::Create(); + signaling_thread_ = webrtc::Thread::Create(); signaling_thread_->SetName("signaling_thread", &signaling_thread_); signaling_thread_->Start(); } @@ -80,7 +80,7 @@ RtcRuntime::~RtcRuntime() { webrtc::MutexLock lock(&g_mutex); g_release_counter--; if (g_release_counter == 0) { - RTC_CHECK(rtc::CleanupSSL()) << "Failed to CleanupSSL()"; + RTC_CHECK(webrtc::CleanupSSL()) << "Failed to CleanupSSL()"; #ifdef WEBRTC_WIN WSACleanup(); @@ -89,20 +89,20 @@ RtcRuntime::~RtcRuntime() { } } -rtc::Thread* RtcRuntime::network_thread() const { +webrtc::Thread* RtcRuntime::network_thread() const { return network_thread_.get(); } -rtc::Thread* RtcRuntime::worker_thread() const { +webrtc::Thread* RtcRuntime::worker_thread() const { return worker_thread_.get(); } -rtc::Thread* RtcRuntime::signaling_thread() const { +webrtc::Thread* RtcRuntime::signaling_thread() const { return signaling_thread_.get(); } std::shared_ptr RtcRuntime::get_or_create_media_stream_track( - rtc::scoped_refptr rtc_track) { + webrtc::scoped_refptr rtc_track) { webrtc::MutexLock lock(&mutex_); for (std::weak_ptr weak_existing_track : media_stream_tracks_) { @@ -118,7 +118,7 @@ std::shared_ptr RtcRuntime::get_or_create_media_stream_track( std::shared_ptr video_track = std::shared_ptr(new VideoTrack( shared_from_this(), - rtc::scoped_refptr( + webrtc::scoped_refptr( static_cast(rtc_track.get())))); media_stream_tracks_.push_back( @@ -128,7 +128,7 @@ std::shared_ptr RtcRuntime::get_or_create_media_stream_track( std::shared_ptr audio_track = std::shared_ptr(new AudioTrack( shared_from_this(), - rtc::scoped_refptr( + webrtc::scoped_refptr( static_cast(rtc_track.get())))); media_stream_tracks_.push_back( @@ -138,13 +138,13 @@ std::shared_ptr RtcRuntime::get_or_create_media_stream_track( } std::shared_ptr RtcRuntime::get_or_create_audio_track( - rtc::scoped_refptr track) { + webrtc::scoped_refptr track) { return std::static_pointer_cast( get_or_create_media_stream_track(track)); } std::shared_ptr RtcRuntime::get_or_create_video_track( - rtc::scoped_refptr track) { + webrtc::scoped_refptr track) { return std::static_pointer_cast( get_or_create_media_stream_track(track)); } @@ -152,15 +152,15 @@ std::shared_ptr RtcRuntime::get_or_create_video_track( LogSink::LogSink( rust::Fn fnc) : fnc_(fnc) { - rtc::LogMessage::AddLogToStream(this, rtc::LoggingSeverity::LS_VERBOSE); + webrtc::LogMessage::AddLogToStream(this, rtc::LoggingSeverity::LS_VERBOSE); } LogSink::~LogSink() { - rtc::LogMessage::RemoveLogToStream(this); + webrtc::LogMessage::RemoveLogToStream(this); } void LogSink::OnLogMessage(const std::string& message, - rtc::LoggingSeverity severity) { + webrtc::LoggingSeverity severity) { fnc_(rust::String::lossy(message), static_cast(severity)); } @@ -170,7 +170,7 @@ std::unique_ptr new_log_sink( } rust::String create_random_uuid() { - return rtc::CreateRandomUuid(); + return webrtc::CreateRandomUuid(); } } // namespace livekit diff --git a/yuv-sys/yuv_functions.txt b/yuv-sys/yuv_functions.txt index cecd256ba..4a57a51f0 100644 --- a/yuv-sys/yuv_functions.txt +++ b/yuv-sys/yuv_functions.txt @@ -1173,7 +1173,7 @@ NV21ToRGB24Row_AVX2 I422ToRGB565Row_AVX2 I422ToARGB1555Row_AVX2 I422ToARGB4444Row_AVX2 -I422ToRGB24Row_AVX2 +I422ToRGB24Row_AVX2f I444ToRGB24Row_AVX2 NV12ToRGB565Row_AVX2 RGB24ToYJRow_AVX2 @@ -1191,3 +1191,317 @@ RGBAToARGBRow_C AR64ToAB64Row_C YUY2ToARGBMatrix UYVYToARGBMatrix +TransposeWx8_C +TransposeUVWx8_C +TransposeWxH_C +TransposeUVWxH_C +TransposeWx8_16_C +TransposeWxH_16_C +Transpose4x4_32_C +TransposeUVWx8_Any_NEON +I444ToARGBRow_NEON +I444ToRGB24Row_NEON +HammingDistance_NEON +I422ToARGBRow_NEON +MergeARGBRow_Any_NEON +I444AlphaToARGBRow_NEON +I444AlphaToARGBRow_Any_NEON +I422AlphaToARGBRow_NEON +SumSquareError_NEON +I422ToRGBARow_NEON +I422ToRGB24Row_NEON +I422ToRGB565Row_NEON +I422ToARGB1555Row_NEON +I422ToARGB4444Row_NEON +I400ToARGBRow_NEON +J400ToARGBRow_NEON +I422AlphaToARGBRow_Any_NEON +MergeAR64Row_Any_NEON +MergeARGB16To8Row_Any_NEON +MergeXRGBRow_Any_NEON +I422ToYUY2Row_Any_NEON +I422ToUYVYRow_Any_NEON +I444ToRGB24Row_Any_NEON +I444ToARGBRow_Any_NEON +I422ToARGBRow_Any_NEON +I422ToRGBARow_Any_NEON +I422ToRGB24Row_Any_NEON +I422ToARGB4444Row_Any_NEON +I422ToARGB1555Row_Any_NEON +I422ToRGB565Row_Any_NEON +MergeXR30Row_Any_NEON +MergeXR30Row_10_Any_NEON +MergeXR64Row_Any_NEON +MergeXRGB16To8Row_Any_NEON +MergeUVRow_Any_NEON +NV21ToYUV24Row_Any_NEON +ARGBMultiplyRow_Any_NEON +ARGBAddRow_Any_NEON +ARGBSubtractRow_Any_NEON +SobelRow_Any_NEON +SobelToPlaneRow_Any_NEON +SobelXYRow_Any_NEON +YUY2ToNVUVRow_Any_NEON +NV12ToARGBRow_Any_NEON +NV21ToARGBRow_Any_NEON +NV12ToRGB24Row_Any_NEON +NV21ToRGB24Row_Any_NEON +NV12ToRGB565Row_Any_NEON +MergeUVRow_16_Any_NEON +CopyRow_Any_NEON +ARGBToRGB24Row_Any_NEON +ARGBToRAWRow_Any_NEON +ARGBToRGB565Row_Any_NEON +ARGBToARGB1555Row_Any_NEON +ARGBToARGB4444Row_Any_NEON +J400ToARGBRow_Any_NEON +RAWToRGB24Row_Any_NEON +ARGBToYRow_Any_NEON +ARGBToYJRow_Any_NEON +ABGRToYJRow_Any_NEON +RGBAToYJRow_Any_NEON +BGRAToYRow_Any_NEON +ABGRToYRow_Any_NEON +RGBAToYRow_Any_NEON +RGB24ToYRow_Any_NEON +RGB24ToYJRow_Any_NEON +RAWToYRow_Any_NEON +RAWToYJRow_Any_NEON +RGB565ToYRow_Any_NEON +NV12ToARGBRow_NEON +ARGB1555ToYRow_Any_NEON +NV21ToARGBRow_NEON +NV12ToRGB24Row_NEON +ARGB4444ToYRow_Any_NEON +NV21ToRGB24Row_NEON +NV12ToRGB565Row_NEON +ScaleRowDown2_NEON +ScaleRowDown2Linear_NEON +ScaleRowDown2Box_NEON +ScaleRowDown4_NEON +YUY2ToYRow_Any_NEON +UYVYToYRow_Any_NEON +YUY2ToARGBRow_NEON +AYUVToYRow_Any_NEON +SwapUVRow_Any_NEON +RGB24ToARGBRow_Any_NEON +RAWToARGBRow_Any_NEON +RAWToRGBARow_Any_NEON +RGB565ToARGBRow_Any_NEON +ARGB1555ToARGBRow_Any_NEON +ARGB4444ToARGBRow_Any_NEON +ARGBAttenuateRow_Any_NEON +ARGBExtractAlphaRow_Any_NEON +I400ToARGBRow_Any_NEON +ARGBToRGB565DitherRow_Any_NEON +ARGBShuffleRow_Any_NEON +ARGBToAR64Row_Any_NEON +ARGBToAB64Row_Any_NEON +AR64ToARGBRow_Any_NEON +AB64ToARGBRow_Any_NEON +UYVYToARGBRow_NEON +SplitUVRow_NEON +DetileRow_NEON +DetileRow_16_NEON +DetileSplitUVRow_NEON +ScaleRowDown4Box_NEON +ScaleRowDown34_NEON +ScaleRowDown34_0_Box_NEON +ScaleRowDown34_1_Box_NEON +ScaleRowDown38_NEON +ScaleRowDown38_3_Box_NEON +ScaleRowDown38_2_Box_NEON +ScaleRowUp2_Linear_NEON +ScaleRowUp2_Bilinear_NEON +ScaleRowUp2_Linear_12_NEON +ScaleRowUp2_Bilinear_12_NEON +ScaleRowUp2_Linear_16_NEON +ScaleRowUp2_Bilinear_16_NEON +ScaleUVRowUp2_Linear_NEON +ScaleUVRowUp2_Bilinear_NEON +Convert16To8Row_Any_NEON +MultiplyRow_16_Any_NEON +DivideRow_16_Any_NEON +HalfFloatRow_Any_NEON +ByteToFloatRow_Any_NEON +YUY2ToARGBRow_Any_NEON +UYVYToARGBRow_Any_NEON +InterpolateRow_Any_NEON +ScaleUVRowUp2_Linear_16_NEON +DetileToYUY2_NEON +UnpackMT2T_NEON +ScaleUVRowUp2_Bilinear_16_NEON +MergeUVRow_NEON +MergeUVRow_16_NEON +ScaleAddRow_NEON +InterpolateRow_16_Any_NEON +InterpolateRow_16To8_Any_NEON +MirrorRow_Any_NEON +MirrorUVRow_Any_NEON +ARGBMirrorRow_Any_NEON +RGB24MirrorRow_Any_NEON +SetRow_Any_NEON +ARGBSetRow_Any_NEON +SplitUVRow_Any_NEON +ARGBToUV444Row_Any_NEON +YUY2ToUV422Row_Any_NEON +UYVYToUV422Row_Any_NEON +SplitUVRow_16_Any_NEON +SplitRGBRow_Any_NEON +SplitXRGBRow_Any_NEON +SplitARGBRow_Any_NEON +ARGBToUVRow_Any_NEON +ARGBToUVJRow_Any_NEON +ABGRToUVJRow_Any_NEON +BGRAToUVRow_Any_NEON +ABGRToUVRow_Any_NEON +SplitRGBRow_NEON +RGBAToUVRow_Any_NEON +MergeRGBRow_NEON +RGB24ToUVRow_Any_NEON +RGB24ToUVJRow_Any_NEON +RAWToUVRow_Any_NEON +RAWToUVJRow_Any_NEON +RGB565ToUVRow_Any_NEON +ARGB1555ToUVRow_Any_NEON +ARGB4444ToUVRow_Any_NEON +YUY2ToUVRow_Any_NEON +UYVYToUVRow_Any_NEON +AYUVToUVRow_Any_NEON +AYUVToVURow_Any_NEON +DetileRow_Any_NEON +DetileRow_16_Any_NEON +DetileSplitUVRow_Any_NEON +DetileToYUY2_Any_NEON +SplitARGBRow_NEON +MergeARGBRow_NEON +SplitXRGBRow_NEON +MergeXRGBRow_NEON +MergeXR30Row_NEON +MergeXR30Row_10_NEON +MergeAR64Row_NEON +ScaleFilterCols_NEON +ScaleARGBRowDown2_NEON +ScaleARGBRowDown2Linear_NEON +ScaleARGBRowDown2Box_NEON +ScaleARGBRowDownEven_NEON +ScaleARGBRowDownEvenBox_NEON +ScaleARGBCols_NEON +ScaleARGBFilterCols_NEON +ScaleRowDown2Box_16_NEON +ScaleUVRowDown2_NEON +ScaleUVRowDown2Linear_NEON +ScaleUVRowDown2Box_NEON +ScaleUVRowDownEven_NEON +MergeXR64Row_NEON +MergeARGB16To8Row_NEON +TransposeUVWx8_NEON +MergeXRGB16To8Row_NEON +CopyRow_NEON +SetRow_NEON +ARGBSetRow_NEON +MirrorRow_NEON +MirrorUVRow_NEON +MirrorSplitUVRow_NEON +ARGBMirrorRow_NEON +RGB24MirrorRow_NEON +RGB24ToARGBRow_NEON +RAWToARGBRow_NEON +RAWToRGBARow_NEON +RAWToRGB24Row_NEON +RGB565ToARGBRow_NEON +ARGB1555ToARGBRow_NEON +ARGB4444ToARGBRow_NEON +ARGBToRGB24Row_NEON +ARGBToRAWRow_NEON +YUY2ToYRow_NEON +UYVYToYRow_NEON +YUY2ToUV422Row_NEON +UYVYToUV422Row_NEON +YUY2ToUVRow_NEON +UYVYToUVRow_NEON +YUY2ToNVUVRow_NEON +ARGBShuffleRow_NEON +I422ToYUY2Row_NEON +I422ToUYVYRow_NEON +ARGBToRGB565Row_NEON +ARGBToRGB565DitherRow_NEON +ARGBToARGB1555Row_NEON +ARGBToARGB4444Row_NEON +ARGBToAR64Row_NEON +ARGBToAB64Row_NEON +AR64ToARGBRow_NEON +AB64ToARGBRow_NEON +ARGBExtractAlphaRow_NEON +ARGBToUV444Row_NEON +ARGBToUVJ444Row_NEON +ARGBToUVRow_NEON +ARGBToUVJRow_NEON +ABGRToUVJRow_NEON +RGB24ToUVJRow_NEON +Transpose4x4_32_NEON +RAWToUVJRow_NEON +BGRAToUVRow_NEON +ABGRToUVRow_NEON +RGBAToUVRow_NEON +RGB24ToUVRow_NEON +RAWToUVRow_NEON +RGB565ToUVRow_NEON +ARGB1555ToUVRow_NEON +ARGB4444ToUVRow_NEON +RGB565ToYRow_NEON +ARGB1555ToYRow_NEON +ARGB4444ToYRow_NEON +ARGBToYRow_NEON +ARGBToYJRow_NEON +ABGRToYRow_NEON +ABGRToYJRow_NEON +RGBAToYRow_NEON +RGBAToYJRow_NEON +BGRAToYRow_NEON +RGB24ToYJRow_NEON +RAWToYJRow_NEON +RGB24ToYRow_NEON +RAWToYRow_NEON +InterpolateRow_NEON +InterpolateRow_16_NEON +InterpolateRow_16To8_NEON +ARGBBlendRow_NEON +ARGBAttenuateRow_NEON +ARGBQuantizeRow_NEON +ARGBShadeRow_NEON +ARGBGrayRow_NEON +ARGBSepiaRow_NEON +ARGBColorMatrixRow_NEON +ARGBMultiplyRow_NEON +ARGBAddRow_NEON +ARGBSubtractRow_NEON +SobelRow_NEON +SobelToPlaneRow_NEON +SobelXYRow_NEON +SobelXRow_NEON +SobelYRow_NEON +HalfFloatRow_NEON +ByteToFloatRow_NEON +ConvertFP16ToFP32Row_NEON +ConvertFP16ToFP32Column_NEON +ConvertFP32ToFP16Row_NEON +ScaleMaxSamples_NEON +ScaleSumSamples_NEON +ScaleSamples_NEON +GaussCol_NEON +GaussRow_NEON +GaussCol_F32_NEON +GaussRow_F32_NEON +NV21ToYUV24Row_NEON +AYUVToUVRow_NEON +AYUVToVURow_NEON +AYUVToYRow_NEON +SwapUVRow_NEON +HalfMergeUVRow_NEON +SplitUVRow_16_NEON +MultiplyRow_16_NEON +DivideRow_16_NEON +Convert16To8Row_NEON +TransposeWx8_Any_NEON +TransposeWx8_NEON \ No newline at end of file