From d9fd69b5c00cb7b77214ddb5a89efc82e19df757 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Monnom?= Date: Mon, 12 Sep 2022 12:51:54 +0200 Subject: [PATCH 01/14] Windows + Initial WebRTC sys & Safe WebRTC + Initial livekit-core --- .gitignore | 11 +- .gitmodules | 3 + Cargo.lock | 908 ++++++++++++++++- Cargo.toml | 25 +- crates/livekit-core/Cargo.lock | 935 ++++++++++++++++++ crates/livekit-core/Cargo.toml | 22 + crates/livekit-core/build.rs | 12 + crates/livekit-core/protocol | 1 + crates/livekit-core/src/lib.rs | 8 + crates/livekit-core/src/room.rs | 1 + crates/livekit-core/src/rtc_engine.rs | 60 ++ crates/livekit-core/src/signal_client.rs | 100 ++ crates/livekit-webrtc/.cargo/config | 2 + crates/livekit-webrtc/Cargo.toml | 14 + .../libwebrtc-sys/.cargo/config | 2 + .../livekit-webrtc/libwebrtc-sys/.gitignore | 2 + .../libwebrtc-sys/CMakeLists.txt | 23 + .../livekit-webrtc/libwebrtc-sys/Cargo.lock | 213 ++++ .../livekit-webrtc/libwebrtc-sys/Cargo.toml | 21 + .../livekit-webrtc/libwebrtc-sys/build.rs | 121 ++- .../libwebrtc-sys/include/livekit/candidate.h | 28 + .../include/livekit/data_channel.h | 26 + .../libwebrtc-sys/include/livekit/jsep.h | 96 ++ .../include/livekit/media_stream_interface.h | 26 + .../include/livekit/peer_connection.h | 71 ++ .../livekit}/peer_connection_factory.h | 17 +- .../libwebrtc-sys/include/livekit/rtc_error.h | 25 + .../include/livekit/rtp_receiver.h | 26 + .../include/livekit/rtp_transceiver.h | 26 + .../include/livekit/rust_types.h | 22 + .../libwebrtc-sys/src/candidate.cpp | 11 + .../libwebrtc-sys/src/candidate.rs | 12 + .../libwebrtc-sys/src/data_channel.cpp | 12 + .../libwebrtc-sys/src/data_channel.rs | 12 + .../livekit-webrtc/libwebrtc-sys/src/jsep.cpp | 83 ++ .../livekit-webrtc/libwebrtc-sys/src/jsep.rs | 109 ++ .../livekit-webrtc/libwebrtc-sys/src/lib.rs | 10 + .../src/media_stream_interface.cpp | 12 + .../src/media_stream_interface.rs | 13 + .../libwebrtc-sys/src/peer_connection.cpp | 166 ++++ .../libwebrtc-sys/src/peer_connection.rs | 293 ++++++ .../src/peer_connection_factory.cpp | 87 ++ .../src/peer_connection_factory.rs | 186 ++++ .../libwebrtc-sys/src/rtc_error.cpp | 11 + .../libwebrtc-sys/src/rtc_error.rs | 13 + .../libwebrtc-sys/src/rtp_receiver.cpp | 11 + .../libwebrtc-sys/src/rtp_receiver.rs | 12 + .../libwebrtc-sys/src/rtp_transceiver.cpp | 11 + .../libwebrtc-sys/src/rtp_transceiver.rs | 12 + crates/livekit-webrtc/src/data_channel.rs | 6 + crates/livekit-webrtc/src/ice_candidate.rs | 4 + crates/livekit-webrtc/src/lib.rs | 9 + crates/livekit-webrtc/src/media_stream.rs | 4 + crates/livekit-webrtc/src/peer_connection.rs | 336 +++++++ .../src/peer_connection_factory.rs | 54 + crates/livekit-webrtc/src/rtc_error.rs | 5 + crates/livekit-webrtc/src/rtp_receiver.rs | 5 + crates/livekit-webrtc/src/rtp_transceiver.rs | 5 + .../livekit-webrtc/src/session_description.rs | 5 + examples/android-project/.gitignore | 20 - examples/android-project/app/.gitignore | 1 - examples/android-project/app/build.gradle | 60 -- .../android-project/app/proguard-rules.pro | 21 - .../android/ExampleInstrumentedTest.kt | 24 - .../app/src/main/AndroidManifest.xml | 29 - .../java/io/livekit/android/MainActivity.kt | 35 - .../drawable-v24/ic_launcher_foreground.xml | 30 - .../res/drawable/ic_launcher_background.xml | 170 ---- .../app/src/main/res/layout/activity_main.xml | 34 - .../app/src/main/res/layout/content_main.xml | 19 - .../app/src/main/res/menu/menu_main.xml | 10 - .../res/mipmap-anydpi-v26/ic_launcher.xml | 5 - .../mipmap-anydpi-v26/ic_launcher_round.xml | 5 - .../src/main/res/mipmap-hdpi/ic_launcher.webp | Bin 1404 -> 0 bytes .../res/mipmap-hdpi/ic_launcher_round.webp | Bin 2898 -> 0 bytes .../src/main/res/mipmap-mdpi/ic_launcher.webp | Bin 982 -> 0 bytes .../res/mipmap-mdpi/ic_launcher_round.webp | Bin 1772 -> 0 bytes .../main/res/mipmap-xhdpi/ic_launcher.webp | Bin 1900 -> 0 bytes .../res/mipmap-xhdpi/ic_launcher_round.webp | Bin 3918 -> 0 bytes .../main/res/mipmap-xxhdpi/ic_launcher.webp | Bin 2884 -> 0 bytes .../res/mipmap-xxhdpi/ic_launcher_round.webp | Bin 5914 -> 0 bytes .../main/res/mipmap-xxxhdpi/ic_launcher.webp | Bin 3844 -> 0 bytes .../res/mipmap-xxxhdpi/ic_launcher_round.webp | Bin 7778 -> 0 bytes .../app/src/main/res/navigation/nav_graph.xml | 28 - .../app/src/main/res/values-land/dimens.xml | 3 - .../app/src/main/res/values-night/themes.xml | 16 - .../src/main/res/values-w1240dp/dimens.xml | 3 - .../app/src/main/res/values-w600dp/dimens.xml | 3 - .../app/src/main/res/values/colors.xml | 10 - .../app/src/main/res/values/dimens.xml | 3 - .../app/src/main/res/values/strings.xml | 12 - .../app/src/main/res/values/themes.xml | 25 - .../app/src/main/res/xml/backup_rules.xml | 13 - .../main/res/xml/data_extraction_rules.xml | 19 - examples/android-project/build.gradle | 11 - examples/android-project/gradle.properties | 23 - .../gradle/wrapper/gradle-wrapper.jar | Bin 59203 -> 0 bytes .../gradle/wrapper/gradle-wrapper.properties | 6 - examples/android-project/gradlew | 185 ---- examples/android-project/gradlew.bat | 89 -- examples/android-project/settings.gradle | 16 - examples/ios-project/.gitignore | 2 - .../ios-project.xcodeproj/project.pbxproj | 626 ------------ .../contents.xcworkspacedata | 7 - .../xcshareddata/IDEWorkspaceChecks.plist | 8 - .../UserInterfaceState.xcuserstate | Bin 43974 -> 0 bytes .../xcschemes/xcschememanagement.plist | 14 - .../ios-project/ios-project/AppDelegate.h | 14 - .../ios-project/ios-project/AppDelegate.m | 40 - .../AccentColor.colorset/Contents.json | 11 - .../AppIcon.appiconset/Contents.json | 98 -- .../ios-project/Assets.xcassets/Contents.json | 6 - .../Base.lproj/LaunchScreen.storyboard | 32 - .../ios-project/Base.lproj/Main.storyboard | 32 - examples/ios-project/ios-project/Info.plist | 25 - .../ios-project/ios-project/SceneDelegate.h | 15 - .../ios-project/ios-project/SceneDelegate.m | 57 -- .../ios-project/ios-project/ViewController.h | 14 - .../ios-project/ios-project/ViewController.m | 22 - examples/ios-project/ios-project/main.m | 27 - .../ios-projectTests/ios_projectTests.m | 36 - .../ios-projectUITests/ios_projectUITests.m | 46 - .../ios_projectUITestsLaunchTests.m | 37 - include/objc_test.h | 5 - src/jni_onload.cc | 37 - src/lib.rs | 15 - src/objc_test.mm | 12 - src/peer_connection_factory.cpp | 42 - 128 files changed, 4282 insertions(+), 2282 deletions(-) create mode 100644 .gitmodules create mode 100644 crates/livekit-core/Cargo.lock create mode 100644 crates/livekit-core/Cargo.toml create mode 100644 crates/livekit-core/build.rs create mode 160000 crates/livekit-core/protocol create mode 100644 crates/livekit-core/src/lib.rs create mode 100644 crates/livekit-core/src/room.rs create mode 100644 crates/livekit-core/src/rtc_engine.rs create mode 100644 crates/livekit-core/src/signal_client.rs create mode 100644 crates/livekit-webrtc/.cargo/config create mode 100644 crates/livekit-webrtc/Cargo.toml create mode 100644 crates/livekit-webrtc/libwebrtc-sys/.cargo/config create mode 100644 crates/livekit-webrtc/libwebrtc-sys/.gitignore create mode 100644 crates/livekit-webrtc/libwebrtc-sys/CMakeLists.txt create mode 100644 crates/livekit-webrtc/libwebrtc-sys/Cargo.lock create mode 100644 crates/livekit-webrtc/libwebrtc-sys/Cargo.toml rename build.rs => crates/livekit-webrtc/libwebrtc-sys/build.rs (56%) create mode 100644 crates/livekit-webrtc/libwebrtc-sys/include/livekit/candidate.h create mode 100644 crates/livekit-webrtc/libwebrtc-sys/include/livekit/data_channel.h create mode 100644 crates/livekit-webrtc/libwebrtc-sys/include/livekit/jsep.h create mode 100644 crates/livekit-webrtc/libwebrtc-sys/include/livekit/media_stream_interface.h create mode 100644 crates/livekit-webrtc/libwebrtc-sys/include/livekit/peer_connection.h rename {include => crates/livekit-webrtc/libwebrtc-sys/include/livekit}/peer_connection_factory.h (51%) create mode 100644 crates/livekit-webrtc/libwebrtc-sys/include/livekit/rtc_error.h create mode 100644 crates/livekit-webrtc/libwebrtc-sys/include/livekit/rtp_receiver.h create mode 100644 crates/livekit-webrtc/libwebrtc-sys/include/livekit/rtp_transceiver.h create mode 100644 crates/livekit-webrtc/libwebrtc-sys/include/livekit/rust_types.h create mode 100644 crates/livekit-webrtc/libwebrtc-sys/src/candidate.cpp create mode 100644 crates/livekit-webrtc/libwebrtc-sys/src/candidate.rs create mode 100644 crates/livekit-webrtc/libwebrtc-sys/src/data_channel.cpp create mode 100644 crates/livekit-webrtc/libwebrtc-sys/src/data_channel.rs create mode 100644 crates/livekit-webrtc/libwebrtc-sys/src/jsep.cpp create mode 100644 crates/livekit-webrtc/libwebrtc-sys/src/jsep.rs create mode 100644 crates/livekit-webrtc/libwebrtc-sys/src/lib.rs create mode 100644 crates/livekit-webrtc/libwebrtc-sys/src/media_stream_interface.cpp create mode 100644 crates/livekit-webrtc/libwebrtc-sys/src/media_stream_interface.rs create mode 100644 crates/livekit-webrtc/libwebrtc-sys/src/peer_connection.cpp create mode 100644 crates/livekit-webrtc/libwebrtc-sys/src/peer_connection.rs create mode 100644 crates/livekit-webrtc/libwebrtc-sys/src/peer_connection_factory.cpp create mode 100644 crates/livekit-webrtc/libwebrtc-sys/src/peer_connection_factory.rs create mode 100644 crates/livekit-webrtc/libwebrtc-sys/src/rtc_error.cpp create mode 100644 crates/livekit-webrtc/libwebrtc-sys/src/rtc_error.rs create mode 100644 crates/livekit-webrtc/libwebrtc-sys/src/rtp_receiver.cpp create mode 100644 crates/livekit-webrtc/libwebrtc-sys/src/rtp_receiver.rs create mode 100644 crates/livekit-webrtc/libwebrtc-sys/src/rtp_transceiver.cpp create mode 100644 crates/livekit-webrtc/libwebrtc-sys/src/rtp_transceiver.rs create mode 100644 crates/livekit-webrtc/src/data_channel.rs create mode 100644 crates/livekit-webrtc/src/ice_candidate.rs create mode 100644 crates/livekit-webrtc/src/lib.rs create mode 100644 crates/livekit-webrtc/src/media_stream.rs create mode 100644 crates/livekit-webrtc/src/peer_connection.rs create mode 100644 crates/livekit-webrtc/src/peer_connection_factory.rs create mode 100644 crates/livekit-webrtc/src/rtc_error.rs create mode 100644 crates/livekit-webrtc/src/rtp_receiver.rs create mode 100644 crates/livekit-webrtc/src/rtp_transceiver.rs create mode 100644 crates/livekit-webrtc/src/session_description.rs delete mode 100644 examples/android-project/.gitignore delete mode 100644 examples/android-project/app/.gitignore delete mode 100644 examples/android-project/app/build.gradle delete mode 100644 examples/android-project/app/proguard-rules.pro delete mode 100644 examples/android-project/app/src/androidTest/java/io/livekit/android/ExampleInstrumentedTest.kt delete mode 100644 examples/android-project/app/src/main/AndroidManifest.xml delete mode 100644 examples/android-project/app/src/main/java/io/livekit/android/MainActivity.kt delete mode 100644 examples/android-project/app/src/main/res/drawable-v24/ic_launcher_foreground.xml delete mode 100644 examples/android-project/app/src/main/res/drawable/ic_launcher_background.xml delete mode 100644 examples/android-project/app/src/main/res/layout/activity_main.xml delete mode 100644 examples/android-project/app/src/main/res/layout/content_main.xml delete mode 100644 examples/android-project/app/src/main/res/menu/menu_main.xml delete mode 100644 examples/android-project/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml delete mode 100644 examples/android-project/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml delete mode 100644 examples/android-project/app/src/main/res/mipmap-hdpi/ic_launcher.webp delete mode 100644 examples/android-project/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp delete mode 100644 examples/android-project/app/src/main/res/mipmap-mdpi/ic_launcher.webp delete mode 100644 examples/android-project/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp delete mode 100644 examples/android-project/app/src/main/res/mipmap-xhdpi/ic_launcher.webp delete mode 100644 examples/android-project/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp delete mode 100644 examples/android-project/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp delete mode 100644 examples/android-project/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp delete mode 100644 examples/android-project/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp delete mode 100644 examples/android-project/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp delete mode 100644 examples/android-project/app/src/main/res/navigation/nav_graph.xml delete mode 100644 examples/android-project/app/src/main/res/values-land/dimens.xml delete mode 100644 examples/android-project/app/src/main/res/values-night/themes.xml delete mode 100644 examples/android-project/app/src/main/res/values-w1240dp/dimens.xml delete mode 100644 examples/android-project/app/src/main/res/values-w600dp/dimens.xml delete mode 100644 examples/android-project/app/src/main/res/values/colors.xml delete mode 100644 examples/android-project/app/src/main/res/values/dimens.xml delete mode 100644 examples/android-project/app/src/main/res/values/strings.xml delete mode 100644 examples/android-project/app/src/main/res/values/themes.xml delete mode 100644 examples/android-project/app/src/main/res/xml/backup_rules.xml delete mode 100644 examples/android-project/app/src/main/res/xml/data_extraction_rules.xml delete mode 100644 examples/android-project/build.gradle delete mode 100644 examples/android-project/gradle.properties delete mode 100644 examples/android-project/gradle/wrapper/gradle-wrapper.jar delete mode 100644 examples/android-project/gradle/wrapper/gradle-wrapper.properties delete mode 100755 examples/android-project/gradlew delete mode 100644 examples/android-project/gradlew.bat delete mode 100644 examples/android-project/settings.gradle delete mode 100644 examples/ios-project/.gitignore delete mode 100644 examples/ios-project/ios-project.xcodeproj/project.pbxproj delete mode 100644 examples/ios-project/ios-project.xcodeproj/project.xcworkspace/contents.xcworkspacedata delete mode 100644 examples/ios-project/ios-project.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist delete mode 100644 examples/ios-project/ios-project.xcodeproj/project.xcworkspace/xcuserdata/theomonnom.xcuserdatad/UserInterfaceState.xcuserstate delete mode 100644 examples/ios-project/ios-project.xcodeproj/xcuserdata/theomonnom.xcuserdatad/xcschemes/xcschememanagement.plist delete mode 100644 examples/ios-project/ios-project/AppDelegate.h delete mode 100644 examples/ios-project/ios-project/AppDelegate.m delete mode 100644 examples/ios-project/ios-project/Assets.xcassets/AccentColor.colorset/Contents.json delete mode 100644 examples/ios-project/ios-project/Assets.xcassets/AppIcon.appiconset/Contents.json delete mode 100644 examples/ios-project/ios-project/Assets.xcassets/Contents.json delete mode 100644 examples/ios-project/ios-project/Base.lproj/LaunchScreen.storyboard delete mode 100644 examples/ios-project/ios-project/Base.lproj/Main.storyboard delete mode 100644 examples/ios-project/ios-project/Info.plist delete mode 100644 examples/ios-project/ios-project/SceneDelegate.h delete mode 100644 examples/ios-project/ios-project/SceneDelegate.m delete mode 100644 examples/ios-project/ios-project/ViewController.h delete mode 100644 examples/ios-project/ios-project/ViewController.m delete mode 100644 examples/ios-project/ios-project/main.m delete mode 100644 examples/ios-project/ios-projectTests/ios_projectTests.m delete mode 100644 examples/ios-project/ios-projectUITests/ios_projectUITests.m delete mode 100644 examples/ios-project/ios-projectUITests/ios_projectUITestsLaunchTests.m delete mode 100644 include/objc_test.h delete mode 100644 src/jni_onload.cc delete mode 100644 src/objc_test.mm delete mode 100644 src/peer_connection_factory.cpp diff --git a/.gitignore b/.gitignore index 5217bfb..8d2cb99 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,3 @@ -target -cmake-build-debug -.idea/ -.cargo/ -test/ -libwebrtc/ -libwebrtc_android/ -CMakeLists.txt +/target +/.idea +/libwebrtc \ No newline at end of file diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..b1073b2 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "crates/livekit-core/protocol"] + path = crates/livekit-core/protocol + url = https://github.com/livekit/protocol diff --git a/Cargo.lock b/Cargo.lock index 12e9ece..7b58080 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -11,11 +11,85 @@ dependencies = [ "memchr", ] +[[package]] +name = "anyhow" +version = "1.0.63" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a26fa4d7e3f2eebadf743988fc8aec9fa9a9e82611acafd77c1462ed6262440a" + +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +dependencies = [ + "hermit-abi", + "libc", + "winapi", +] + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "base64" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "block-buffer" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bf7fe51849ea569fd452f37822f606a5cabb684dc918707a0193fd4664ff324" +dependencies = [ + "generic-array", +] + +[[package]] +name = "byteorder" +version = "1.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" + +[[package]] +name = "bytes" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec8a7b6a70fde80372154c65702f00a0f56f3e1c36abbc6c440484be248856db" + [[package]] name = "cc" version = "1.0.73" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" +dependencies = [ + "jobserver", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "cmake" +version = "0.1.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8ad8cef104ac57b68b89df3208164d228503abbdce70f6880ffa3d970e7443a" +dependencies = [ + "cc", +] [[package]] name = "codespan-reporting" @@ -28,10 +102,29 @@ dependencies = [ ] [[package]] -name = "cxx" -version = "1.0.73" +name = "cpufeatures" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "873c2e83af70859af2aaecd1f5d862f3790b747b1f4f50fb45a931d000ac0422" +checksum = "dc948ebb96241bb40ab73effeb80d9f93afaad49359d159a5e61be51619fe813" +dependencies = [ + "libc", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "cxx" +version = "1.0.75" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b7df2292959b7e22a5cb39d37b7e72b2c748b12f956cc409b529fddcdc8857b" dependencies = [ "cc", "cxxbridge-flags", @@ -41,9 +134,9 @@ dependencies = [ [[package]] name = "cxx-build" -version = "1.0.73" +version = "1.0.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b49edea7163bbc7a39e3d829b4b0b66a9d30486973152842b7413f2c7b5632bf" +checksum = "0806e5c64f74bd64b94d857b1c28cc3d493579a65f5f31e7d3451706d4025405" dependencies = [ "cc", "codespan-reporting", @@ -56,21 +149,146 @@ dependencies = [ [[package]] name = "cxxbridge-flags" -version = "1.0.73" +version = "1.0.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f46b787c15af80277db5c88c6ac6c502ae545e622f010e06f95e540d34931acf" +checksum = "d2069b1573efd6e5901004e8fdca2e28bc6f47f86dc24da81182851e71cf3208" [[package]] name = "cxxbridge-macro" -version = "1.0.73" +version = "1.0.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ba3f3a7efa46626878fb5d324fabca4d19d2956b6ae97ce43044ef4515f5abc" +checksum = "d980827d1ec28ea6e0db545fceaa611eb8e43f70eff8c1c33cc2c96ffa0f0476" dependencies = [ "proc-macro2", "quote", "syn", ] +[[package]] +name = "digest" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2fb860ca6fafa5552fb6d0e816a69c8e49f0908bf524e30a90d97c85892d506" +dependencies = [ + "block-buffer", + "crypto-common", +] + +[[package]] +name = "either" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797" + +[[package]] +name = "env_logger" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b2cf0344971ee6c64c31be0d530793fba457d322dfec2810c453d0ef228f9c3" +dependencies = [ + "atty", + "humantime", + "log", + "regex", + "termcolor", +] + +[[package]] +name = "fastrand" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7a407cfaa3385c4ae6b23e84623d48c2798d06e3e6a1878f7f59f17b3f86499" +dependencies = [ + "instant", +] + +[[package]] +name = "fixedbitset" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "form_urlencoded" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fc25a87fa4fd2094bffb06925852034d90a17f0d1e05197d4956d3555752191" +dependencies = [ + "matches", + "percent-encoding", +] + +[[package]] +name = "futures-core" +version = "0.3.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e5aa3de05362c3fb88de6531e6296e85cde7739cccad4b9dfeeb7f6ebce56bf" + +[[package]] +name = "futures-macro" +version = "0.3.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42cd15d1c7456c04dbdf7e88bcd69760d74f3a798d6444e16974b505b0e62f17" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "futures-sink" +version = "0.3.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21b20ba5a92e727ba30e72834706623d94ac93a725410b6a6b6fbc1b07f7ba56" + +[[package]] +name = "futures-task" +version = "0.3.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6508c467c73851293f390476d4491cf4d227dbabcd4170f3bb6044959b294f1" + +[[package]] +name = "futures-util" +version = "0.3.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44fb6cb1be61cc1d2e43b262516aafcf63b241cffdb1d3fa115f91d9c7b09c90" +dependencies = [ + "futures-core", + "futures-macro", + "futures-sink", + "futures-task", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "generic-array" +version = "0.14.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4eb1a864a501629691edf6c15a593b7a51eebaa1e8468e9ddc623de7c9b58ec6" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + [[package]] name = "glob" version = "0.3.0" @@ -78,24 +296,194 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" [[package]] -name = "link-cplusplus" -version = "1.0.6" +name = "hashbrown" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8cae2cd7ba2f3f63938b9c724475dfb7b9861b545a90324476324ed21dbc8c8" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + +[[package]] +name = "heck" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9" + +[[package]] +name = "hermit-abi" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] + +[[package]] +name = "http" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "httparse" +version = "1.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "496ce29bb5a52785b44e0f7ca2847ae0bb839c9bd28f69acac9b99d461c0c04c" + +[[package]] +name = "humantime" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" + +[[package]] +name = "idna" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" +dependencies = [ + "matches", + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "indexmap" +version = "1.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e" +dependencies = [ + "autocfg", + "hashbrown", +] + +[[package]] +name = "instant" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "itertools" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9a9d19fa1e79b6215ff29b9d6880b706147f16e9b1dbb1e4e5947b5b02bc5e3" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c8af84674fe1f223a982c933a0ee1086ac4d4052aa0fb8060c12c6ad838e754" + +[[package]] +name = "jobserver" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af25a77299a7f711a01975c35a6a424eb6862092cc2d6c72c4ed6cbc56dfc1fa" +dependencies = [ + "libc", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "libc" +version = "0.2.132" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8371e4e5341c3a96db127eb2465ac681ced4c433e01dd0e938adbef26ba93ba5" + +[[package]] +name = "libwebrtc-sys" +version = "0.1.0" +dependencies = [ + "cc", + "cxx", + "cxx-build", + "env_logger", + "glob", + "log", + "regex", +] + +[[package]] +name = "link-cplusplus" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9272ab7b96c9046fbc5bc56c06c117cb639fe2d509df0c421cad82d2915cf369" dependencies = [ "cc", ] [[package]] -name = "livekit-native" +name = "livekit" +version = "0.1.0" + +[[package]] +name = "livekit-core" +version = "0.1.0" +dependencies = [ + "anyhow", + "env_logger", + "futures-util", + "log", + "prost", + "prost-build", + "prost-types", + "thiserror", + "tokio", + "tokio-tungstenite", + "url", +] + +[[package]] +name = "livekit-webrtc" version = "0.1.0" dependencies = [ "cxx", - "cxx-build", - "glob", - "regex", + "env_logger", + "libwebrtc-sys", + "log", + "tokio", ] +[[package]] +name = "lock_api" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f80bf5aacaf25cbfc8210d1cfb718f2bf3b11c4c54e5afe36c236853a8ec390" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "matches" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" + [[package]] name = "memchr" version = "2.5.0" @@ -103,29 +491,208 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" [[package]] -name = "once_cell" -version = "1.13.0" +name = "mio" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18a6dbe30758c9f83eb00cbea4ac95966305f5a7772f3f42ebfc7fc7eddbd8e1" +checksum = "57ee1c23c7c63b0c9250c339ffdc69255f110b298b901b9f6c82547b7b87caaf" +dependencies = [ + "libc", + "log", + "wasi", + "windows-sys", +] + +[[package]] +name = "multimap" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" + +[[package]] +name = "num_cpus" +version = "1.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" +dependencies = [ + "hermit-abi", + "libc", +] + +[[package]] +name = "once_cell" +version = "1.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "074864da206b4973b84eb91683020dbefd6a8c3f0f38e054d93954e891935e4e" + +[[package]] +name = "parking_lot" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09a279cbf25cb0757810394fbc1e359949b59e348145c643a939a525692e6929" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-sys", +] + +[[package]] +name = "percent-encoding" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" + +[[package]] +name = "petgraph" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6d5014253a1331579ce62aa67443b4a658c5e7dd03d4bc6d302b94474888143" +dependencies = [ + "fixedbitset", + "indexmap", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "ppv-lite86" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" [[package]] name = "proc-macro2" -version = "1.0.42" +version = "1.0.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c278e965f1d8cf32d6e0e96de3d3e79712178ae67986d9cf9151f51e95aac89b" +checksum = "0a2ca2c61bc9f3d74d2886294ab7b9853abd9c1ad903a3ac7815c58989bb7bab" dependencies = [ "unicode-ident", ] [[package]] -name = "quote" -version = "1.0.20" +name = "prost" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bcdf212e9776fbcb2d23ab029360416bb1706b1aea2d1a5ba002727cbcab804" +checksum = "71adf41db68aa0daaefc69bb30bcd68ded9b9abaad5d1fbb6304c4fb390e083e" +dependencies = [ + "bytes", + "prost-derive", +] + +[[package]] +name = "prost-build" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ae5a4388762d5815a9fc0dea33c56b021cdc8dde0c55e0c9ca57197254b0cab" +dependencies = [ + "bytes", + "cfg-if", + "cmake", + "heck", + "itertools", + "lazy_static", + "log", + "multimap", + "petgraph", + "prost", + "prost-types", + "regex", + "tempfile", + "which", +] + +[[package]] +name = "prost-derive" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b670f45da57fb8542ebdbb6105a925fe571b67f9e7ed9f47a06a84e72b4e7cc" +dependencies = [ + "anyhow", + "itertools", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "prost-types" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d0a014229361011dc8e69c8a1ec6c2e8d0f2af7c91e3ea3f5b2170298461e68" +dependencies = [ + "bytes", + "prost", +] + +[[package]] +name = "quote" +version = "1.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179" dependencies = [ "proc-macro2", ] +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" +dependencies = [ + "getrandom", +] + +[[package]] +name = "redox_syscall" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +dependencies = [ + "bitflags", +] + [[package]] name = "regex" version = "1.6.0" @@ -144,22 +711,96 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244" [[package]] -name = "scratch" -version = "1.0.1" +name = "remove_dir_all" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96311ef4a16462c757bb6a39152c40f58f31cd2602a40fceb937e2bc34e6cbab" +checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" +dependencies = [ + "winapi", +] + +[[package]] +name = "scopeguard" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" + +[[package]] +name = "scratch" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8132065adcfd6e02db789d9285a0deb2f3fcb04002865ab67d5fb103533898" + +[[package]] +name = "sha-1" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "028f48d513f9678cda28f6e4064755b3fbb2af6acd672f2c209b62323f7aea0f" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "signal-hook-registry" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0" +dependencies = [ + "libc", +] + +[[package]] +name = "slab" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4614a76b2a8be0058caa9dbbaf66d988527d86d003c11a94fbd335d7661edcef" +dependencies = [ + "autocfg", +] + +[[package]] +name = "smallvec" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fd0db749597d91ff862fd1d55ea87f7855a744a8425a64695b6fca237d1dad1" + +[[package]] +name = "socket2" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10c98bba371b9b22a71a9414e420f92ddeb2369239af08200816169d5e2dd7aa" +dependencies = [ + "libc", + "winapi", +] [[package]] name = "syn" -version = "1.0.98" +version = "1.0.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c50aef8a904de4c23c788f104b7dddc7d6f79c647c7c8ce4cc8f73eb0ca773dd" +checksum = "58dbef6ec655055e20b86b15a8cc6d439cca19b667537ac6a1369572d151ab13" dependencies = [ "proc-macro2", "quote", "unicode-ident", ] +[[package]] +name = "tempfile" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" +dependencies = [ + "cfg-if", + "fastrand", + "libc", + "redox_syscall", + "remove_dir_all", + "winapi", +] + [[package]] name = "termcolor" version = "1.1.3" @@ -170,10 +811,129 @@ dependencies = [ ] [[package]] -name = "unicode-ident" -version = "1.0.2" +name = "thiserror" +version = "1.0.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15c61ba63f9235225a22310255a29b806b907c9b8c964bcbd0a2c70f3f2deea7" +checksum = "f5f6586b7f764adc0231f4c79be7b920e766bb2f3e51b3661cdb263828f19994" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12bafc5b54507e0149cdf1b145a5d80ab80a90bcd9275df43d4fff68460f6c21" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" + +[[package]] +name = "tokio" +version = "1.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a8325f63a7d4774dd041e363b2409ed1c5cbbd0f867795e661df066b2b0a581" +dependencies = [ + "autocfg", + "bytes", + "libc", + "memchr", + "mio", + "num_cpus", + "once_cell", + "parking_lot", + "pin-project-lite", + "signal-hook-registry", + "socket2", + "tokio-macros", + "winapi", +] + +[[package]] +name = "tokio-macros" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9724f9a975fb987ef7a3cd9be0350edcbe130698af5b8f7a631e23d42d052484" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tokio-tungstenite" +version = "0.17.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f714dd15bead90401d77e04243611caec13726c2408afd5b31901dfcdcb3b181" +dependencies = [ + "futures-util", + "log", + "tokio", + "tungstenite", +] + +[[package]] +name = "tungstenite" +version = "0.17.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e27992fd6a8c29ee7eef28fc78349aa244134e10ad447ce3b9f0ac0ed0fa4ce0" +dependencies = [ + "base64", + "byteorder", + "bytes", + "http", + "httparse", + "log", + "rand", + "sha-1", + "thiserror", + "url", + "utf-8", +] + +[[package]] +name = "typenum" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" + +[[package]] +name = "unicode-bidi" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" + +[[package]] +name = "unicode-ident" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4f5b37a154999a8f3f98cc23a628d850e154479cd94decf3414696e12e31aaf" + +[[package]] +name = "unicode-normalization" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "854cbdc4f7bc6ae19c820d44abdc3277ac3e1b2b93db20a636825d9322fb60e6" +dependencies = [ + "tinyvec", +] [[package]] name = "unicode-width" @@ -181,6 +941,47 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973" +[[package]] +name = "url" +version = "2.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a507c383b2d33b5fc35d1861e77e6b383d158b2da5e14fe51b83dfedf6fd578c" +dependencies = [ + "form_urlencoded", + "idna", + "matches", + "percent-encoding", +] + +[[package]] +name = "utf-8" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "which" +version = "4.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c4fb54e6113b6a8772ee41c3404fb0301ac79604489467e0a9ce1f3e97c24ae" +dependencies = [ + "either", + "lazy_static", + "libc", +] + [[package]] name = "winapi" version = "0.3.9" @@ -211,3 +1012,46 @@ name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-sys" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" +dependencies = [ + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" + +[[package]] +name = "windows_i686_gnu" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" + +[[package]] +name = "windows_i686_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" diff --git a/Cargo.toml b/Cargo.toml index bd716a2..5c8a562 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,20 +1,13 @@ [package] -name = "livekit-native" +name = "livekit" version = "0.1.0" edition = "2021" -homepage = "https://livekit.io" -crate-type = ["lib"] +repository = "https://github.com/livekit/client-sdk-native" -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] -cxx = "1.0" - -[build-dependencies] -cxx-build = "1.0" -glob = "0.3.0" -regex = "1.0" - -[lib] -crate-type = ["staticlib", "cdylib"] -bench = false +[workspace] +exclude = ["libwebrtc"] +members = [ + "crates/livekit-core", + "crates/livekit-webrtc", + "crates/livekit-webrtc/libwebrtc-sys" +] diff --git a/crates/livekit-core/Cargo.lock b/crates/livekit-core/Cargo.lock new file mode 100644 index 0000000..ad165bf --- /dev/null +++ b/crates/livekit-core/Cargo.lock @@ -0,0 +1,935 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "aho-corasick" +version = "0.7.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f" +dependencies = [ + "memchr", +] + +[[package]] +name = "anyhow" +version = "1.0.62" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1485d4d2cc45e7b201ee3767015c96faa5904387c9d87c6efdd0fb511f12d305" + +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +dependencies = [ + "hermit-abi", + "libc", + "winapi", +] + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "base64" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "block-buffer" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bf7fe51849ea569fd452f37822f606a5cabb684dc918707a0193fd4664ff324" +dependencies = [ + "generic-array", +] + +[[package]] +name = "byteorder" +version = "1.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" + +[[package]] +name = "bytes" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec8a7b6a70fde80372154c65702f00a0f56f3e1c36abbc6c440484be248856db" + +[[package]] +name = "cc" +version = "1.0.73" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "cmake" +version = "0.1.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8ad8cef104ac57b68b89df3208164d228503abbdce70f6880ffa3d970e7443a" +dependencies = [ + "cc", +] + +[[package]] +name = "cpufeatures" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59a6001667ab124aebae2a495118e11d30984c3a653e99d86d58971708cf5e4b" +dependencies = [ + "libc", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "digest" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2fb860ca6fafa5552fb6d0e816a69c8e49f0908bf524e30a90d97c85892d506" +dependencies = [ + "block-buffer", + "crypto-common", +] + +[[package]] +name = "either" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797" + +[[package]] +name = "env_logger" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b2cf0344971ee6c64c31be0d530793fba457d322dfec2810c453d0ef228f9c3" +dependencies = [ + "atty", + "humantime", + "log", + "regex", + "termcolor", +] + +[[package]] +name = "fastrand" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7a407cfaa3385c4ae6b23e84623d48c2798d06e3e6a1878f7f59f17b3f86499" +dependencies = [ + "instant", +] + +[[package]] +name = "fixedbitset" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "form_urlencoded" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fc25a87fa4fd2094bffb06925852034d90a17f0d1e05197d4956d3555752191" +dependencies = [ + "matches", + "percent-encoding", +] + +[[package]] +name = "futures-core" +version = "0.3.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2acedae88d38235936c3922476b10fced7b2b68136f5e3c03c2d5be348a1115" + +[[package]] +name = "futures-macro" +version = "0.3.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0db9cce532b0eae2ccf2766ab246f114b56b9cf6d445e00c2549fbc100ca045d" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "futures-sink" +version = "0.3.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca0bae1fe9752cf7fd9b0064c674ae63f97b37bc714d745cbde0afb7ec4e6765" + +[[package]] +name = "futures-task" +version = "0.3.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "842fc63b931f4056a24d59de13fb1272134ce261816e063e634ad0c15cdc5306" + +[[package]] +name = "futures-util" +version = "0.3.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0828a5471e340229c11c77ca80017937ce3c58cb788a17e5f1c2d5c485a9577" +dependencies = [ + "futures-core", + "futures-macro", + "futures-sink", + "futures-task", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "generic-array" +version = "0.14.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4eb1a864a501629691edf6c15a593b7a51eebaa1e8468e9ddc623de7c9b58ec6" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + +[[package]] +name = "heck" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9" + +[[package]] +name = "hermit-abi" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] + +[[package]] +name = "http" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "httparse" +version = "1.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "496ce29bb5a52785b44e0f7ca2847ae0bb839c9bd28f69acac9b99d461c0c04c" + +[[package]] +name = "humantime" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" + +[[package]] +name = "idna" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" +dependencies = [ + "matches", + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "indexmap" +version = "1.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e" +dependencies = [ + "autocfg", + "hashbrown", +] + +[[package]] +name = "instant" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "itertools" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9a9d19fa1e79b6215ff29b9d6880b706147f16e9b1dbb1e4e5947b5b02bc5e3" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c8af84674fe1f223a982c933a0ee1086ac4d4052aa0fb8060c12c6ad838e754" + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "libc" +version = "0.2.132" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8371e4e5341c3a96db127eb2465ac681ced4c433e01dd0e938adbef26ba93ba5" + +[[package]] +name = "livekit" +version = "0.1.0" +dependencies = [ + "env_logger", + "futures-util", + "log", + "prost", + "prost-build", + "prost-types", + "thiserror", + "tokio", + "tokio-tungstenite", + "url", +] + +[[package]] +name = "lock_api" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "327fa5b6a6940e4699ec49a9beae1ea4845c6bab9314e4f84ac68742139d8c53" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "matches" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" + +[[package]] +name = "memchr" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" + +[[package]] +name = "mio" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57ee1c23c7c63b0c9250c339ffdc69255f110b298b901b9f6c82547b7b87caaf" +dependencies = [ + "libc", + "log", + "wasi", + "windows-sys", +] + +[[package]] +name = "multimap" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" + +[[package]] +name = "num_cpus" +version = "1.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" +dependencies = [ + "hermit-abi", + "libc", +] + +[[package]] +name = "once_cell" +version = "1.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "074864da206b4973b84eb91683020dbefd6a8c3f0f38e054d93954e891935e4e" + +[[package]] +name = "parking_lot" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09a279cbf25cb0757810394fbc1e359949b59e348145c643a939a525692e6929" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-sys", +] + +[[package]] +name = "percent-encoding" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" + +[[package]] +name = "petgraph" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6d5014253a1331579ce62aa67443b4a658c5e7dd03d4bc6d302b94474888143" +dependencies = [ + "fixedbitset", + "indexmap", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "ppv-lite86" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" + +[[package]] +name = "proc-macro2" +version = "1.0.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a2ca2c61bc9f3d74d2886294ab7b9853abd9c1ad903a3ac7815c58989bb7bab" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "prost" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71adf41db68aa0daaefc69bb30bcd68ded9b9abaad5d1fbb6304c4fb390e083e" +dependencies = [ + "bytes", + "prost-derive", +] + +[[package]] +name = "prost-build" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ae5a4388762d5815a9fc0dea33c56b021cdc8dde0c55e0c9ca57197254b0cab" +dependencies = [ + "bytes", + "cfg-if", + "cmake", + "heck", + "itertools", + "lazy_static", + "log", + "multimap", + "petgraph", + "prost", + "prost-types", + "regex", + "tempfile", + "which", +] + +[[package]] +name = "prost-derive" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b670f45da57fb8542ebdbb6105a925fe571b67f9e7ed9f47a06a84e72b4e7cc" +dependencies = [ + "anyhow", + "itertools", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "prost-types" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d0a014229361011dc8e69c8a1ec6c2e8d0f2af7c91e3ea3f5b2170298461e68" +dependencies = [ + "bytes", + "prost", +] + +[[package]] +name = "quote" +version = "1.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" +dependencies = [ + "getrandom", +] + +[[package]] +name = "redox_syscall" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +dependencies = [ + "bitflags", +] + +[[package]] +name = "regex" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c4eb3267174b8c6c2f654116623910a0fef09c4753f8dd83db29c48a0df988b" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.6.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244" + +[[package]] +name = "remove_dir_all" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" +dependencies = [ + "winapi", +] + +[[package]] +name = "scopeguard" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" + +[[package]] +name = "sha-1" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "028f48d513f9678cda28f6e4064755b3fbb2af6acd672f2c209b62323f7aea0f" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "signal-hook-registry" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0" +dependencies = [ + "libc", +] + +[[package]] +name = "slab" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4614a76b2a8be0058caa9dbbaf66d988527d86d003c11a94fbd335d7661edcef" +dependencies = [ + "autocfg", +] + +[[package]] +name = "smallvec" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fd0db749597d91ff862fd1d55ea87f7855a744a8425a64695b6fca237d1dad1" + +[[package]] +name = "socket2" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "66d72b759436ae32898a2af0a14218dbf55efde3feeb170eb623637db85ee1e0" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "syn" +version = "1.0.99" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58dbef6ec655055e20b86b15a8cc6d439cca19b667537ac6a1369572d151ab13" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "tempfile" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" +dependencies = [ + "cfg-if", + "fastrand", + "libc", + "redox_syscall", + "remove_dir_all", + "winapi", +] + +[[package]] +name = "termcolor" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "thiserror" +version = "1.0.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5f6586b7f764adc0231f4c79be7b920e766bb2f3e51b3661cdb263828f19994" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12bafc5b54507e0149cdf1b145a5d80ab80a90bcd9275df43d4fff68460f6c21" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" + +[[package]] +name = "tokio" +version = "1.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a8325f63a7d4774dd041e363b2409ed1c5cbbd0f867795e661df066b2b0a581" +dependencies = [ + "autocfg", + "bytes", + "libc", + "memchr", + "mio", + "num_cpus", + "once_cell", + "parking_lot", + "pin-project-lite", + "signal-hook-registry", + "socket2", + "tokio-macros", + "winapi", +] + +[[package]] +name = "tokio-macros" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9724f9a975fb987ef7a3cd9be0350edcbe130698af5b8f7a631e23d42d052484" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tokio-tungstenite" +version = "0.17.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f714dd15bead90401d77e04243611caec13726c2408afd5b31901dfcdcb3b181" +dependencies = [ + "futures-util", + "log", + "tokio", + "tungstenite", +] + +[[package]] +name = "tungstenite" +version = "0.17.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e27992fd6a8c29ee7eef28fc78349aa244134e10ad447ce3b9f0ac0ed0fa4ce0" +dependencies = [ + "base64", + "byteorder", + "bytes", + "http", + "httparse", + "log", + "rand", + "sha-1", + "thiserror", + "url", + "utf-8", +] + +[[package]] +name = "typenum" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" + +[[package]] +name = "unicode-bidi" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" + +[[package]] +name = "unicode-ident" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4f5b37a154999a8f3f98cc23a628d850e154479cd94decf3414696e12e31aaf" + +[[package]] +name = "unicode-normalization" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "854cbdc4f7bc6ae19c820d44abdc3277ac3e1b2b93db20a636825d9322fb60e6" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "url" +version = "2.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a507c383b2d33b5fc35d1861e77e6b383d158b2da5e14fe51b83dfedf6fd578c" +dependencies = [ + "form_urlencoded", + "idna", + "matches", + "percent-encoding", +] + +[[package]] +name = "utf-8" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "which" +version = "4.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c4fb54e6113b6a8772ee41c3404fb0301ac79604489467e0a9ce1f3e97c24ae" +dependencies = [ + "either", + "lazy_static", + "libc", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +dependencies = [ + "winapi", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-sys" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" +dependencies = [ + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" + +[[package]] +name = "windows_i686_gnu" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" + +[[package]] +name = "windows_i686_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" diff --git a/crates/livekit-core/Cargo.toml b/crates/livekit-core/Cargo.toml new file mode 100644 index 0000000..dbe4c52 --- /dev/null +++ b/crates/livekit-core/Cargo.toml @@ -0,0 +1,22 @@ +[package] +name = "livekit-core" +version = "0.1.0" +edition = "2021" +crate-type = ["lib"] + +[dependencies] +log = "0.4" +tokio-tungstenite = "0.17.2" +tokio = { version = "1.20.1", features = ["full"] } +url = "2.2.2" +futures-util = "0.3.23" +thiserror = "1.0.32" +prost = "0.10" +prost-types = "0.10" +anyhow = "1.0.63" + +[build-dependencies] +prost-build = { version = "0.10" } + +[dev-dependencies] +env_logger = "0.9" diff --git a/crates/livekit-core/build.rs b/crates/livekit-core/build.rs new file mode 100644 index 0000000..cc175df --- /dev/null +++ b/crates/livekit-core/build.rs @@ -0,0 +1,12 @@ +use std::io::Result; + +fn main() -> Result<()> { + prost_build::compile_protos( + &[ + "protocol/livekit_rtc.proto", + "protocol/livekit_models.proto", + ], + &["protocol/"], + )?; + Ok(()) +} diff --git a/crates/livekit-core/protocol b/crates/livekit-core/protocol new file mode 160000 index 0000000..6ec04e9 --- /dev/null +++ b/crates/livekit-core/protocol @@ -0,0 +1 @@ +Subproject commit 6ec04e9ca47ebad2f3426be543fb6cbeef58c2b5 diff --git a/crates/livekit-core/src/lib.rs b/crates/livekit-core/src/lib.rs new file mode 100644 index 0000000..15669d3 --- /dev/null +++ b/crates/livekit-core/src/lib.rs @@ -0,0 +1,8 @@ +pub mod proto { + include!(concat!(env!("OUT_DIR"), "/livekit.rs")); +} + +mod rtc_engine; +mod signal_client; + +pub mod room; diff --git a/crates/livekit-core/src/room.rs b/crates/livekit-core/src/room.rs new file mode 100644 index 0000000..8be9529 --- /dev/null +++ b/crates/livekit-core/src/room.rs @@ -0,0 +1 @@ +pub struct Room {} diff --git a/crates/livekit-core/src/rtc_engine.rs b/crates/livekit-core/src/rtc_engine.rs new file mode 100644 index 0000000..0354acb --- /dev/null +++ b/crates/livekit-core/src/rtc_engine.rs @@ -0,0 +1,60 @@ +use crate::proto::signal_response; +use crate::signal_client::{SignalClient, SignalClientError}; +use log::error; +use tokio::sync::broadcast; + +pub struct RTCEngine { + signal_client: SignalClient, +} + +impl RTCEngine { + pub fn new() -> RTCEngine { + Self { + signal_client: SignalClient::new(), + } + } + + pub async fn connect(&mut self, url: &str, token: &str) -> Result<(), SignalClientError> { + self.signal_client.connect(url, token).await?; + + tokio::spawn(Self::handle_rtc( + self.signal_client.response_rx.resubscribe(), + )); + + Ok(()) + } + + + pub fn update(&self) {} + + async fn handle_rtc(mut signal_receiver: broadcast::Receiver) { + loop { + let msg = match signal_receiver.recv().await { + Ok(msg) => msg, + Err(error) => { + error!("Failed to receive SignalResponse: {:?}", error); + continue; + } + }; + + match msg { + signal_response::Message::Join(join) => {} + signal_response::Message::Trickle(trickle) => {} + signal_response::Message::Answer(answer) => {} + signal_response::Message::Offer(offer) => {} + _ => {} + } + } + } +} + +#[tokio::test] +async fn test_test() { + env_logger::init(); + + let mut engine = RTCEngine::new(); + engine.connect("ws://localhost:7880", "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2NjQ1OTY4MDYsImlzcyI6IkFQSUNrSG04M01oZ2hQeCIsIm5hbWUiOiJ1c2VyMSIsIm5iZiI6MTY2MDk5NjgwNiwic3ViIjoidXNlcjEiLCJ2aWRlbyI6eyJyb29tIjoibXktZmlyc3Qtcm9vbSIsInJvb21Kb2luIjp0cnVlfX0.SWU_LETMK6ZmFOf38pYjVhpur0o7jJc6u61h8BH7g20").await.unwrap(); + + // Wait before exiting the program + tokio::time::sleep(core::time::Duration::from_millis(1000 * 25)).await; +} diff --git a/crates/livekit-core/src/signal_client.rs b/crates/livekit-core/src/signal_client.rs new file mode 100644 index 0000000..717f948 --- /dev/null +++ b/crates/livekit-core/src/signal_client.rs @@ -0,0 +1,100 @@ +use futures_util::SinkExt; +use futures_util::StreamExt; +use log::{error, info}; +use prost::Message as ProtoMessage; +use std::borrow::Borrow; +use thiserror::Error; +use tokio::net::TcpStream; +use tokio::sync::broadcast; +use tokio::task::JoinHandle; +use tokio_tungstenite::tungstenite::Message; +use tokio_tungstenite::{connect_async, MaybeTlsStream, WebSocketStream}; + +use crate::{proto, proto::signal_response}; + +#[derive(Error, Debug)] +pub enum SignalClientError { + #[error("websocket failure")] + WebSocket(#[from] tokio_tungstenite::tungstenite::Error), + #[error("failed to parse the url")] + UrlParse(#[from] url::ParseError), + #[error("failed to parse messages from server")] + ProtoParse(#[from] prost::DecodeError), +} + +pub struct SignalClient { + ws_handle: Option>>, + response_tx: broadcast::Sender, + pub response_rx: broadcast::Receiver, +} + +impl SignalClient { + pub fn new() -> Self { + let (tx, rx) = broadcast::channel(16); + + Self { + response_tx: tx, + response_rx: rx, + ws_handle: None, + } + } + + pub async fn connect(&mut self, url: &str, token: &str) -> Result<(), SignalClientError> { + let mut lk_url = url::Url::parse(url)?; + lk_url.set_path("/rtc"); + lk_url + .query_pairs_mut() + .append_pair("access_token", token) + .append_pair("protocol", "8"); + + info!("Connecting to {}", lk_url); + let (ws, _) = connect_async(&lk_url).await?; + + self.ws_handle = Some(tokio::spawn(Self::handle_ws(ws, self.response_tx.clone()))); + Ok(()) + } + + pub async fn disconnect() { + unimplemented!() + } + + async fn handle_ws( + mut ws: WebSocketStream>, + response_tx: broadcast::Sender, + ) -> Result<(), SignalClientError> { + loop { + tokio::select! { + next_msg = ws.next() => { + let ws_msg = match next_msg { + Some(msg) => msg?, + None => break, + }; + + let data = match ws_msg { + Message::Binary(data) => data, + Message::Ping(data) => { + ws.send(Message::Pong(data)).await?; + continue + }, + Message::Close(_frame) => break, + _ => continue, + }; + + let proto_msg = proto::SignalResponse::decode(data.borrow())?; + let signal_response = proto_msg.message.unwrap(); + + match signal_response { + signal_response::Message::Pong(ts) => { + + }, + _ => { + response_tx.send(signal_response).unwrap(); + } + } + } + } + } + + Ok(()) + } +} diff --git a/crates/livekit-webrtc/.cargo/config b/crates/livekit-webrtc/.cargo/config new file mode 100644 index 0000000..0c17df0 --- /dev/null +++ b/crates/livekit-webrtc/.cargo/config @@ -0,0 +1,2 @@ +[target.x86_64-pc-windows-msvc] +rustflags = ["-C", "target-feature=+crt-static"] \ No newline at end of file diff --git a/crates/livekit-webrtc/Cargo.toml b/crates/livekit-webrtc/Cargo.toml new file mode 100644 index 0000000..eb37b67 --- /dev/null +++ b/crates/livekit-webrtc/Cargo.toml @@ -0,0 +1,14 @@ +[package] +name = "livekit-webrtc" +version = "0.1.0" +edition = "2021" +homepage = "https://livekit.io" + +[dependencies] +libwebrtc-sys = { path = "./libwebrtc-sys" } +tokio = { version = "1.20.1", features = ["full"] } +cxx = "1.0" +log = "0.4" + +[dev-dependencies] +env_logger = "0.9" \ No newline at end of file diff --git a/crates/livekit-webrtc/libwebrtc-sys/.cargo/config b/crates/livekit-webrtc/libwebrtc-sys/.cargo/config new file mode 100644 index 0000000..0c17df0 --- /dev/null +++ b/crates/livekit-webrtc/libwebrtc-sys/.cargo/config @@ -0,0 +1,2 @@ +[target.x86_64-pc-windows-msvc] +rustflags = ["-C", "target-feature=+crt-static"] \ No newline at end of file diff --git a/crates/livekit-webrtc/libwebrtc-sys/.gitignore b/crates/livekit-webrtc/libwebrtc-sys/.gitignore new file mode 100644 index 0000000..1a2f000 --- /dev/null +++ b/crates/livekit-webrtc/libwebrtc-sys/.gitignore @@ -0,0 +1,2 @@ +/libwebrtc +/cmake-build-debug \ No newline at end of file diff --git a/crates/livekit-webrtc/libwebrtc-sys/CMakeLists.txt b/crates/livekit-webrtc/libwebrtc-sys/CMakeLists.txt new file mode 100644 index 0000000..b2b7e04 --- /dev/null +++ b/crates/livekit-webrtc/libwebrtc-sys/CMakeLists.txt @@ -0,0 +1,23 @@ +# IMPORTANT NOTE +# This file is just used because some IDEs need to understand how to do autocompletion. +# This file is completely ignored by the library ( See build.rs for the build system ) + +cmake_minimum_required(VERSION 3.22) +project(livekit-webrtc) + +set(CMAKE_CXX_STANDARD 17) + +add_definitions(-DWEBRTC_WIN) + +include_directories(libwebrtc/include) +include_directories(libwebrtc/include/third_party/abseil-cpp/) +include_directories(libwebrtc/include/third_party/libc++/) +include_directories(include/) +include_directories(../../../target/cxxbridge) # Can be different + +file(GLOB_RECURSE SRC src/*.cpp) +add_library(livekit-webrtc ${SRC}) + +#include_directories(/Users/theomonnom/Library/Android/sdk/ndk/25.0.8775105/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include) +#find_library(ANDROID_LIB_ANDROID android) +#target_link_libraries(client_sdk_native PRIVATE android) \ No newline at end of file diff --git a/crates/livekit-webrtc/libwebrtc-sys/Cargo.lock b/crates/livekit-webrtc/libwebrtc-sys/Cargo.lock new file mode 100644 index 0000000..12e9ece --- /dev/null +++ b/crates/livekit-webrtc/libwebrtc-sys/Cargo.lock @@ -0,0 +1,213 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "aho-corasick" +version = "0.7.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f" +dependencies = [ + "memchr", +] + +[[package]] +name = "cc" +version = "1.0.73" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" + +[[package]] +name = "codespan-reporting" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" +dependencies = [ + "termcolor", + "unicode-width", +] + +[[package]] +name = "cxx" +version = "1.0.73" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "873c2e83af70859af2aaecd1f5d862f3790b747b1f4f50fb45a931d000ac0422" +dependencies = [ + "cc", + "cxxbridge-flags", + "cxxbridge-macro", + "link-cplusplus", +] + +[[package]] +name = "cxx-build" +version = "1.0.73" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b49edea7163bbc7a39e3d829b4b0b66a9d30486973152842b7413f2c7b5632bf" +dependencies = [ + "cc", + "codespan-reporting", + "once_cell", + "proc-macro2", + "quote", + "scratch", + "syn", +] + +[[package]] +name = "cxxbridge-flags" +version = "1.0.73" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f46b787c15af80277db5c88c6ac6c502ae545e622f010e06f95e540d34931acf" + +[[package]] +name = "cxxbridge-macro" +version = "1.0.73" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ba3f3a7efa46626878fb5d324fabca4d19d2956b6ae97ce43044ef4515f5abc" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "glob" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" + +[[package]] +name = "link-cplusplus" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8cae2cd7ba2f3f63938b9c724475dfb7b9861b545a90324476324ed21dbc8c8" +dependencies = [ + "cc", +] + +[[package]] +name = "livekit-native" +version = "0.1.0" +dependencies = [ + "cxx", + "cxx-build", + "glob", + "regex", +] + +[[package]] +name = "memchr" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" + +[[package]] +name = "once_cell" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18a6dbe30758c9f83eb00cbea4ac95966305f5a7772f3f42ebfc7fc7eddbd8e1" + +[[package]] +name = "proc-macro2" +version = "1.0.42" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c278e965f1d8cf32d6e0e96de3d3e79712178ae67986d9cf9151f51e95aac89b" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3bcdf212e9776fbcb2d23ab029360416bb1706b1aea2d1a5ba002727cbcab804" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "regex" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c4eb3267174b8c6c2f654116623910a0fef09c4753f8dd83db29c48a0df988b" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.6.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244" + +[[package]] +name = "scratch" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96311ef4a16462c757bb6a39152c40f58f31cd2602a40fceb937e2bc34e6cbab" + +[[package]] +name = "syn" +version = "1.0.98" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c50aef8a904de4c23c788f104b7dddc7d6f79c647c7c8ce4cc8f73eb0ca773dd" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "termcolor" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "unicode-ident" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15c61ba63f9235225a22310255a29b806b907c9b8c964bcbd0a2c70f3f2deea7" + +[[package]] +name = "unicode-width" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973" + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +dependencies = [ + "winapi", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/crates/livekit-webrtc/libwebrtc-sys/Cargo.toml b/crates/livekit-webrtc/libwebrtc-sys/Cargo.toml new file mode 100644 index 0000000..19635b1 --- /dev/null +++ b/crates/livekit-webrtc/libwebrtc-sys/Cargo.toml @@ -0,0 +1,21 @@ +[package] +name = "libwebrtc-sys" +version = "0.1.0" +edition = "2021" +homepage = "https://livekit.io" + +[dependencies] +cxx = "1.0" +log = "0.4" + +[build-dependencies] +cxx-build = "1.0" +glob = "0.3.0" +regex = "1.0" +cc = { version = "1.0", features = ["parallel"] } + +[dev-dependencies] +env_logger = "0.9" + +#[lib] +#crate-type = ["staticlib", "cdylib"] diff --git a/build.rs b/crates/livekit-webrtc/libwebrtc-sys/build.rs similarity index 56% rename from build.rs rename to crates/livekit-webrtc/libwebrtc-sys/build.rs index 7d734a9..f575299 100644 --- a/build.rs +++ b/crates/livekit-webrtc/libwebrtc-sys/build.rs @@ -1,13 +1,58 @@ -use regex::Regex; use std::env; use std::fs; use std::io::Write; use std::path; +use std::process::Command; +use regex::Regex; + +const MAC_SDKS: &str = + "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs"; + +fn get_mac_sysroot() -> String { + let mut sdks: Vec = vec![]; + let files = fs::read_dir(MAC_SDKS).unwrap(); + for entry in files { + let entry = entry.unwrap(); + let filename = entry.file_name().to_str().unwrap().to_owned(); + sdks.push(filename); + } + + sdks = sdks + .iter() + .filter(|value| value.contains("MacOSX1")) + .map(|original| original.to_owned()) + .collect(); + + let last = sdks.last().unwrap(); + + format!("{}/{}", MAC_SDKS, &last) +} + +fn macos_link_search_path() -> Option { + let output = Command::new("clang") + .arg("--print-search-dirs") + .output() + .ok()?; + if !output.status.success() { + // Failed to run 'clang --print-search-dirs'. + return None; + } + + let stdout = String::from_utf8_lossy(&output.stdout); + for line in stdout.lines() { + if line.contains("libraries: =") { + let path = line.split('=').nth(1)?; + return Some(format!("{}/lib/darwin", path)); + } + } + + // Failed to determine link search path. + None +} fn main() { // TODO Download precompiled binaries of WebRTC for the target_os - - let target_os = "ios"; + let target_os = "windows"; //let target_arch = "arm64"; let libwebrtc_dir = path::PathBuf::from("libwebrtc"); @@ -18,15 +63,32 @@ fn main() { libwebrtc_dir.join("include/"), libwebrtc_dir.join("include/third_party/abseil-cpp/"), libwebrtc_dir.join("include/third_party/libc++/"), - // For mac & ios libwebrtc_dir.join("include/sdk/objc"), libwebrtc_dir.join("include/sdk/objc/base"), ]; - let mut builder = cxx_build::bridges(&["src/lib.rs"]); - builder.flag("-std=c++17"); + let mut builder = cxx_build::bridges(&[ + "src/peer_connection.rs", + "src/peer_connection_factory.rs", + "src/media_stream_interface.rs", + "src/data_channel.rs", + "src/jsep.rs", + "src/candidate.rs", + "src/rtp_receiver.rs", + "src/rtp_transceiver.rs", + "src/rtc_error.rs", + ]); + + builder.file("src/peer_connection.cpp"); builder.file("src/peer_connection_factory.cpp"); + builder.file("src/media_stream_interface.cpp"); + builder.file("src/data_channel.cpp"); + builder.file("src/jsep.cpp"); + builder.file("src/candidate.cpp"); + builder.file("src/rtp_receiver.cpp"); + builder.file("src/rtp_transceiver.cpp"); + builder.file("src/rtc_error.cpp"); for include in includes { builder.include(include); @@ -38,6 +100,28 @@ fn main() { ); match target_os { + "windows" => { + println!("cargo:rustc-link-lib=dylib=msdmo"); + println!("cargo:rustc-link-lib=dylib=wmcodecdspuuid"); + println!("cargo:rustc-link-lib=dylib=dmoguids"); + println!("cargo:rustc-link-lib=dylib=crypt32"); + println!("cargo:rustc-link-lib=dylib=iphlpapi"); + println!("cargo:rustc-link-lib=dylib=ole32"); + println!("cargo:rustc-link-lib=dylib=secur32"); + println!("cargo:rustc-link-lib=dylib=winmm"); + println!("cargo:rustc-link-lib=dylib=ws2_32"); + println!("cargo:rustc-link-lib=dylib=strmiids"); + println!("cargo:rustc-link-lib=dylib=d3d11"); + println!("cargo:rustc-link-lib=dylib=dxgi"); + println!("cargo:rustc-link-lib=dylib=dwmapi"); + println!("cargo:rustc-link-lib=dylib=webrtc"); + + builder + .flag("/std:c++17") + .flag("/EHsc") + .define("WEBRTC_WIN", None) + .define("NOMINMAX", None); + } "macos" => { println!("cargo:rustc-link-lib=dylib=c++"); println!("cargo:rustc-link-lib=framework=Foundation"); @@ -47,16 +131,31 @@ fn main() { println!("cargo:rustc-link-lib=framework=Appkit"); println!("cargo:rustc-link-lib=framework=CoreMedia"); println!("cargo:rustc-link-lib=framework=CoreGraphics"); + println!("cargo:rustc-link-lib=framework=VideoToolbox"); + println!("cargo:rustc-link-lib=framework=CoreVideo"); + println!("cargo:rustc-link-lib=framework=OpenGL"); + println!("cargo:rustc-link-lib=framework=Metal"); + 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=static=webrtc"); builder .flag("-stdlib=libc++") + .flag("-std=c++17") + .flag(format!("-isysroot{}", get_mac_sysroot()).as_str()) .define("WEBRTC_ENABLE_OBJC_SYMBOL_EXPORT", None) .define("WEBRTC_POSIX", None) .define("WEBRTC_MAC", None); + + if let Some(path) = macos_link_search_path() { + println!("cargo:rustc-link-lib=clang_rt.osx"); + println!("cargo:rustc-link-search={}", path); + } } "ios" => { - builder + .flag("-std=c++17") .file("src/objc_test.mm") .define("WEBRTC_ENABLE_OBJC_SYMBOL_EXPORT", None) .define("WEBRTC_MAC", None) @@ -84,10 +183,7 @@ fn main() { // libgcc ( redirects to libunwind ) println!( "cargo:rustc-link-search={}", - toolchain - .join("lib") - .to_str() - .unwrap() + toolchain.join("lib").to_str().unwrap() ); // Needed when loading the library in the JVM ( System.loadLibrary ) @@ -129,12 +225,13 @@ fn main() { ); builder + .flag("-std=c++17") .define("WEBRTC_LINUX", None) .define("WEBRTC_POSIX", None) .define("WEBRTC_ANDROID", None); } _ => { - panic!("Unsupported platform, {}", target_os); + panic!("Unsupported target, {}", target_os); } } diff --git a/crates/livekit-webrtc/libwebrtc-sys/include/livekit/candidate.h b/crates/livekit-webrtc/libwebrtc-sys/include/livekit/candidate.h new file mode 100644 index 0000000..db35237 --- /dev/null +++ b/crates/livekit-webrtc/libwebrtc-sys/include/livekit/candidate.h @@ -0,0 +1,28 @@ +// +// Created by Théo Monnom on 01/09/2022. +// + +#ifndef CLIENT_SDK_NATIVE_CANDIDATE_H +#define CLIENT_SDK_NATIVE_CANDIDATE_H + +#include +#include "api/candidate.h" + +// cricket::Candidate +namespace livekit { + + class Candidate { + public: + explicit Candidate(const cricket::Candidate &candidate); + + private: + cricket::Candidate candidate_; + }; + + static std::unique_ptr _unique_candidate(){ + return nullptr; + } + +} // livekit + +#endif //CLIENT_SDK_NATIVE_CANDIDATE_H diff --git a/crates/livekit-webrtc/libwebrtc-sys/include/livekit/data_channel.h b/crates/livekit-webrtc/libwebrtc-sys/include/livekit/data_channel.h new file mode 100644 index 0000000..0c50656 --- /dev/null +++ b/crates/livekit-webrtc/libwebrtc-sys/include/livekit/data_channel.h @@ -0,0 +1,26 @@ +// +// Created by Théo Monnom on 01/09/2022. +// + +#ifndef CLIENT_SDK_NATIVE_DATA_CHANNEL_H +#define CLIENT_SDK_NATIVE_DATA_CHANNEL_H + +#include +#include "api/data_channel_interface.h" + +namespace livekit { + + class DataChannel { + public: + explicit DataChannel(rtc::scoped_refptr data_channel); + + private: + rtc::scoped_refptr data_channel_; + }; + + static std::unique_ptr _unique_data_channel(){ + return nullptr; // Ignore + } +} // livekit + +#endif //CLIENT_SDK_NATIVE_DATA_CHANNEL_H diff --git a/crates/livekit-webrtc/libwebrtc-sys/include/livekit/jsep.h b/crates/livekit-webrtc/libwebrtc-sys/include/livekit/jsep.h new file mode 100644 index 0000000..a7ffab3 --- /dev/null +++ b/crates/livekit-webrtc/libwebrtc-sys/include/livekit/jsep.h @@ -0,0 +1,96 @@ +// +// Created by Théo Monnom on 01/09/2022. +// + +#ifndef CLIENT_SDK_NATIVE_JSEP_H +#define CLIENT_SDK_NATIVE_JSEP_H + +#include +#include "api/jsep.h" +#include "rust/cxx.h" +#include "rust_types.h" +#include "api/ref_counted_base.h" + +namespace livekit { + + class IceCandidate { + public: + explicit IceCandidate(std::unique_ptr ice_candidate); + + private: + std::unique_ptr ice_candidate_; + }; + + static std::unique_ptr _unique_ice_candidate(){ + return nullptr; // Ignore + } + + class SessionDescription { + public: + explicit SessionDescription(std::unique_ptr session_description); + + std::unique_ptr clone() const; + std::unique_ptr release(); + + private: + std::unique_ptr session_description_; + }; + + static std::unique_ptr _unique_session_description(){ + return nullptr; // Ignore + } + + // SetCreateSdpObserver + + class NativeCreateSdpObserver : public webrtc::CreateSessionDescriptionObserver { + public: + explicit NativeCreateSdpObserver(rust::Box observer); + + void OnSuccess(webrtc::SessionDescriptionInterface* desc) override; + void OnFailure(webrtc::RTCError error) override; + private: + rust::Box observer_; + }; + + struct NativeCreateSdpObserverHandle { + rtc::scoped_refptr observer; + }; + + std::unique_ptr create_native_create_sdp_observer(rust::Box observer); + + // SetLocalSdpObserver + + class NativeSetLocalSdpObserver : public webrtc::SetLocalDescriptionObserverInterface{ + public: + explicit NativeSetLocalSdpObserver(rust::Box observer); + + void OnSetLocalDescriptionComplete(webrtc::RTCError error) override; + private: + rust::Box observer_; + }; + + struct NativeSetLocalSdpObserverHandle { + rtc::scoped_refptr observer; + }; + + std::unique_ptr create_native_set_local_sdp_observer(rust::Box observer); + + // SetRemoteSdpObserver + + class NativeSetRemoteSdpObserver : public webrtc::SetRemoteDescriptionObserverInterface{ + public: + explicit NativeSetRemoteSdpObserver(rust::Box observer); + + void OnSetRemoteDescriptionComplete(webrtc::RTCError error) override; + private: + rust::Box observer_; + }; + + struct NativeSetRemoteSdpObserverHandle { + rtc::scoped_refptr observer; + }; + + std::unique_ptr create_native_set_remote_sdp_observer(rust::Box observer); +} // livekit + +#endif //CLIENT_SDK_NATIVE_JSEP_H diff --git a/crates/livekit-webrtc/libwebrtc-sys/include/livekit/media_stream_interface.h b/crates/livekit-webrtc/libwebrtc-sys/include/livekit/media_stream_interface.h new file mode 100644 index 0000000..7356f26 --- /dev/null +++ b/crates/livekit-webrtc/libwebrtc-sys/include/livekit/media_stream_interface.h @@ -0,0 +1,26 @@ +// +// Created by Théo Monnom on 31/08/2022. +// + +#ifndef CLIENT_SDK_NATIVE_MEDIA_STREAM_INTERFACE_H +#define CLIENT_SDK_NATIVE_MEDIA_STREAM_INTERFACE_H + +#include +#include "api/media_stream_interface.h" + +namespace livekit { + + class MediaStreamInterface { + public: + explicit MediaStreamInterface(rtc::scoped_refptr stream); + + private: + rtc::scoped_refptr media_stream_; + }; + + static std::unique_ptr _unique_media_stream(){ + return nullptr; // Ignore + } +} // livekit + +#endif //CLIENT_SDK_NATIVE_MEDIA_STREAM_INTERFACE_H diff --git a/crates/livekit-webrtc/libwebrtc-sys/include/livekit/peer_connection.h b/crates/livekit-webrtc/libwebrtc-sys/include/livekit/peer_connection.h new file mode 100644 index 0000000..ed79f0d --- /dev/null +++ b/crates/livekit-webrtc/libwebrtc-sys/include/livekit/peer_connection.h @@ -0,0 +1,71 @@ +// +// Created by Théo Monnom on 30/08/2022. +// + +#ifndef CLIENT_SDK_NATIVE_PEER_CONNECTION_H +#define CLIENT_SDK_NATIVE_PEER_CONNECTION_H + +#include +#include "api/peer_connection_interface.h" +#include "rust/cxx.h" +#include "data_channel.h" +#include "jsep.h" +#include "rust_types.h" + +namespace livekit { + class NativePeerConnectionObserver; + + class PeerConnection { + public: + explicit PeerConnection(rtc::scoped_refptr peer_connection, std::unique_ptr observer); + + void close(); + void create_offer(std::unique_ptr observer, RTCOfferAnswerOptions options); + void create_answer(std::unique_ptr observer, RTCOfferAnswerOptions options); + void set_local_description(std::unique_ptr desc, std::unique_ptr observer); + void set_remote_description(std::unique_ptr desc, std::unique_ptr observer); + + private: + rtc::scoped_refptr peer_connection_; + std::unique_ptr observer_; + }; + + static std::unique_ptr _unique_peer_connection() { + return nullptr; // Ignore + } + + class NativePeerConnectionObserver : public webrtc::PeerConnectionObserver { + public: + explicit NativePeerConnectionObserver(rust::Box observer); + + ~NativePeerConnectionObserver() override = default; + + void OnSignalingChange(webrtc::PeerConnectionInterface::SignalingState new_state) override; + void OnAddStream(rtc::scoped_refptr stream) override; + void OnRemoveStream(rtc::scoped_refptr stream) override; + void OnDataChannel(rtc::scoped_refptr data_channel) override; + void OnRenegotiationNeeded() override; + void OnNegotiationNeededEvent(uint32_t event_id) override; + void OnIceConnectionChange(webrtc::PeerConnectionInterface::IceConnectionState new_state) override; + void OnStandardizedIceConnectionChange(webrtc::PeerConnectionInterface::IceConnectionState new_state) override; + void OnConnectionChange(webrtc::PeerConnectionInterface::PeerConnectionState new_state) override; + void OnIceGatheringChange(webrtc::PeerConnectionInterface::IceGatheringState new_state) override; + void OnIceCandidate(const webrtc::IceCandidateInterface *candidate) override; + void OnIceCandidateError(const std::string &address, int port, const std::string &url, int error_code, const std::string &error_text) override; + void OnIceCandidatesRemoved(const std::vector &candidates) override; + void OnIceConnectionReceivingChange(bool receiving) override; + void OnIceSelectedCandidatePairChanged(const cricket::CandidatePairChangeEvent &event) override; + void OnAddTrack(rtc::scoped_refptr receiver, const std::vector> &streams) override; + void OnTrack(rtc::scoped_refptr transceiver) override; + void OnRemoveTrack(rtc::scoped_refptr receiver) override; + void OnInterestingUsage(int usage_pattern) override; + + private: + rust::Box observer_; + }; + + std::unique_ptr create_native_peer_connection_observer(rust::Box observer); +} // livekit + +#endif //CLIENT_SDK_NATIVE_PEER_CONNECTION_H + diff --git a/include/peer_connection_factory.h b/crates/livekit-webrtc/libwebrtc-sys/include/livekit/peer_connection_factory.h similarity index 51% rename from include/peer_connection_factory.h rename to crates/livekit-webrtc/libwebrtc-sys/include/livekit/peer_connection_factory.h index 914292f..3ffb146 100644 --- a/include/peer_connection_factory.h +++ b/crates/livekit-webrtc/libwebrtc-sys/include/livekit/peer_connection_factory.h @@ -7,24 +7,29 @@ #define PEER_CONNECTION_FACTORY_H #include "api/peer_connection_interface.h" +#include "peer_connection.h" +#include "rust_types.h" -namespace lk { +namespace livekit { + using NativeRTCConfiguration = webrtc::PeerConnectionInterface::RTCConfiguration; class PeerConnectionFactory { public: PeerConnectionFactory(); - private: - rtc::scoped_refptr peer_factory_; + std::unique_ptr create_peer_connection(std::unique_ptr config, std::unique_ptr observer) const; + private: std::unique_ptr network_thread_; std::unique_ptr worker_thread_; std::unique_ptr signaling_thread_; + + rtc::scoped_refptr peer_factory_; }; - std::unique_ptr CreatePeerConnectionFactory(); - -} + std::unique_ptr create_peer_connection_factory(); + std::unique_ptr create_rtc_configuration(RTCConfiguration conf); +} // livekit #endif //PEER_CONNECTION_FACTORY_H diff --git a/crates/livekit-webrtc/libwebrtc-sys/include/livekit/rtc_error.h b/crates/livekit-webrtc/libwebrtc-sys/include/livekit/rtc_error.h new file mode 100644 index 0000000..5984fc4 --- /dev/null +++ b/crates/livekit-webrtc/libwebrtc-sys/include/livekit/rtc_error.h @@ -0,0 +1,25 @@ +// +// Created by theom on 04/09/2022. +// + +#ifndef CLIENT_SDK_NATIVE_RTC_ERROR_H +#define CLIENT_SDK_NATIVE_RTC_ERROR_H + +#include "api/rtc_error.h" + +namespace livekit { + + class RTCError { + public: + explicit RTCError(webrtc::RTCError error); + + private: + webrtc::RTCError rtc_error_; + }; + + static std::unique_ptr _unique_rtc_error(){ + return nullptr; // Ignore + } +} // livekit + +#endif //CLIENT_SDK_NATIVE_RTC_ERROR_H diff --git a/crates/livekit-webrtc/libwebrtc-sys/include/livekit/rtp_receiver.h b/crates/livekit-webrtc/libwebrtc-sys/include/livekit/rtp_receiver.h new file mode 100644 index 0000000..03e8e31 --- /dev/null +++ b/crates/livekit-webrtc/libwebrtc-sys/include/livekit/rtp_receiver.h @@ -0,0 +1,26 @@ +// +// Created by Théo Monnom on 01/09/2022. +// + +#ifndef CLIENT_SDK_NATIVE_RTP_RECEIVER_H +#define CLIENT_SDK_NATIVE_RTP_RECEIVER_H + +#include +#include "api/rtp_receiver_interface.h" + +namespace livekit { + + class RtpReceiver { + public: + explicit RtpReceiver(rtc::scoped_refptr receiver); + + private: + rtc::scoped_refptr receiver_; + }; + + static std::unique_ptr _unique_rtp_receiver(){ + return nullptr; // Ignore + } +} // livekit + +#endif //CLIENT_SDK_NATIVE_RTP_RECEIVER_H diff --git a/crates/livekit-webrtc/libwebrtc-sys/include/livekit/rtp_transceiver.h b/crates/livekit-webrtc/libwebrtc-sys/include/livekit/rtp_transceiver.h new file mode 100644 index 0000000..f59872f --- /dev/null +++ b/crates/livekit-webrtc/libwebrtc-sys/include/livekit/rtp_transceiver.h @@ -0,0 +1,26 @@ +// +// Created by Théo Monnom on 02/09/2022. +// + +#ifndef CLIENT_SDK_NATIVE_RTP_TRANSCEIVER_H +#define CLIENT_SDK_NATIVE_RTP_TRANSCEIVER_H + +#include +#include "api/rtp_transceiver_interface.h" + +namespace livekit { + + class RtpTransceiver { + public: + explicit RtpTransceiver(rtc::scoped_refptr transceiver); + + private: + rtc::scoped_refptr transceiver_; + }; + + static std::unique_ptr _unique_rtp_transceiver(){ + return nullptr; // Ignore + } +} // livekit + +#endif //CLIENT_SDK_NATIVE_RTP_TRANSCEIVER_H diff --git a/crates/livekit-webrtc/libwebrtc-sys/include/livekit/rust_types.h b/crates/livekit-webrtc/libwebrtc-sys/include/livekit/rust_types.h new file mode 100644 index 0000000..88dc618 --- /dev/null +++ b/crates/livekit-webrtc/libwebrtc-sys/include/livekit/rust_types.h @@ -0,0 +1,22 @@ +// +// Created by Théo Monnom on 30/08/2022. +// + + +#ifndef RUST_TYPES_H +#define RUST_TYPES_H + +#include "api/peer_connection_interface.h" + +namespace livekit { + struct RTCConfiguration; + struct PeerConnectionObserverWrapper; + struct CreateSdpObserverWrapper; + struct SetLocalSdpObserverWrapper; + struct SetRemoteSdpObserverWrapper; + + // Shared types + struct RTCOfferAnswerOptions; +} + +#endif //RUST_TYPES_H diff --git a/crates/livekit-webrtc/libwebrtc-sys/src/candidate.cpp b/crates/livekit-webrtc/libwebrtc-sys/src/candidate.cpp new file mode 100644 index 0000000..e06e303 --- /dev/null +++ b/crates/livekit-webrtc/libwebrtc-sys/src/candidate.cpp @@ -0,0 +1,11 @@ +// +// Created by Théo Monnom on 01/09/2022. +// + +#include "livekit/candidate.h" + +namespace livekit { + Candidate::Candidate(const cricket::Candidate &candidate) : candidate_(candidate) { + + } +} // livekit \ No newline at end of file diff --git a/crates/livekit-webrtc/libwebrtc-sys/src/candidate.rs b/crates/livekit-webrtc/libwebrtc-sys/src/candidate.rs new file mode 100644 index 0000000..daa49c5 --- /dev/null +++ b/crates/livekit-webrtc/libwebrtc-sys/src/candidate.rs @@ -0,0 +1,12 @@ +use cxx::UniquePtr; + +#[cxx::bridge(namespace = "livekit")] +pub mod ffi { + unsafe extern "C++" { + include!("livekit/candidate.h"); + + type Candidate; // cricket::Candidate + + fn _unique_candidate() -> UniquePtr; // Ignore + } +} diff --git a/crates/livekit-webrtc/libwebrtc-sys/src/data_channel.cpp b/crates/livekit-webrtc/libwebrtc-sys/src/data_channel.cpp new file mode 100644 index 0000000..ba6ffb8 --- /dev/null +++ b/crates/livekit-webrtc/libwebrtc-sys/src/data_channel.cpp @@ -0,0 +1,12 @@ +// +// Created by Théo Monnom on 01/09/2022. +// + +#include "livekit/data_channel.h" + +namespace livekit { + + DataChannel::DataChannel(rtc::scoped_refptr data_channel) : data_channel_(data_channel) { + + } +} // livekit \ No newline at end of file diff --git a/crates/livekit-webrtc/libwebrtc-sys/src/data_channel.rs b/crates/livekit-webrtc/libwebrtc-sys/src/data_channel.rs new file mode 100644 index 0000000..a349944 --- /dev/null +++ b/crates/livekit-webrtc/libwebrtc-sys/src/data_channel.rs @@ -0,0 +1,12 @@ +use cxx::UniquePtr; + +#[cxx::bridge(namespace = "livekit")] +pub mod ffi { + unsafe extern "C++" { + include!("livekit/data_channel.h"); + + type DataChannel; + + fn _unique_data_channel() -> UniquePtr; // Ignore + } +} diff --git a/crates/livekit-webrtc/libwebrtc-sys/src/jsep.cpp b/crates/livekit-webrtc/libwebrtc-sys/src/jsep.cpp new file mode 100644 index 0000000..40a4dd9 --- /dev/null +++ b/crates/livekit-webrtc/libwebrtc-sys/src/jsep.cpp @@ -0,0 +1,83 @@ +// +// Created by Théo Monnom on 01/09/2022. +// + +#include + +#include "livekit/jsep.h" +#include "libwebrtc-sys/src/jsep.rs.h" +#include "api/make_ref_counted.h" + +namespace livekit { + + IceCandidate::IceCandidate(std::unique_ptr ice_candidate) : ice_candidate_(std::move(ice_candidate)){ + + } + + SessionDescription::SessionDescription(std::unique_ptr session_description) : session_description_(std::move(session_description)){ + + } + + std::unique_ptr SessionDescription::clone() const { + return std::make_unique(session_description_->Clone()); + } + + std::unique_ptr SessionDescription::release() { + return std::move(session_description_); + } + + // CreateSdpObserver + + NativeCreateSdpObserver::NativeCreateSdpObserver( + rust::Box observer) : observer_(std::move(observer)) { + + } + + void NativeCreateSdpObserver::OnSuccess(webrtc::SessionDescriptionInterface *desc) { + // We have ownership of desc + observer_->on_success(std::make_unique(std::unique_ptr(desc))); + } + + void NativeCreateSdpObserver::OnFailure(webrtc::RTCError error) { + observer_->on_failure(std::make_unique(error)); + } + + std::unique_ptr create_native_create_sdp_observer(rust::Box observer){ + return std::make_unique(NativeCreateSdpObserverHandle { + rtc::make_ref_counted(std::move(observer)) + }); + } + + // SetLocalSdpObserver + + NativeSetLocalSdpObserver::NativeSetLocalSdpObserver(rust::Box observer) : observer_(std::move(observer)) { + + } + + void NativeSetLocalSdpObserver::OnSetLocalDescriptionComplete(webrtc::RTCError error) { + observer_->on_set_local_description_complete(std::make_unique(error)); + } + + std::unique_ptr create_native_set_local_sdp_observer(rust::Box observer){ + return std::make_unique(NativeSetLocalSdpObserverHandle { + rtc::make_ref_counted(std::move(observer)) + }); + } + + // SetRemoteSdpObserver + + NativeSetRemoteSdpObserver::NativeSetRemoteSdpObserver(rust::Box observer) : observer_(std::move(observer)) { + + } + + void NativeSetRemoteSdpObserver::OnSetRemoteDescriptionComplete(webrtc::RTCError error) { + observer_->on_set_remote_description_complete(std::make_unique(error)); + } + + std::unique_ptr create_native_set_remote_sdp_observer(rust::Box observer){ + return std::make_unique(NativeSetRemoteSdpObserverHandle { + rtc::make_ref_counted(std::move(observer)) + }); + } + +} // livekit \ No newline at end of file diff --git a/crates/livekit-webrtc/libwebrtc-sys/src/jsep.rs b/crates/livekit-webrtc/libwebrtc-sys/src/jsep.rs new file mode 100644 index 0000000..4eae1a4 --- /dev/null +++ b/crates/livekit-webrtc/libwebrtc-sys/src/jsep.rs @@ -0,0 +1,109 @@ +use cxx::UniquePtr; +use cxx::{type_id, ExternType}; + +use crate::rtc_error::ffi::RTCError; + +#[cxx::bridge(namespace = "livekit")] +pub mod ffi { + extern "Rust" { + type CreateSdpObserverWrapper; + fn on_success(self: &CreateSdpObserverWrapper, session_description: UniquePtr); + fn on_failure(self: &CreateSdpObserverWrapper, error: UniquePtr); + + type SetLocalSdpObserverWrapper; + fn on_set_local_description_complete(self: &SetLocalSdpObserverWrapper, error: UniquePtr); + + type SetRemoteSdpObserverWrapper; + fn on_set_remote_description_complete(self: &SetRemoteSdpObserverWrapper, error: UniquePtr); + } + + unsafe extern "C++" { + include!("livekit/jsep.h"); + include!("livekit/rtc_error.h"); + + type RTCError = crate::rtc_error::ffi::RTCError; + type IceCandidate; + type SessionDescription; + type NativeCreateSdpObserverHandle; + type NativeSetLocalSdpObserverHandle; + type NativeSetRemoteSdpObserverHandle; + + fn create_native_create_sdp_observer(observer: Box) -> UniquePtr; + fn create_native_set_local_sdp_observer(observer: Box) -> UniquePtr; + fn create_native_set_remote_sdp_observer(observer: Box) -> UniquePtr; + + fn _unique_ice_candidate() -> UniquePtr; // Ignore + fn _unique_session_description() -> UniquePtr; // Ignore + } +} + +// CreateSdpObserver + +pub trait CreateSdpObserver: Send + Sync { + fn on_success(&self, session_description: UniquePtr); + fn on_failure(&self, error: UniquePtr); +} + +pub struct CreateSdpObserverWrapper { + observer: Box, +} + +impl CreateSdpObserverWrapper { + pub fn new(observer: Box) -> Self { + Self { + observer + } + } + + fn on_success(&self, session_description: UniquePtr) { + self.observer.on_success(session_description); + } + + fn on_failure(&self, error: UniquePtr) { + self.observer.on_failure(error); + } +} + +// SetLocalSdpObserver + +pub trait SetLocalSdpObserver: Send + Sync { + fn on_set_local_description_complete(&self, error: UniquePtr); +} + +pub struct SetLocalSdpObserverWrapper { + observer: Box, +} + +impl SetLocalSdpObserverWrapper { + pub fn new(observer: Box) -> Self { + Self { + observer + } + } + + fn on_set_local_description_complete(&self, error: UniquePtr) { + self.observer.on_set_local_description_complete(error); + } +} + +// SetRemoteSdpObserver + +pub trait SetRemoteSdpObserver: Send + Sync { + fn on_set_remote_description_complete(&self, error: UniquePtr); +} + +pub struct SetRemoteSdpObserverWrapper { + observer: Box, +} + +impl SetRemoteSdpObserverWrapper { + pub fn new(observer: Box) -> Self { + Self { + observer + } + } + + fn on_set_remote_description_complete(&self, error: UniquePtr) { + self.observer.on_set_remote_description_complete(error); + } +} diff --git a/crates/livekit-webrtc/libwebrtc-sys/src/lib.rs b/crates/livekit-webrtc/libwebrtc-sys/src/lib.rs new file mode 100644 index 0000000..19ff3ad --- /dev/null +++ b/crates/livekit-webrtc/libwebrtc-sys/src/lib.rs @@ -0,0 +1,10 @@ +pub mod media_stream_interface; +pub mod peer_connection; +pub mod peer_connection_factory; +pub mod data_channel; +pub mod jsep; +pub mod candidate; +pub mod rtp_receiver; +pub mod rtp_transceiver; +pub mod rtc_error; + diff --git a/crates/livekit-webrtc/libwebrtc-sys/src/media_stream_interface.cpp b/crates/livekit-webrtc/libwebrtc-sys/src/media_stream_interface.cpp new file mode 100644 index 0000000..94487ea --- /dev/null +++ b/crates/livekit-webrtc/libwebrtc-sys/src/media_stream_interface.cpp @@ -0,0 +1,12 @@ +// +// Created by Théo Monnom on 31/08/2022. +// + +#include "livekit/media_stream_interface.h" + +namespace livekit { + + MediaStreamInterface::MediaStreamInterface(rtc::scoped_refptr stream) : media_stream_(stream) { + + } +} // livekit \ No newline at end of file diff --git a/crates/livekit-webrtc/libwebrtc-sys/src/media_stream_interface.rs b/crates/livekit-webrtc/libwebrtc-sys/src/media_stream_interface.rs new file mode 100644 index 0000000..7242ba7 --- /dev/null +++ b/crates/livekit-webrtc/libwebrtc-sys/src/media_stream_interface.rs @@ -0,0 +1,13 @@ +use cxx::UniquePtr; + +#[cxx::bridge(namespace = "livekit")] +pub mod ffi { + unsafe extern "C++" { + include!("livekit/media_stream_interface.h"); + + type MediaStreamInterface; + + fn _unique_media_stream() -> UniquePtr; // Ignore + } + +} diff --git a/crates/livekit-webrtc/libwebrtc-sys/src/peer_connection.cpp b/crates/livekit-webrtc/libwebrtc-sys/src/peer_connection.cpp new file mode 100644 index 0000000..b762444 --- /dev/null +++ b/crates/livekit-webrtc/libwebrtc-sys/src/peer_connection.cpp @@ -0,0 +1,166 @@ +// +// Created by Théo Monnom on 30/08/2022. +// + +#include "livekit/peer_connection.h" +#include "libwebrtc-sys/src/peer_connection.rs.h" + +namespace livekit { + + inline webrtc::PeerConnectionInterface::RTCOfferAnswerOptions toNativeOfferAnswerOptions(const RTCOfferAnswerOptions& options) { + webrtc::PeerConnectionInterface::RTCOfferAnswerOptions rtc_options; + rtc_options.offer_to_receive_video = options.offer_to_receive_video; + rtc_options.offer_to_receive_audio = options.offer_to_receive_audio; + rtc_options.voice_activity_detection = options.voice_activity_detection; + rtc_options.ice_restart = options.ice_restart; + rtc_options.use_rtp_mux = options.use_rtp_mux; + rtc_options.raw_packetization_for_video = options.raw_packetization_for_video; + rtc_options.num_simulcast_layers = options.num_simulcast_layers; + rtc_options.use_obsolete_sctp_sdp = options.use_obsolete_sctp_sdp; + return rtc_options; + } + + PeerConnection::PeerConnection(rtc::scoped_refptr peer_connection, + std::unique_ptr observer) : peer_connection_( + std::move(peer_connection)), observer_(std::move(observer)) { + + } + + void PeerConnection::close() { + peer_connection_->Close(); + } + + void PeerConnection::create_offer(std::unique_ptr observer_handle, RTCOfferAnswerOptions options) { + peer_connection_->CreateOffer(observer_handle->observer.get(), toNativeOfferAnswerOptions(options)); + } + + void PeerConnection::create_answer(std::unique_ptr observer_handle, RTCOfferAnswerOptions options) { + peer_connection_->CreateAnswer(observer_handle->observer.get(), toNativeOfferAnswerOptions(options)); + } + + void PeerConnection::set_local_description(std::unique_ptr desc, std::unique_ptr observer) { + peer_connection_->SetLocalDescription(desc->clone()->release(), observer->observer); + } + + void PeerConnection::set_remote_description(std::unique_ptr desc, std::unique_ptr observer) { + peer_connection_->SetRemoteDescription(desc->clone()->release(), observer->observer); + } + + /* Observer */ + + NativePeerConnectionObserver::NativePeerConnectionObserver(rust::Box observer) : observer_(std::move(observer)) { + + } + + void NativePeerConnectionObserver::OnSignalingChange(webrtc::PeerConnectionInterface::SignalingState new_state) { + observer_->on_signaling_change(static_cast(new_state)); + } + + void NativePeerConnectionObserver::OnAddStream(rtc::scoped_refptr stream) { + observer_->on_add_stream(std::make_unique(stream)); + } + + void NativePeerConnectionObserver::OnRemoveStream(rtc::scoped_refptr stream) { + observer_->on_remove_stream(std::make_unique(stream)); + } + + void NativePeerConnectionObserver::OnDataChannel(rtc::scoped_refptr data_channel) { + observer_->on_data_channel(std::make_unique(data_channel)); + } + + void NativePeerConnectionObserver::OnRenegotiationNeeded() { + observer_->on_renegotiation_needed(); + } + + void NativePeerConnectionObserver::OnNegotiationNeededEvent(uint32_t event_id) { + observer_->on_negotiation_needed_event(event_id); + } + + void + NativePeerConnectionObserver::OnIceConnectionChange(webrtc::PeerConnectionInterface::IceConnectionState new_state) { + observer_->on_ice_connection_change(static_cast(new_state)); + } + + void NativePeerConnectionObserver::OnStandardizedIceConnectionChange( + webrtc::PeerConnectionInterface::IceConnectionState new_state) { + observer_->on_standardized_ice_connection_change(static_cast(new_state)); + } + + void + NativePeerConnectionObserver::OnConnectionChange(webrtc::PeerConnectionInterface::PeerConnectionState new_state) { + observer_->on_connection_change(static_cast(new_state)); + } + + void + NativePeerConnectionObserver::OnIceGatheringChange(webrtc::PeerConnectionInterface::IceGatheringState new_state) { + observer_->on_ice_gathering_change(static_cast(new_state)); + } + + void NativePeerConnectionObserver::OnIceCandidate(const webrtc::IceCandidateInterface *candidate) { + auto new_candidate = webrtc::CreateIceCandidate(candidate->sdp_mid(), candidate->sdp_mline_index(), + candidate->candidate()); + observer_->on_ice_candidate(std::make_unique(std::move(new_candidate))); + } + + void NativePeerConnectionObserver::OnIceCandidateError(const std::string &address, int port, const std::string &url, + int error_code, const std::string &error_text) { + observer_->on_ice_candidate_error(address, port, url, error_code, error_text); + } + + void NativePeerConnectionObserver::OnIceCandidatesRemoved(const std::vector &candidates) { + rust::Vec vec; + + for (const auto &item: candidates) { + vec.push_back(CandidatePtr{ + std::make_unique(item) + }); + } + + observer_->on_ice_candidates_removed(std::move(vec)); + } + + void NativePeerConnectionObserver::OnIceConnectionReceivingChange(bool receiving) { + observer_->on_ice_connection_receiving_change(receiving); + } + + void + NativePeerConnectionObserver::OnIceSelectedCandidatePairChanged(const cricket::CandidatePairChangeEvent &event) { + CandidatePairChangeEvent e; + e.selected_candidate_pair.local = std::make_unique(event.selected_candidate_pair.local); + e.selected_candidate_pair.remote = std::make_unique(event.selected_candidate_pair.remote); + e.last_data_received_ms = event.last_data_received_ms; + e.reason = event.reason; + e.estimated_disconnected_time_ms = event.estimated_disconnected_time_ms; + + observer_->on_ice_selected_candidate_pair_changed(std::move(e)); + } + + void NativePeerConnectionObserver::OnAddTrack(rtc::scoped_refptr receiver, + const std::vector> &streams) { + rust::Vec vec; + + for (const auto &item: streams) { + vec.push_back(MediaStreamPtr{ + std::make_unique(item) + }); + } + + observer_->on_add_track(std::make_unique(receiver), std::move(vec)); + } + + void NativePeerConnectionObserver::OnTrack(rtc::scoped_refptr transceiver) { + observer_->on_track(std::make_unique(transceiver)); + } + + void NativePeerConnectionObserver::OnRemoveTrack(rtc::scoped_refptr receiver) { + observer_->on_remove_track(std::make_unique(receiver)); + } + + void NativePeerConnectionObserver::OnInterestingUsage(int usage_pattern) { + observer_->on_interesting_usage(usage_pattern); + } + + std::unique_ptr create_native_peer_connection_observer(rust::Box observer) { + return std::make_unique(std::move(observer)); + } +} // livekit \ No newline at end of file diff --git a/crates/livekit-webrtc/libwebrtc-sys/src/peer_connection.rs b/crates/livekit-webrtc/libwebrtc-sys/src/peer_connection.rs new file mode 100644 index 0000000..01a9272 --- /dev/null +++ b/crates/livekit-webrtc/libwebrtc-sys/src/peer_connection.rs @@ -0,0 +1,293 @@ +use cxx::UniquePtr; +use crate::candidate::ffi::Candidate; +use crate::data_channel::ffi::DataChannel; +use crate::jsep::ffi::IceCandidate; +use crate::media_stream_interface::ffi::MediaStreamInterface; +use crate::rtp_receiver::ffi::RtpReceiver; +use crate::rtp_transceiver::ffi::RtpTransceiver; + +#[cxx::bridge(namespace = "livekit")] +pub mod ffi { + + struct CandidatePair { + local: UniquePtr, + remote: UniquePtr, + } + + struct CandidatePairChangeEvent { + selected_candidate_pair: CandidatePair, + last_data_received_ms: i64, + reason: String, + estimated_disconnected_time_ms: i64, + } + + #[derive(Debug)] + #[repr(u32)] + pub enum PeerConnectionState { + kNew, + kConnecting, + kConnected, + kDisconnected, + kFailed, + kClosed, + } + + #[derive(Debug)] + #[repr(u32)] + pub enum SignalingState { + kStable, + kHaveLocalOffer, + kHaveLocalPrAnswer, + kHaveRemoteOffer, + kHaveRemotePrAnswer, + kClosed, + } + + #[derive(Debug)] + #[repr(u32)] + pub enum IceConnectionState { + kIceConnectionNew, + kIceConnectionChecking, + kIceConnectionConnected, + kIceConnectionCompleted, + kIceConnectionFailed, + kIceConnectionDisconnected, + kIceConnectionClosed, + kIceConnectionMax, + } + + #[derive(Debug)] + #[repr(u32)] + pub enum IceGatheringState { + kIceGatheringNew, + kIceGatheringGathering, + kIceGatheringComplete + } + + #[derive(Debug)] + pub struct RTCOfferAnswerOptions { + offer_to_receive_video: i32, + offer_to_receive_audio: i32, + voice_activity_detection: bool, + ice_restart: bool, + use_rtp_mux: bool, + raw_packetization_for_video: bool, + num_simulcast_layers: i32, + use_obsolete_sctp_sdp: bool, + } + + // Wrapper to opaque C++ objects + // https://github.com/dtolnay/cxx/issues/741 + struct MediaStreamPtr { + pub ptr: UniquePtr + } + + struct CandidatePtr { + pub ptr: UniquePtr + } + + unsafe extern "C++" { + include!("livekit/peer_connection.h"); + include!("livekit/jsep.h"); + include!("livekit/data_channel.h"); + include!("livekit/rtp_receiver.h"); + include!("livekit/rtp_transceiver.h"); + include!("livekit/media_stream_interface.h"); + include!("livekit/candidate.h"); + + type Candidate = crate::candidate::ffi::Candidate; + type IceCandidate = crate::jsep::ffi::IceCandidate; + type DataChannel = crate::data_channel::ffi::DataChannel; + type RtpReceiver = crate::rtp_receiver::ffi::RtpReceiver; + type RtpTransceiver = crate::rtp_transceiver::ffi::RtpTransceiver; + type MediaStreamInterface = crate::media_stream_interface::ffi::MediaStreamInterface; + type NativeCreateSdpObserverHandle = crate::jsep::ffi::NativeCreateSdpObserverHandle; + type NativeSetLocalSdpObserverHandle = crate::jsep::ffi::NativeSetLocalSdpObserverHandle; + type NativeSetRemoteSdpObserverHandle = crate::jsep::ffi::NativeSetRemoteSdpObserverHandle; + type SessionDescription = crate::jsep::ffi::SessionDescription; + + type NativePeerConnectionObserver; + type PeerConnection; + + fn create_offer(self: Pin<&mut PeerConnection>, observer: UniquePtr, options: RTCOfferAnswerOptions); + fn create_answer(self: Pin<&mut PeerConnection>, observer: UniquePtr, options: RTCOfferAnswerOptions); + fn set_local_description(self: Pin<&mut PeerConnection>, desc: UniquePtr, observer: UniquePtr); + fn set_remote_description(self: Pin<&mut PeerConnection>, desc: UniquePtr, observer: UniquePtr); + fn close(self: Pin<&mut PeerConnection>); + + fn create_native_peer_connection_observer(observer: Box) -> UniquePtr; + + fn _unique_peer_connection() -> UniquePtr; // Ignore + } + + extern "Rust" { + type PeerConnectionObserverWrapper; + + fn on_signaling_change(self: &mut PeerConnectionObserverWrapper, new_state: SignalingState); + fn on_add_stream(self: &mut PeerConnectionObserverWrapper, stream: UniquePtr); + fn on_remove_stream(self: &mut PeerConnectionObserverWrapper, stream: UniquePtr); + fn on_data_channel(self: &mut PeerConnectionObserverWrapper, data_channel: UniquePtr); + fn on_renegotiation_needed(self: &mut PeerConnectionObserverWrapper); + fn on_negotiation_needed_event(self: &mut PeerConnectionObserverWrapper, event: u32); + fn on_ice_connection_change(self: &mut PeerConnectionObserverWrapper, new_state: IceConnectionState); + fn on_standardized_ice_connection_change(self: &mut PeerConnectionObserverWrapper, new_state: IceConnectionState); + fn on_connection_change(self: &mut PeerConnectionObserverWrapper, new_state: PeerConnectionState); + fn on_ice_gathering_change(self: &mut PeerConnectionObserverWrapper, new_state: IceGatheringState); + fn on_ice_candidate(self: &mut PeerConnectionObserverWrapper, candidate: UniquePtr); + fn on_ice_candidate_error(self: &mut PeerConnectionObserverWrapper, address: String, port: i32, url: String, error_code: i32, error_text: String); + fn on_ice_candidates_removed(self: &mut PeerConnectionObserverWrapper, removed: Vec); + fn on_ice_connection_receiving_change(self: &mut PeerConnectionObserverWrapper, receiving: bool); + fn on_ice_selected_candidate_pair_changed(self: &mut PeerConnectionObserverWrapper, event: CandidatePairChangeEvent); + fn on_add_track(self: &mut PeerConnectionObserverWrapper, receiver: UniquePtr, streams: Vec); + fn on_track(self: &mut PeerConnectionObserverWrapper, transceiver: UniquePtr); + fn on_remove_track(self: &mut PeerConnectionObserverWrapper, receiver: UniquePtr); + fn on_interesting_usage(self: &mut PeerConnectionObserverWrapper, usage_pattern: i32); + } +} + +// https://webrtc.github.io/webrtc-org/native-code/native-apis/ +unsafe impl Sync for ffi::PeerConnection {} +unsafe impl Send for ffi::PeerConnection {} + +impl Default for ffi::RTCOfferAnswerOptions { + /* + static const int kUndefined = -1; + static const int kMaxOfferToReceiveMedia = 1; + static const int kOfferToReceiveMediaTrue = 1; + */ + + fn default() -> Self { + Self { + offer_to_receive_video: -1, + offer_to_receive_audio: -1, + voice_activity_detection: true, + ice_restart: false, + use_rtp_mux: true, + raw_packetization_for_video: false, + num_simulcast_layers: 1, + use_obsolete_sctp_sdp: false + } + } +} + +pub trait PeerConnectionObserver: Send + Sync { + fn on_signaling_change(&mut self, new_state: ffi::SignalingState); + fn on_add_stream(&mut self, stream: UniquePtr); + fn on_remove_stream(&mut self, stream: UniquePtr); + fn on_data_channel(&mut self, data_channel: UniquePtr); + fn on_renegotiation_needed(&mut self); + fn on_negotiation_needed_event(&mut self, event: u32); + fn on_ice_connection_change(&mut self, new_state: ffi::IceConnectionState); + fn on_standardized_ice_connection_change(&mut self, new_state: ffi::IceConnectionState); + fn on_connection_change(&mut self, new_state: ffi::PeerConnectionState); + fn on_ice_gathering_change(&mut self, new_state: ffi::IceGatheringState); + fn on_ice_candidate(&mut self, candidate: UniquePtr); + fn on_ice_candidate_error(&mut self, address: String, port: i32, url: String, error_code: i32, error_text: String); + fn on_ice_candidates_removed(&mut self, removed: Vec>); + fn on_ice_connection_receiving_change(&mut self, receiving: bool); + fn on_ice_selected_candidate_pair_changed(&mut self, event: ffi::CandidatePairChangeEvent); + fn on_add_track(&mut self, receiver: UniquePtr, streams: Vec>); + fn on_track(&mut self, transceiver: UniquePtr); + fn on_remove_track(&mut self, receiver: UniquePtr); + fn on_interesting_usage(&mut self, usage_pattern: i32); +} + +pub struct PeerConnectionObserverWrapper { + observer: Box, +} + +impl PeerConnectionObserverWrapper { + pub fn new(observer: Box) -> Self { + Self { + observer + } + } + + fn on_signaling_change(&mut self, new_state: ffi::SignalingState) { + self.observer.on_signaling_change(new_state); + } + + fn on_add_stream(&mut self, stream: UniquePtr) { + self.observer.on_add_stream(stream); + } + + fn on_remove_stream(&mut self, stream: UniquePtr) { + self.observer.on_remove_stream(stream); + } + + fn on_data_channel(&mut self, data_channel: UniquePtr) { + self.observer.on_data_channel(data_channel); + } + + fn on_renegotiation_needed(&mut self) { + self.observer.on_renegotiation_needed(); + } + + fn on_negotiation_needed_event(&mut self, event: u32) { + self.observer.on_negotiation_needed_event(event); + } + + fn on_ice_connection_change(&mut self, new_state: ffi::IceConnectionState) { + self.observer.on_ice_connection_change(new_state); + } + + fn on_standardized_ice_connection_change(&mut self, new_state: ffi::IceConnectionState) { + self.observer.on_standardized_ice_connection_change(new_state); + } + + fn on_connection_change(&mut self, new_state: ffi::PeerConnectionState) { + self.observer.on_connection_change(new_state); + } + + fn on_ice_gathering_change(&mut self, new_state: ffi::IceGatheringState) { + self.observer.on_ice_gathering_change(new_state); + } + + fn on_ice_candidate(&mut self, candidate: UniquePtr) { + self.observer.on_ice_candidate(candidate); + } + + fn on_ice_candidate_error(&mut self, address: String, port: i32, url: String, error_code: i32, error_text: String) { + self.observer.on_ice_candidate_error(address, port, url, error_code, error_text); + } + + fn on_ice_candidates_removed(&mut self, removed: Vec) { + let mut vec = Vec::new(); + + for v in removed { + vec.push(v.ptr); + } + + self.observer.on_ice_candidates_removed(vec); + } + + fn on_ice_connection_receiving_change(&mut self, receiving: bool) { + self.observer.on_ice_connection_receiving_change(receiving); + } + + fn on_ice_selected_candidate_pair_changed(&mut self, event: ffi::CandidatePairChangeEvent) { + self.observer.on_ice_selected_candidate_pair_changed(event); + } + + fn on_add_track(&mut self, receiver: UniquePtr, streams: Vec) { + let mut vec = Vec::new(); + + for v in streams { + vec.push(v.ptr); + } + + self.observer.on_add_track(receiver, vec); + } + + fn on_track(&mut self, transceiver: UniquePtr) { + self.observer.on_track(transceiver); + } + + fn on_remove_track(&mut self, receiver: UniquePtr) { + self.observer.on_remove_track(receiver); + } + + fn on_interesting_usage(&mut self, usage_pattern: i32) { + self.observer.on_interesting_usage(usage_pattern); + } +} diff --git a/crates/livekit-webrtc/libwebrtc-sys/src/peer_connection_factory.cpp b/crates/livekit-webrtc/libwebrtc-sys/src/peer_connection_factory.cpp new file mode 100644 index 0000000..1a3db8e --- /dev/null +++ b/crates/livekit-webrtc/libwebrtc-sys/src/peer_connection_factory.cpp @@ -0,0 +1,87 @@ +// +// Created by Théo Monnom on 03/08/2022. +// + +#include "livekit/peer_connection_factory.h" +#include "api/video_codecs/builtin_video_decoder_factory.h" +#include "api/audio_codecs/builtin_audio_decoder_factory.h" +#include "api/audio_codecs/builtin_audio_encoder_factory.h" +#include "api/video_codecs/builtin_video_encoder_factory.h" +#include "media/engine/webrtc_media_engine.h" +#include "api/task_queue/default_task_queue_factory.h" +#include "api/rtc_event_log/rtc_event_log_factory.h" +#include "libwebrtc-sys/src/peer_connection_factory.rs.h" + +namespace livekit{ + + PeerConnectionFactory::PeerConnectionFactory(){ + rtc::LogMessage::LogToDebug(rtc::LS_INFO); + RTC_LOG(LS_INFO) << "PeerConnectionFactory::PeerConnectionFactory()"; + + network_thread_ = rtc::Thread::CreateWithSocketServer(); + network_thread_->SetName("network_thread", &network_thread_); + network_thread_->Start(); + worker_thread_ = rtc::Thread::Create(); + worker_thread_->SetName("worker_thread", &worker_thread_); + worker_thread_->Start(); + signaling_thread_ = rtc::Thread::Create(); + signaling_thread_->SetName("signaling_thread", &signaling_thread_); + signaling_thread_->Start(); + + webrtc::PeerConnectionFactoryDependencies dependencies; + dependencies.network_thread = network_thread_.get(); + dependencies.worker_thread = worker_thread_.get(); + dependencies.signaling_thread = signaling_thread_.get(); + dependencies.task_queue_factory = webrtc::CreateDefaultTaskQueueFactory(); + dependencies.event_log_factory = std::make_unique(dependencies.task_queue_factory.get()); + + cricket::MediaEngineDependencies media_deps; + media_deps.task_queue_factory = dependencies.task_queue_factory.get(); + media_deps.video_encoder_factory = webrtc::CreateBuiltinVideoEncoderFactory(); + media_deps.video_decoder_factory = webrtc::CreateBuiltinVideoDecoderFactory(); + media_deps.audio_encoder_factory = webrtc::CreateBuiltinAudioEncoderFactory(); + media_deps.audio_decoder_factory = webrtc::CreateBuiltinAudioDecoderFactory(); + + dependencies.media_engine = cricket::CreateMediaEngine(std::move(media_deps)); + + peer_factory_ = webrtc::CreateModularPeerConnectionFactory(std::move(dependencies)); + + if (peer_factory_.get() == nullptr) { + RTC_LOG_ERR(LS_ERROR) << "Failed to create PeerConnectionFactory"; + return; + } + } + + std::unique_ptr PeerConnectionFactory::create_peer_connection(std::unique_ptr config, std::unique_ptr observer) const { + webrtc::PeerConnectionDependencies deps{observer.get()}; + auto result = peer_factory_->CreatePeerConnectionOrError(*config, std::move(deps)); + + if(!result.ok()){ + throw std::runtime_error(result.error().message()); // TODO(theomonnom) Bridge RTCError - Mb use ProtoBuf + } + + return std::make_unique(std::move(result.value()), std::move(observer)); + } + + std::unique_ptr create_peer_connection_factory() { + return std::make_unique(); + } + + std::unique_ptr create_rtc_configuration(RTCConfiguration conf){ + auto rtc = std::make_unique(); + + for (auto &item: conf.ice_servers){ + webrtc::PeerConnectionInterface::IceServer ice_server; + ice_server.username = item.username.c_str(); + ice_server.password = item.password.c_str(); + + for (auto &url: item.urls){ + ice_server.urls.push_back(url.c_str()); + } + + rtc->servers.push_back(ice_server); + } + + return rtc; + } +} // namespace lk \ No newline at end of file diff --git a/crates/livekit-webrtc/libwebrtc-sys/src/peer_connection_factory.rs b/crates/livekit-webrtc/libwebrtc-sys/src/peer_connection_factory.rs new file mode 100644 index 0000000..72721b1 --- /dev/null +++ b/crates/livekit-webrtc/libwebrtc-sys/src/peer_connection_factory.rs @@ -0,0 +1,186 @@ +use std::any::Any; +use std::thread::sleep; +use std::time::Duration; +use cxx::UniquePtr; +use log::info; +use crate::candidate::ffi::Candidate; +use crate::data_channel::ffi::DataChannel; +use crate::jsep::ffi::IceCandidate; +use crate::media_stream_interface::ffi::MediaStreamInterface; +use crate::{jsep, peer_connection}; +use crate::jsep::CreateSdpObserver; +use crate::peer_connection::ffi::{CandidatePairChangeEvent, IceConnectionState, IceGatheringState, PeerConnectionState, SignalingState}; +use crate::peer_connection::PeerConnectionObserver; +use crate::rtp_receiver::ffi::RtpReceiver; +use crate::rtp_transceiver::ffi::RtpTransceiver; + +#[cxx::bridge(namespace = "livekit")] +pub mod ffi { + + #[derive(Debug, Clone)] + pub struct ICEServer { + urls: Vec, + username: String, + password: String, + } + + #[derive(Debug)] + pub struct RTCConfiguration { + pub ice_servers: Vec, + } + + unsafe extern "C++" { + include!("livekit/peer_connection_factory.h"); + + type PeerConnection = crate::peer_connection::ffi::PeerConnection; + type NativePeerConnectionObserver = crate::peer_connection::ffi::NativePeerConnectionObserver; + type PeerConnectionFactory; + type NativeRTCConfiguration; + + fn create_peer_connection_factory() -> UniquePtr; + fn create_rtc_configuration(conf: RTCConfiguration) -> UniquePtr; + + unsafe fn create_peer_connection(self: &PeerConnectionFactory, config: UniquePtr, observer: UniquePtr) -> Result>; + } +} + + + + + + + + + + + + + + +#[cfg(test)] +mod test { + + struct TestObserver { + + } + + impl PeerConnectionObserver for TestObserver { + fn on_signaling_change(&self, new_state: SignalingState) { + log::debug!("Signaling state changed: {:?}", new_state); + } + + fn on_add_stream(&self, stream: UniquePtr) { + todo!() + } + + fn on_remove_stream(&self, stream: UniquePtr) { + todo!() + } + + fn on_data_channel(&self, data_channel: UniquePtr) { + todo!() + } + + fn on_renegotiation_needed(&self) { + todo!() + } + + fn on_negotiation_needed_event(&self, event: u32) { + todo!() + } + + fn on_ice_connection_change(&self, new_state: IceConnectionState) { + log::debug!("ICE connection state changed: {:?}", new_state); + } + + fn on_standardized_ice_connection_change(&self, new_state: IceConnectionState) { + todo!() + } + + fn on_connection_change(&self, new_state: PeerConnectionState) { + log::debug!("PeerConnection state changed: {:?}", new_state); + } + + fn on_ice_gathering_change(&self, new_state: IceGatheringState) { + todo!() + } + + fn on_ice_candidate(&self, candidate: UniquePtr) { + todo!() + } + + fn on_ice_candidate_error(&self, address: String, port: i32, url: String, error_code: i32, error_text: String) { + todo!() + } + + fn on_ice_candidates_removed(&self, removed: Vec>) { + todo!() + } + + fn on_ice_connection_receiving_change(&self, receiving: bool) { + todo!() + } + + fn on_ice_selected_candidate_pair_changed(&self, event: CandidatePairChangeEvent) { + todo!() + } + + fn on_add_track(&self, receiver: UniquePtr, streams: Vec>) { + todo!() + } + + fn on_track(&self, transceiver: UniquePtr) { + todo!() + } + + fn on_remove_track(&self, receiver: UniquePtr) { + todo!() + } + + fn on_interesting_usage(&self, usage_pattern: i32) { + todo!() + } + } + + struct SessionObserver { + + } + + impl CreateSdpObserver for SessionObserver { + fn on_success(&self, session_description: UniquePtr) { + info!("on_success"); + } + + fn on_failure(&self, error: UniquePtr) { + info!("on_failure"); + } + } + + #[test] + fn create_pc_test() { + env_logger::init(); + let factory = ffi::create_peer_connection_factory(); // Default factory config is defined on the c++ side atm + unsafe { + let mut pc = factory.create_peer_connection(ffi::create_rtc_configuration(ffi::RTCConfiguration { + ice_servers: vec![ffi::ICEServer { + urls: vec!["stun:stun.l.google.com:19302".to_string()], + username: "".to_string(), + password: "".to_string(), + }], + }), peer_connection::ffi::create_native_peer_connection_observer(Box::new(peer_connection::PeerConnectionObserverWrapper::new(Box::new(TestObserver{}))))).unwrap(); + + + let options = peer_connection::ffi::RTCOfferAnswerOptions::default(); + + let sdp_observer = jsep::ffi::create_native_create_sdp_observer(Box::new(jsep::CreateSdpObserverWrapper::new(Box::new(SessionObserver{})))); + pc.pin_mut().create_offer(sdp_observer, options); + + sleep(Duration::from_secs(2)); + + pc.pin_mut().close(); + } + } +} + + + diff --git a/crates/livekit-webrtc/libwebrtc-sys/src/rtc_error.cpp b/crates/livekit-webrtc/libwebrtc-sys/src/rtc_error.cpp new file mode 100644 index 0000000..90ceb53 --- /dev/null +++ b/crates/livekit-webrtc/libwebrtc-sys/src/rtc_error.cpp @@ -0,0 +1,11 @@ +// +// Created by theom on 04/09/2022. +// + +#include "livekit/rtc_error.h" + +namespace livekit { + RTCError::RTCError(webrtc::RTCError error) : rtc_error_(std::move(error)) { + + } +} // livekit \ No newline at end of file diff --git a/crates/livekit-webrtc/libwebrtc-sys/src/rtc_error.rs b/crates/livekit-webrtc/libwebrtc-sys/src/rtc_error.rs new file mode 100644 index 0000000..c9b0466 --- /dev/null +++ b/crates/livekit-webrtc/libwebrtc-sys/src/rtc_error.rs @@ -0,0 +1,13 @@ + +// TODO(theomonnom) Don't use RTCError as Opaque. I should use a Struct and serialize/deserialize when needed for Result<> + +#[cxx::bridge(namespace = "livekit")] +pub mod ffi { + unsafe extern "C++" { + include!("livekit/rtc_error.h"); + + type RTCError; + + fn _unique_rtc_error() -> UniquePtr; + } +} diff --git a/crates/livekit-webrtc/libwebrtc-sys/src/rtp_receiver.cpp b/crates/livekit-webrtc/libwebrtc-sys/src/rtp_receiver.cpp new file mode 100644 index 0000000..0ca8a69 --- /dev/null +++ b/crates/livekit-webrtc/libwebrtc-sys/src/rtp_receiver.cpp @@ -0,0 +1,11 @@ +// +// Created by Théo Monnom on 01/09/2022. +// + +#include "livekit/rtp_receiver.h" + +namespace livekit { + RtpReceiver::RtpReceiver(rtc::scoped_refptr receiver) : receiver_(std::move(receiver)) { + + } +} // livekit \ No newline at end of file diff --git a/crates/livekit-webrtc/libwebrtc-sys/src/rtp_receiver.rs b/crates/livekit-webrtc/libwebrtc-sys/src/rtp_receiver.rs new file mode 100644 index 0000000..456d283 --- /dev/null +++ b/crates/livekit-webrtc/libwebrtc-sys/src/rtp_receiver.rs @@ -0,0 +1,12 @@ +use cxx::UniquePtr; + +#[cxx::bridge(namespace = "livekit")] +pub mod ffi { + unsafe extern "C++" { + include!("livekit/rtp_receiver.h"); + + type RtpReceiver; + + fn _unique_rtp_receiver() -> UniquePtr; // Ignore + } +} diff --git a/crates/livekit-webrtc/libwebrtc-sys/src/rtp_transceiver.cpp b/crates/livekit-webrtc/libwebrtc-sys/src/rtp_transceiver.cpp new file mode 100644 index 0000000..f05e6c5 --- /dev/null +++ b/crates/livekit-webrtc/libwebrtc-sys/src/rtp_transceiver.cpp @@ -0,0 +1,11 @@ +// +// Created by Théo Monnom on 02/09/2022. +// + +#include "livekit/rtp_transceiver.h" + +namespace livekit { + RtpTransceiver::RtpTransceiver(rtc::scoped_refptr transceiver) : transceiver_(std::move(transceiver)) { + + } +} // livekit \ No newline at end of file diff --git a/crates/livekit-webrtc/libwebrtc-sys/src/rtp_transceiver.rs b/crates/livekit-webrtc/libwebrtc-sys/src/rtp_transceiver.rs new file mode 100644 index 0000000..6fc45eb --- /dev/null +++ b/crates/livekit-webrtc/libwebrtc-sys/src/rtp_transceiver.rs @@ -0,0 +1,12 @@ +use cxx::UniquePtr; + +#[cxx::bridge(namespace = "livekit")] +pub mod ffi { + unsafe extern "C++" { + include!("livekit/rtp_transceiver.h"); + + type RtpTransceiver; + + fn _unique_rtp_transceiver() -> UniquePtr; // Ignore + } +} diff --git a/crates/livekit-webrtc/src/data_channel.rs b/crates/livekit-webrtc/src/data_channel.rs new file mode 100644 index 0000000..bd017b3 --- /dev/null +++ b/crates/livekit-webrtc/src/data_channel.rs @@ -0,0 +1,6 @@ + + +pub struct DataChannel { + + +} \ No newline at end of file diff --git a/crates/livekit-webrtc/src/ice_candidate.rs b/crates/livekit-webrtc/src/ice_candidate.rs new file mode 100644 index 0000000..f9c307c --- /dev/null +++ b/crates/livekit-webrtc/src/ice_candidate.rs @@ -0,0 +1,4 @@ + +pub struct IceCandidate { + +} \ No newline at end of file diff --git a/crates/livekit-webrtc/src/lib.rs b/crates/livekit-webrtc/src/lib.rs new file mode 100644 index 0000000..8ff3aaf --- /dev/null +++ b/crates/livekit-webrtc/src/lib.rs @@ -0,0 +1,9 @@ +pub mod peer_connection_factory; +pub mod peer_connection; +pub mod rtc_error; +pub mod data_channel; +pub mod media_stream; +pub mod rtp_receiver; +pub mod rtp_transceiver; +pub mod ice_candidate; +pub mod session_description; \ No newline at end of file diff --git a/crates/livekit-webrtc/src/media_stream.rs b/crates/livekit-webrtc/src/media_stream.rs new file mode 100644 index 0000000..f4adade --- /dev/null +++ b/crates/livekit-webrtc/src/media_stream.rs @@ -0,0 +1,4 @@ + +pub struct MediaStream { + +} \ No newline at end of file diff --git a/crates/livekit-webrtc/src/peer_connection.rs b/crates/livekit-webrtc/src/peer_connection.rs new file mode 100644 index 0000000..033ed45 --- /dev/null +++ b/crates/livekit-webrtc/src/peer_connection.rs @@ -0,0 +1,336 @@ +use std::sync::{Arc, Mutex}; +use cxx::UniquePtr; +use tokio::sync::mpsc; +use libwebrtc_sys::peer_connection as sys_pc; +use libwebrtc_sys::jsep as sys_jsep; + +use crate::data_channel::DataChannel; +use crate::media_stream::MediaStream; +use crate::ice_candidate::IceCandidate; +use crate::rtp_receiver::RtpReceiver; +use crate::rtp_transceiver::RtpTransceiver; +use crate::session_description::SessionDescription; +use crate::rtc_error::RTCError; + +pub use libwebrtc_sys::peer_connection::ffi::PeerConnectionState; +pub use libwebrtc_sys::peer_connection::ffi::SignalingState; +pub use libwebrtc_sys::peer_connection::ffi::IceConnectionState; +pub use libwebrtc_sys::peer_connection::ffi::IceGatheringState; +pub use libwebrtc_sys::peer_connection::ffi::RTCOfferAnswerOptions; + +pub struct PeerConnection { + cxx_handle: UniquePtr, + observer: InternalObserver +} + +impl PeerConnection { + pub fn new(cxx_handle: UniquePtr) -> Self { + Self { + cxx_handle, + observer: InternalObserver { + on_signaling_change_handler: Arc::new(Default::default()), + on_add_stream_handler: Arc::new(Default::default()), + on_remove_stream_handler: Arc::new(Default::default()), + on_data_channel_handler: Arc::new(Default::default()), + on_renegotiation_needed_handler: Arc::new(Default::default()), + on_negotiation_needed_event_handler: Arc::new(Default::default()), + on_ice_connection_change_handler: Arc::new(Default::default()), + on_standardized_ice_connection_change_handler: Arc::new(Default::default()), + on_connection_change_handler: Arc::new(Default::default()), + on_ice_gathering_change_handler: Arc::new(Default::default()), + on_ice_candidate_handler: Arc::new(Default::default()), + on_ice_candidate_error_handler: Arc::new(Default::default()), + on_ice_candidates_removed_handler: Arc::new(Default::default()), + on_ice_connection_receiving_change_handler: Arc::new(Default::default()), + on_ice_selected_candidate_pair_changed_handler: Arc::new(Default::default()), + on_add_track_handler: Arc::new(Default::default()), + on_track_handler: Arc::new(Default::default()), + on_remove_track_handler: Arc::new(Default::default()), + on_interesting_usage_handler: Arc::new(Default::default()) + } + } + } + + pub async fn create_offer(&mut self) -> Result { + let (tx, mut rx) = mpsc::channel(1); + + let wrapper = sys_jsep::CreateSdpObserverWrapper::new(Box::new(InternalCreateSdpObserver { tx })); + let native_wrapper = sys_jsep::ffi::create_native_create_sdp_observer(Box::new(wrapper)); + + self.cxx_handle.pin_mut().create_offer(native_wrapper, RTCOfferAnswerOptions::default()); + rx.recv().await.unwrap() + } + + pub async fn create_answer(&mut self) -> Result { + + } + + pub fn on_signaling_change(&mut self, handler: OnSignalingChangeHandler) { + *self.observer.on_signaling_change_handler.lock().unwrap() = Some(handler); + } + + pub fn on_add_stream(&mut self, handler: OnAddStreamHandler) { + *self.observer.on_add_stream_handler.lock().unwrap() = Some(handler); + } + + pub fn on_remove_stream(&mut self, handler: OnRemoveStreamHandler) { + *self.observer.on_remove_stream_handler.lock().unwrap() = Some(handler); + } + + pub fn on_data_channel(&mut self, handler: OnDataChannelHandler) { + *self.observer.on_data_channel_handler.lock().unwrap() = Some(handler); + } + + pub fn on_renegotiation_needed(&mut self, handler: OnRenegotiationNeededHandler) { + *self.observer.on_renegotiation_needed_handler.lock().unwrap() = Some(handler); + } + + pub fn on_ice_connection_change(&mut self, handler: OnIceConnectionChangeHandler) { + *self.observer.on_ice_connection_change_handler.lock().unwrap() = Some(handler); + } + + pub fn on_standardized_ice_connection_change(&mut self, handler: OnStandardizedIceConnectionChangeHandler) { + *self.observer.on_standardized_ice_connection_change_handler.lock().unwrap() = Some(handler); + } + + pub fn on_connection_change(&mut self, handler: OnConnectionChangeHandler) { + *self.observer.on_connection_change_handler.lock().unwrap() = Some(handler); + } + + pub fn on_ice_gathering_change(&mut self, handler: OnIceGatheringChangeHandler) { + *self.observer.on_ice_gathering_change_handler.lock().unwrap() = Some(handler); + } + + pub fn on_ice_candidate(&mut self, handler: OnIceCandidateHandler) { + *self.observer.on_ice_candidate_handler.lock().unwrap() = Some(handler); + } + + pub fn on_ice_candidate_error(&mut self, handler: OnIceCandidateErrorHandler) { + *self.observer.on_ice_candidate_error_handler.lock().unwrap() = Some(handler); + } + + pub fn on_ice_candidates_removed(&mut self, handler: OnIceCandidatesRemovedHandler) { + *self.observer.on_ice_candidates_removed_handler.lock().unwrap() = Some(handler); + } + + pub fn on_ice_connection_receiving_change(&mut self, handler: OnIceConnectionReceivingChangeHandler) { + *self.observer.on_ice_connection_receiving_change_handler.lock().unwrap() = Some(handler); + } + + pub fn on_ice_selected_candidate_pair_changed(&mut self, handler: OnIceSelectedCandidatePairChangedHandler) { + *self.observer.on_ice_selected_candidate_pair_changed_handler.lock().unwrap() = Some(handler); + } + + pub fn on_add_track(&mut self, handler: OnAddTrackHandler) { + *self.observer.on_add_track_handler.lock().unwrap() = Some(handler); + } + + pub fn on_track(&mut self, handler: OnTrackHandler) { + *self.observer.on_track_handler.lock().unwrap() = Some(handler); + } + + pub fn on_remove_track(&mut self, handler: OnRemoveTrackHandler) { + *self.observer.on_remove_track_handler.lock().unwrap() = Some(handler); + } + + pub fn on_interesting_usage(&mut self, handler: OnInterestingUsageHandler) { + *self.observer.on_interesting_usage_handler.lock().unwrap() = Some(handler); + } +} + +// CreateSdpObserver + +struct InternalCreateSdpObserver { + tx: mpsc::Sender> +} + +impl sys_jsep::CreateSdpObserver for InternalCreateSdpObserver { + fn on_success(&self, session_description: UniquePtr) { + self.tx.blocking_send(Ok(SessionDescription{})).unwrap(); // TODO + } + + fn on_failure(&self, error: UniquePtr) { + self.tx.blocking_send(Err(RTCError{})).unwrap(); // TODO + } +} + +// PeerConnectionObserver + +// TODO(theomonnom) Should we return futures? +pub type OnSignalingChangeHandler = Box; +pub type OnAddStreamHandler = Box; +pub type OnRemoveStreamHandler = Box; +pub type OnDataChannelHandler = Box; +pub type OnRenegotiationNeededHandler = Box; +pub type OnNegotiationNeededEventHandler = Box; +pub type OnIceConnectionChangeHandler = Box; +pub type OnStandardizedIceConnectionChangeHandler = Box; +pub type OnConnectionChangeHandler = Box; +pub type OnIceGatheringChangeHandler = Box; +pub type OnIceCandidateHandler = Box; +pub type OnIceCandidateErrorHandler = Box; +pub type OnIceCandidatesRemovedHandler = Box) + Send + Sync>; +pub type OnIceConnectionReceivingChangeHandler = Box; +pub type OnIceSelectedCandidatePairChangedHandler = Box; +pub type OnAddTrackHandler = Box) + Send + Sync>; +pub type OnTrackHandler = Box; +pub type OnRemoveTrackHandler = Box; +pub type OnInterestingUsageHandler = Box; + +struct InternalObserver { + on_signaling_change_handler: Arc>>, + on_add_stream_handler: Arc>>, + on_remove_stream_handler: Arc>>, + on_data_channel_handler: Arc>>, + on_renegotiation_needed_handler: Arc>>, + on_negotiation_needed_event_handler: Arc>>, + on_ice_connection_change_handler: Arc>>, + on_standardized_ice_connection_change_handler: Arc>>, + on_connection_change_handler: Arc>>, + on_ice_gathering_change_handler: Arc>>, + on_ice_candidate_handler: Arc>>, + on_ice_candidate_error_handler: Arc>>, + on_ice_candidates_removed_handler: Arc>>, + on_ice_connection_receiving_change_handler: Arc>>, + on_ice_selected_candidate_pair_changed_handler: Arc>>, + on_add_track_handler: Arc>>, + on_track_handler: Arc>>, + on_remove_track_handler: Arc>>, + on_interesting_usage_handler: Arc>> +} + +// Observers are being called on the Signaling Thread +impl sys_pc::PeerConnectionObserver for InternalObserver { + fn on_signaling_change(&mut self, new_state: SignalingState) { + let mut handler = self.on_signaling_change_handler.lock().unwrap(); + if let Some(f) = handler.as_mut() { + f(new_state); + } + } + + fn on_add_stream(&mut self, stream: UniquePtr) { + let mut handler = self.on_add_stream_handler.lock().unwrap(); + if let Some(f) = handler.as_mut() { + // TODO(theomonnom) + } + } + + fn on_remove_stream(&mut self, stream: UniquePtr) { + let mut handler = self.on_remove_stream_handler.lock().unwrap(); + if let Some(f) = handler.as_mut() { + // TODO(theomonnom) + } + } + + fn on_data_channel(&mut self, data_channel: UniquePtr) { + let mut handler = self.on_data_channel_handler.lock().unwrap(); + if let Some(f) = handler.as_mut() { + // TODO(theomonnom) + } + } + + fn on_renegotiation_needed(&mut self) { + let mut handler = self.on_renegotiation_needed_handler.lock().unwrap(); + if let Some(f) = handler.as_mut() { + f(); + } + } + + fn on_negotiation_needed_event(&mut self, event: u32) { + let mut handler = self.on_negotiation_needed_event_handler.lock().unwrap(); + if let Some(f) = handler.as_mut() { + f(event); + } + } + + fn on_ice_connection_change(&mut self, new_state: IceConnectionState) { + let mut handler = self.on_ice_connection_change_handler.lock().unwrap(); + if let Some(f) = handler.as_mut() { + f(new_state); + } + } + + fn on_standardized_ice_connection_change(&mut self, new_state: IceConnectionState) { + let mut handler = self.on_standardized_ice_connection_change_handler.lock().unwrap(); + if let Some(f) = handler.as_mut() { + f(new_state); + } + } + + fn on_connection_change(&mut self, new_state: PeerConnectionState) { + let mut handler = self.on_connection_change_handler.lock().unwrap(); + if let Some(f) = handler.as_mut() { + f(new_state); + } + } + + fn on_ice_gathering_change(&mut self, new_state: IceGatheringState) { + let mut handler = self.on_ice_gathering_change_handler.lock().unwrap(); + if let Some(f) = handler.as_mut() { + f(new_state); + } + } + + fn on_ice_candidate(&mut self, candidate: UniquePtr) { + let mut handler = self.on_ice_candidate_handler.lock().unwrap(); + if let Some(f) = handler.as_mut() { + // TODO(theomonnom) + } + } + + fn on_ice_candidate_error(&mut self, address: String, port: i32, url: String, error_code: i32, error_text: String) { + let mut handler = self.on_ice_candidate_error_handler.lock().unwrap(); + if let Some(f) = handler.as_mut() { + f(address, port, url, error_code, error_text); + } + } + + fn on_ice_candidates_removed(&mut self, removed: Vec>) { + let mut handler = self.on_ice_candidates_removed_handler.lock().unwrap(); + if let Some(f) = handler.as_mut() { + // TODO(theomonnom) + } + } + + fn on_ice_connection_receiving_change(&mut self, receiving: bool) { + let mut handler = self.on_ice_connection_receiving_change_handler.lock().unwrap(); + if let Some(f) = handler.as_mut() { + f(receiving); + } + } + + fn on_ice_selected_candidate_pair_changed(&mut self, event: libwebrtc_sys::peer_connection::ffi::CandidatePairChangeEvent) { + let mut handler = self.on_ice_selected_candidate_pair_changed_handler.lock().unwrap(); + if let Some(f) = handler.as_mut() { + f(event); + } + } + + fn on_add_track(&mut self, receiver: UniquePtr, streams: Vec>) { + let mut handler = self.on_add_track_handler.lock().unwrap(); + if let Some(f) = handler.as_mut() { + // TODO(theomonnom) + } + } + + fn on_track(&mut self, transceiver: UniquePtr) { + let mut handler = self.on_track_handler.lock().unwrap(); + if let Some(f) = handler.as_mut() { + // TODO(theomonnom) + } + } + + fn on_remove_track(&mut self, receiver: UniquePtr) { + let mut handler = self.on_remove_track_handler.lock().unwrap(); + if let Some(f) = handler.as_mut() { + // TODO(theomonnom) + } + } + + fn on_interesting_usage(&mut self, usage_pattern: i32) { + let mut handler = self.on_interesting_usage_handler.lock().unwrap(); + if let Some(f) = handler.as_mut() { + f(usage_pattern); + } + } +} \ No newline at end of file diff --git a/crates/livekit-webrtc/src/peer_connection_factory.rs b/crates/livekit-webrtc/src/peer_connection_factory.rs new file mode 100644 index 0000000..8eb8398 --- /dev/null +++ b/crates/livekit-webrtc/src/peer_connection_factory.rs @@ -0,0 +1,54 @@ +use cxx::UniquePtr; +use libwebrtc_sys::peer_connection_factory as sys_factory; +use libwebrtc_sys::peer_connection as sys_pc; + +use crate::peer_connection::PeerConnection; +use crate::rtc_error::RTCError; + +pub use sys_factory::ffi::{RTCConfiguration, ICEServer}; + +pub struct PeerConnectionFactory { + cxx_handle: UniquePtr +} + +impl PeerConnectionFactory { + pub fn new() -> Self { + Self { + cxx_handle: sys_factory::ffi::create_peer_connection_factory() + } + } + + pub fn create_peer_connection(&self, config: RTCConfiguration, observer: Box) -> Result { + let native_config = sys_factory::ffi::create_rtc_configuration(config); + let native_observer = sys_pc::ffi::create_native_peer_connection_observer(Box::new(sys_pc::PeerConnectionObserverWrapper::new(observer))); + + let pc_result : Result, cxx::Exception> = unsafe { + self.cxx_handle.create_peer_connection(native_config, native_observer) + }; + + match pc_result { + Ok(cxx_handle) => { + let pc = PeerConnection::new(cxx_handle); + Ok(pc) + } + Err(e) => { + Err(RTCError{}) // TODO + } + } + } +} + + +#[cfg(test)] +mod tests { + use crate::peer_connection_factory::PeerConnectionFactory; + use crate::peer_connection_factory::{RTCConfiguration, ICEServer}; + + #[test] + fn create_pc(){ + let factory = PeerConnectionFactory::new(); + let pc = factory.create_peer_connection(RTCConfiguration{ + ice_servers: vec!() + }, Box::new(())); + } +} \ No newline at end of file diff --git a/crates/livekit-webrtc/src/rtc_error.rs b/crates/livekit-webrtc/src/rtc_error.rs new file mode 100644 index 0000000..ef75266 --- /dev/null +++ b/crates/livekit-webrtc/src/rtc_error.rs @@ -0,0 +1,5 @@ + + +#[derive(Debug)] +pub struct RTCError { +} diff --git a/crates/livekit-webrtc/src/rtp_receiver.rs b/crates/livekit-webrtc/src/rtp_receiver.rs new file mode 100644 index 0000000..6ab1a0f --- /dev/null +++ b/crates/livekit-webrtc/src/rtp_receiver.rs @@ -0,0 +1,5 @@ + + +pub struct RtpReceiver { + +} \ No newline at end of file diff --git a/crates/livekit-webrtc/src/rtp_transceiver.rs b/crates/livekit-webrtc/src/rtp_transceiver.rs new file mode 100644 index 0000000..dc12234 --- /dev/null +++ b/crates/livekit-webrtc/src/rtp_transceiver.rs @@ -0,0 +1,5 @@ + + +pub struct RtpTransceiver { + +} \ No newline at end of file diff --git a/crates/livekit-webrtc/src/session_description.rs b/crates/livekit-webrtc/src/session_description.rs new file mode 100644 index 0000000..14eaa30 --- /dev/null +++ b/crates/livekit-webrtc/src/session_description.rs @@ -0,0 +1,5 @@ + +#[derive(Debug)] +pub struct SessionDescription { + +} \ No newline at end of file diff --git a/examples/android-project/.gitignore b/examples/android-project/.gitignore deleted file mode 100644 index 701a2ed..0000000 --- a/examples/android-project/.gitignore +++ /dev/null @@ -1,20 +0,0 @@ -*.iml -.gradle -/local.properties -/.idea/caches -/.idea/libraries -/.idea/modules.xml -/.idea/workspace.xml -/.idea/navEditor.xml -/.idea/assetWizardSettings.xml -.DS_Store -/build -/captures -.externalNativeBuild -.cxx -local.properties - - -# For now ( I don't want the libraries to be on GH ) -app/libs -app/src/main/jniLibs \ No newline at end of file diff --git a/examples/android-project/app/.gitignore b/examples/android-project/app/.gitignore deleted file mode 100644 index 42afabf..0000000 --- a/examples/android-project/app/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/build \ No newline at end of file diff --git a/examples/android-project/app/build.gradle b/examples/android-project/app/build.gradle deleted file mode 100644 index 201fd2e..0000000 --- a/examples/android-project/app/build.gradle +++ /dev/null @@ -1,60 +0,0 @@ -plugins { - id 'com.android.application' - id 'org.jetbrains.kotlin.android' -} - -android { - compileSdk 32 - - defaultConfig { - applicationId "io.livekit.android" - minSdk 26 - targetSdk 32 - versionCode 1 - versionName "1.0" - - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - } - - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' - } - } - - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - kotlinOptions { - jvmTarget = '1.8' - } - - buildFeatures { - viewBinding true - } - - sourceSets { - main { - jniLibs.srcDirs = ['src/main/jniLibs'] - } - } -} - -dependencies { - //implementation(files('libs/webrtc.jar')) - - implementation 'net.java.dev.jna:jna:5.12.1@aar' - - implementation 'androidx.core:core-ktx:1.7.0' - implementation 'androidx.appcompat:appcompat:1.4.2' - implementation 'com.google.android.material:material:1.6.1' - implementation 'androidx.constraintlayout:constraintlayout:2.0.4' - implementation 'androidx.navigation:navigation-fragment-ktx:2.3.5' - implementation 'androidx.navigation:navigation-ui-ktx:2.3.5' - testImplementation 'junit:junit:4.13.2' - androidTestImplementation 'androidx.test.ext:junit:1.1.3' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' -} diff --git a/examples/android-project/app/proguard-rules.pro b/examples/android-project/app/proguard-rules.pro deleted file mode 100644 index 481bb43..0000000 --- a/examples/android-project/app/proguard-rules.pro +++ /dev/null @@ -1,21 +0,0 @@ -# Add project specific ProGuard rules here. -# You can control the set of applied configuration files using the -# proguardFiles setting in build.gradle. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} - -# Uncomment this to preserve the line number information for -# debugging stack traces. -#-keepattributes SourceFile,LineNumberTable - -# If you keep the line number information, uncomment this to -# hide the original source file name. -#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/examples/android-project/app/src/androidTest/java/io/livekit/android/ExampleInstrumentedTest.kt b/examples/android-project/app/src/androidTest/java/io/livekit/android/ExampleInstrumentedTest.kt deleted file mode 100644 index ac8b3bd..0000000 --- a/examples/android-project/app/src/androidTest/java/io/livekit/android/ExampleInstrumentedTest.kt +++ /dev/null @@ -1,24 +0,0 @@ -package io.livekit.android - -import androidx.test.platform.app.InstrumentationRegistry -import androidx.test.ext.junit.runners.AndroidJUnit4 - -import org.junit.Test -import org.junit.runner.RunWith - -import org.junit.Assert.* - -/** - * Instrumented test, which will execute on an Android device. - * - * See [testing documentation](http://d.android.com/tools/testing). - */ -@RunWith(AndroidJUnit4::class) -class ExampleInstrumentedTest { - @Test - fun useAppContext() { - // Context of the app under test. - val appContext = InstrumentationRegistry.getInstrumentation().targetContext - assertEquals("io.livekit.android", appContext.packageName) - } -} diff --git a/examples/android-project/app/src/main/AndroidManifest.xml b/examples/android-project/app/src/main/AndroidManifest.xml deleted file mode 100644 index d7b173e..0000000 --- a/examples/android-project/app/src/main/AndroidManifest.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - diff --git a/examples/android-project/app/src/main/java/io/livekit/android/MainActivity.kt b/examples/android-project/app/src/main/java/io/livekit/android/MainActivity.kt deleted file mode 100644 index 73bdbfb..0000000 --- a/examples/android-project/app/src/main/java/io/livekit/android/MainActivity.kt +++ /dev/null @@ -1,35 +0,0 @@ -package io.livekit.android - -import android.os.Bundle -import androidx.appcompat.app.AppCompatActivity -import com.sun.jna.Library -import com.sun.jna.Native -import org.webrtc.PeerConnectionFactory - -class MainActivity : AppCompatActivity() { - - /*interface LKLib : Library { - companion object { - internal val Instance: LKLib by lazy { - Native.load("livekit_native", LKLib::class.java) - } - } - - fun test_rust() - }*/ - - override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) - println("Started activity") - - val opt = PeerConnectionFactory.InitializationOptions.builder(applicationContext).setNativeLibraryName("livekit_native").createInitializationOptions() - - PeerConnectionFactory.initialize(opt) - val factory = PeerConnectionFactory.builder().createPeerConnectionFactory() - - //LKLib.Instance.test_rust() - - println("Called Rust fnc") - println("Now, start investigating the JNI platform specific stuff !") - } -} diff --git a/examples/android-project/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/examples/android-project/app/src/main/res/drawable-v24/ic_launcher_foreground.xml deleted file mode 100644 index 9e3ab4f..0000000 --- a/examples/android-project/app/src/main/res/drawable-v24/ic_launcher_foreground.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - diff --git a/examples/android-project/app/src/main/res/drawable/ic_launcher_background.xml b/examples/android-project/app/src/main/res/drawable/ic_launcher_background.xml deleted file mode 100644 index 86caa75..0000000 --- a/examples/android-project/app/src/main/res/drawable/ic_launcher_background.xml +++ /dev/null @@ -1,170 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/android-project/app/src/main/res/layout/activity_main.xml b/examples/android-project/app/src/main/res/layout/activity_main.xml deleted file mode 100644 index fc796a8..0000000 --- a/examples/android-project/app/src/main/res/layout/activity_main.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - diff --git a/examples/android-project/app/src/main/res/layout/content_main.xml b/examples/android-project/app/src/main/res/layout/content_main.xml deleted file mode 100644 index 183a8f6..0000000 --- a/examples/android-project/app/src/main/res/layout/content_main.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - diff --git a/examples/android-project/app/src/main/res/menu/menu_main.xml b/examples/android-project/app/src/main/res/menu/menu_main.xml deleted file mode 100644 index 4be4421..0000000 --- a/examples/android-project/app/src/main/res/menu/menu_main.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/examples/android-project/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/examples/android-project/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml deleted file mode 100644 index ea737cd..0000000 --- a/examples/android-project/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/examples/android-project/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/examples/android-project/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml deleted file mode 100644 index ea737cd..0000000 --- a/examples/android-project/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/examples/android-project/app/src/main/res/mipmap-hdpi/ic_launcher.webp b/examples/android-project/app/src/main/res/mipmap-hdpi/ic_launcher.webp deleted file mode 100644 index c209e78ecd372343283f4157dcfd918ec5165bb3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1404 zcmV-?1%vuhNk&F=1pok7MM6+kP&il$0000G0000-002h-06|PpNX!5L00Dqw+t%{r zzW2vH!KF=w&cMnnN@{whkTw+#mAh0SV?YL=)3MimFYCWp#fpdtz~8$hD5VPuQgtcN zXl<@<#Cme5f5yr2h%@8TWh?)bSK`O z^Z@d={gn7J{iyxL_y_%J|L>ep{dUxUP8a{byupH&!UNR*OutO~0{*T4q5R6@ApLF! z5{w?Z150gC7#>(VHFJZ-^6O@PYp{t!jH(_Z*nzTK4 zkc{fLE4Q3|mA2`CWQ3{8;gxGizgM!zccbdQoOLZc8hThi-IhN90RFT|zlxh3Ty&VG z?Fe{#9RrRnxzsu|Lg2ddugg7k%>0JeD+{XZ7>Z~{=|M+sh1MF7~ zz>To~`~LVQe1nNoR-gEzkpe{Ak^7{{ZBk2i_<+`Bq<^GB!RYG+z)h;Y3+<{zlMUYd zrd*W4w&jZ0%kBuDZ1EW&KLpyR7r2=}fF2%0VwHM4pUs}ZI2egi#DRMYZPek*^H9YK zay4Iy3WXFG(F14xYsoDA|KXgGc5%2DhmQ1gFCkrgHBm!lXG8I5h*uf{rn48Z!_@ z4Bk6TJAB2CKYqPjiX&mWoW>OPFGd$wqroa($ne7EUK;#3VYkXaew%Kh^3OrMhtjYN?XEoY`tRPQsAkH-DSL^QqyN0>^ zmC>{#F14jz4GeW{pJoRpLFa_*GI{?T93^rX7SPQgT@LbLqpNA}<@2wH;q493)G=1Y z#-sCiRNX~qf3KgiFzB3I>4Z%AfS(3$`-aMIBU+6?gbgDb!)L~A)je+;fR0jWLL-Fu z4)P{c7{B4Hp91&%??2$v9iRSFnuckHUm}or9seH6 z>%NbT+5*@L5(I9j@06@(!{ZI?U0=pKn8uwIg&L{JV14+8s2hnvbRrU|hZCd}IJu7*;;ECgO%8_*W Kmw_-CKmY()leWbG diff --git a/examples/android-project/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp b/examples/android-project/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp deleted file mode 100644 index b2dfe3d1ba5cf3ee31b3ecc1ced89044a1f3b7a9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2898 zcmV-Y3$650Nk&FW3jhFDMM6+kP&il$0000G0000-002h-06|PpNWB9900E$G+qN-D z+81ABX7q?;bwx%xBg?kcwr$(C-Tex-ZCkHUw(Y9#+`E5-zuONG5fgw~E2WDng@Bc@ z24xy+R1n%~6xI#u9vJ8zREI)sb<&Il(016}Z~V1n^PU3-_H17A*Bf^o)&{_uBv}Py zulRfeE8g(g6HFhk_?o_;0@tz?1I+l+Y#Q*;RVC?(ud`_cU-~n|AX-b`JHrOIqn(-t&rOg-o`#C zh0LPxmbOAEb;zHTu!R3LDh1QO zZTf-|lJNUxi-PpcbRjw3n~n-pG;$+dIF6eqM5+L();B2O2tQ~|p{PlpNcvDbd1l%c zLtXn%lu(3!aNK!V#+HNn_D3lp z2%l+hK-nsj|Bi9;V*WIcQRTt5j90A<=am+cc`J zTYIN|PsYAhJ|=&h*4wI4ebv-C=Be#u>}%m;a{IGmJDU`0snWS&$9zdrT(z8#{OZ_Y zxwJx!ZClUi%YJjD6Xz@OP8{ieyJB=tn?>zaI-4JN;rr`JQbb%y5h2O-?_V@7pG_+y z(lqAsqYr!NyVb0C^|uclHaeecG)Sz;WV?rtoqOdAAN{j%?Uo%owya(F&qps@Id|Of zo@~Y-(YmfB+chv^%*3g4k3R0WqvuYUIA+8^SGJ{2Bl$X&X&v02>+0$4?di(34{pt* zG=f#yMs@Y|b&=HyH3k4yP&goF2LJ#tBLJNNDo6lG06r}ghC-pC4Q*=x3;|+W04zte zAl>l4kzUBQFYF(E`KJy?ZXd1tnfbH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+f%W`20BNo)=Xa@M_)+o$4LXJyiw{F?a633SC{B zl~9FH%?^Rm*LVz`lkULs)%idDX^O)SxQol(3jDRyBVR!7d`;ar+D7do)jQ}m`g$TevUD5@?*P8)voa?kEe@_hl{_h8j&5eB-5FrYW&*FHVt$ z$kRF9Nstj%KRzpjdd_9wO=4zO8ritN*NPk_9avYrsF(!4))tm{Ga#OY z(r{0buexOzu7+rw8E08Gxd`LTOID{*AC1m*6Nw@osfB%0oBF5sf<~wH1kL;sd zo)k6^VyRFU`)dt*iX^9&QtWbo6yE8XXH?`ztvpiOLgI3R+=MOBQ9=rMVgi<*CU%+d1PQQ0a1U=&b0vkF207%xU0ssI2 diff --git a/examples/android-project/app/src/main/res/mipmap-mdpi/ic_launcher.webp b/examples/android-project/app/src/main/res/mipmap-mdpi/ic_launcher.webp deleted file mode 100644 index 4f0f1d64e58ba64d180ce43ee13bf9a17835fbca..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 982 zcmV;{11bDcNk&G_0{{S5MM6+kP&il$0000G0000l001ul06|PpNU8t;00Dqo+t#w^ z^1csucXz7-Qrhzl9HuHB%l>&>1tG2^vb*E&k^T3$FG1eQZ51g$uv4V+kI`0<^1Z@N zk?Jjh$olyC%l>)Xq;7!>{iBj&BjJ`P&$fsCfpve_epJOBkTF?nu-B7D!hO=2ZR}

C%4 zc_9eOXvPbC4kzU8YowIA8cW~Uv|eB&yYwAObSwL2vY~UYI7NXPvf3b+c^?wcs~_t{ ze_m66-0)^{JdOMKPwjpQ@Sna!*?$wTZ~su*tNv7o!gXT!GRgivP}ec?5>l1!7<(rT zds|8x(qGc673zrvYIz;J23FG{9nHMnAuP}NpAED^laz3mAN1sy+NXK)!6v1FxQ;lh zOBLA>$~P3r4b*NcqR;y6pwyhZ3_PiDb|%n1gGjl3ZU}ujInlP{eks-#oA6>rh&g+!f`hv#_%JrgYPu z(U^&XLW^QX7F9Z*SRPpQl{B%x)_AMp^}_v~?j7 zapvHMKxSf*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$WYf*k=|*jCEkO19{h_(%W4 zPuOqbCw`SeAX*R}UUsbVsgtuG?xs(#Ikx9`JZoQFz0n*7ZG@Fv@kZk`gzO$HoA9kN z8U5{-yY zvV{`&WKU2$mZeoBmiJrEdzUZAv1sRxpePdg1)F*X^Y)zp^Y*R;;z~vOv-z&)&G)JQ{m!C9cmziu1^nHA z`#`0c>@PnQ9CJKgC5NjJD8HM3|KC(g5nnCq$n0Gsu_DXk36@ql%npEye|?%RmG)

FJ$wK}0tWNB{uH;AM~i diff --git a/examples/android-project/app/src/main/res/mipmap-xhdpi/ic_launcher.webp b/examples/android-project/app/src/main/res/mipmap-xhdpi/ic_launcher.webp deleted file mode 100644 index 948a3070fe34c611c42c0d3ad3013a0dce358be0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1900 zcmV-y2b1_xNk&Fw2LJ$9MM6+kP&il$0000G0001A003VA06|PpNH75a00DqwTbm-~ zullQTcXxO9ki!OCRx^i?oR|n!<8G0=kI^!JSjFi-LL*`V;ET0H2IXfU0*i>o6o6Gy zRq6Ap5(_{XLdXcL-MzlN`ugSdZY_`jXhcENAu)N_0?GhF))9R;E`!bo9p?g?SRgw_ zEXHhFG$0{qYOqhdX<(wE4N@es3VIo$%il%6xP9gjiBri+2pI6aY4 zJbgh-Ud|V%3O!IcHKQx1FQH(_*TK;1>FQWbt^$K1zNn^cczkBs=QHCYZ8b&l!UV{K z{L0$KCf_&KR^}&2Fe|L&?1I7~pBENnCtCuH3sjcx6$c zwqkNkru);ie``q+_QI;IYLD9OV0ZxkuyBz|5<$1BH|vtey$> z5oto4=l-R-Aaq`Dk0}o9N0VrkqW_#;!u{!bJLDq%0092{Ghe=F;(kn} z+sQ@1=UlX30+2nWjkL$B^b!H2^QYO@iFc0{(-~yXj2TWz?VG{v`Jg zg}WyYnwGgn>{HFaG7E~pt=)sOO}*yd(UU-D(E&x{xKEl6OcU?pl)K%#U$dn1mDF19 zSw@l8G!GNFB3c3VVK0?uyqN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+LJuF|SZ9tIec;h%}}6WClT`L>HSW?E{Hp1h^+mlbf_$9zA>!ug>NALJsO{ mU%z=YwVD?}XMya)Bp;vlyE5&E_6!fzx9pwrdz474!~g(M6R?N? diff --git a/examples/android-project/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp b/examples/android-project/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp deleted file mode 100644 index 1b9a6956b3acdc11f40ce2bb3f6efbd845cc243f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3918 zcmV-U53%r4Nk&FS4*&pHMM6+kP&il$0000G0001A003VA06|PpNSy@$00HoY|G(*G z+qV7x14$dSO^Re!iqt-AAIE9iwr$(CZQJL$blA4B`>;C3fBY6Q8_YSjb2%a=fc}4E zrSzssacq<^nmW|Rs93PJni30R<8w<(bK_$LO4L?!_OxLl$}K$MUEllnMK|rg=f3;y z*?;3j|Nh>)p0JQ3A~rf(MibH2r+)3cyV1qF&;8m{w-S*y+0mM){KTK^M5}ksc`qX3 zy>rf^b>~l>SSHds8(I@hz3&PD@LmEs4&prkT=BjsBCXTMhN$_)+kvnl0bLKW5rEsj z*d#KXGDB4P&>etx0X+`R19yC=LS)j!mgs5M0L~+o-T~Jl!p!AJxnGAhV%~rhYUL4hlWhgES3Kb5oA&X z{}?3OBSS-{!v$nCIGj->(-TAG)8LR{htr41^gxsT8yqt2@DEG6Yl`Uma3Nd4;YUoW zTbkYl3CMU5ypMF3EIkYmWL|*BknM`0+Kq6CpvO(y$#j94e+q{vI{Zp8cV_6RK!`&C zob$*5Q|$IZ09dW=L!V zw@#2wviu|<#3lgGE8GEhcx+zBt`} zOwP8j9X%^f7i_bth4PiJ$LYtFJSCN$3xwDN;8mr*B;CJwBP2G0TMq0uNt7S^DO_wE zepk!Wrn#Z#03j{`c*Rf~y3o7?J}w?tEELRUR2cgxB*Y{LzA#pxHgf}q?u5idu>077 zd^=p)`nA}6e`|@`p?u}YU66PP_MA}Zqqe!c{nK&z%Jwq1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iTSC`YS_j22~G;xUV855g2&C(zm^V!(wpcm@zn{%!g z4}JGo(sGZ1O~to-}le

UmY2RIYtNPVDpE$%vda+HD#3m z&VuXJ{BK&Qe+rBa7eq}Q(bq|tn(RrJAk|ztj2(i{d>nmQnM?;HF2k&9sA6up5tmjl z7lySlzMbifH17-m-Lwa_F&e7nOH?ESi3#ckR3tsM+jsck3`oG!uMS}|eAwVXv>}qxwq?QY%QJ0}r@^;fhuUA9W z*BVl>TGo&N004@xSiwDUXUvp51sVmqO3m)=B55aPwf@0=e}cN+$-BdKxY`YrT_4)0 z_d10#i44Q*rFr8MC>*)v$EJvz``(pb{e&*6k+b zsMz%($|1+8hn8c2?P(l@;Rb&CsZeYoCI3?2!LqjbwPXW3z4G$Qfj=cT5Yb%vY0(AX oeb?AaKtwrnc|$|zzw9vfvn^aJJ!zd)XFXqqy0000001=f@-~a#s diff --git a/examples/android-project/app/src/main/res/navigation/nav_graph.xml b/examples/android-project/app/src/main/res/navigation/nav_graph.xml deleted file mode 100644 index f8a973a..0000000 --- a/examples/android-project/app/src/main/res/navigation/nav_graph.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - diff --git a/examples/android-project/app/src/main/res/values-land/dimens.xml b/examples/android-project/app/src/main/res/values-land/dimens.xml deleted file mode 100644 index 4a58c4f..0000000 --- a/examples/android-project/app/src/main/res/values-land/dimens.xml +++ /dev/null @@ -1,3 +0,0 @@ - - 48dp - diff --git a/examples/android-project/app/src/main/res/values-night/themes.xml b/examples/android-project/app/src/main/res/values-night/themes.xml deleted file mode 100644 index 8c5c07f..0000000 --- a/examples/android-project/app/src/main/res/values-night/themes.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - diff --git a/examples/android-project/app/src/main/res/values-w1240dp/dimens.xml b/examples/android-project/app/src/main/res/values-w1240dp/dimens.xml deleted file mode 100644 index 7d44cb6..0000000 --- a/examples/android-project/app/src/main/res/values-w1240dp/dimens.xml +++ /dev/null @@ -1,3 +0,0 @@ - - 200dp - diff --git a/examples/android-project/app/src/main/res/values-w600dp/dimens.xml b/examples/android-project/app/src/main/res/values-w600dp/dimens.xml deleted file mode 100644 index 4a58c4f..0000000 --- a/examples/android-project/app/src/main/res/values-w600dp/dimens.xml +++ /dev/null @@ -1,3 +0,0 @@ - - 48dp - diff --git a/examples/android-project/app/src/main/res/values/colors.xml b/examples/android-project/app/src/main/res/values/colors.xml deleted file mode 100644 index 758655a..0000000 --- a/examples/android-project/app/src/main/res/values/colors.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - #FFBB86FC - #FF6200EE - #FF3700B3 - #FF03DAC5 - #FF018786 - #FF000000 - #FFFFFFFF - diff --git a/examples/android-project/app/src/main/res/values/dimens.xml b/examples/android-project/app/src/main/res/values/dimens.xml deleted file mode 100644 index 184ee9b..0000000 --- a/examples/android-project/app/src/main/res/values/dimens.xml +++ /dev/null @@ -1,3 +0,0 @@ - - 16dp - diff --git a/examples/android-project/app/src/main/res/values/strings.xml b/examples/android-project/app/src/main/res/values/strings.xml deleted file mode 100644 index 78550ad..0000000 --- a/examples/android-project/app/src/main/res/values/strings.xml +++ /dev/null @@ -1,12 +0,0 @@ - - LKAndroid - Settings - - First Fragment - Second Fragment - Next - Previous - - Hello first fragment - Hello second fragment. Arg: %1$s - diff --git a/examples/android-project/app/src/main/res/values/themes.xml b/examples/android-project/app/src/main/res/values/themes.xml deleted file mode 100644 index 5f99fa7..0000000 --- a/examples/android-project/app/src/main/res/values/themes.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - -