Skip to content
This repository was archived by the owner on Oct 25, 2024. It is now read-only.

Commit a0e63da

Browse files
authored
Switch from QuicTransport to WebTransport for conference SDK. (#538)
1 parent eb6a401 commit a0e63da

14 files changed

+142
-104
lines changed

README.md

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,17 @@ The following dependencies are for Windows only:
3232
- Create a file named .gclient in the directory above the `src` dir, with these contents:
3333

3434
```
35-
solutions = [
36-
{
37-
"managed": False,
38-
"name": "src",
39-
"url": "https://github.com/open-webrtc-toolkit/owt-client-native.git",
40-
"custom_deps": {},
41-
"deps_file": "DEPS",
42-
"safesync_url": "",
43-
},
44-
]
45-
target_os = []
35+
solutions = [
36+
{
37+
"managed": False,
38+
"name": "src",
39+
"url": "https://github.com/open-webrtc-toolkit/owt-client-native.git",
40+
"custom_deps": {},
41+
"deps_file": "DEPS",
42+
"safesync_url": "",
43+
},
44+
]
45+
target_os = []
4646
```
4747

4848
### Build
@@ -67,7 +67,8 @@ Common build options shared by Windows and Linux:
6767
- The built binary will be under path specified by `--output_path`. If `--output_path` is not set, the built binary will be under `src/out` directory.
6868
- The optional `--ssl_root` should be set to the root directory of lastest OpenSSL 1.1.1 binary. If specified, SDK will link to external openssl library instead of boringssl.
6969
- Use `--gn_gen` to generate args.gn during the first build or when you change either `ssl_root`/`msdk_root`/`quic_root` options.
70-
- The optional `--quic_root` should point to the directory containing QUIC library pre-built from owt-sdk-quic repo. This will build the SDK with QUIC enabled for conference mode.
70+
- The optional `--quic_root` should point to the directory containing WebTransport library pre-built from owt-sdk-quic repo. This will build the SDK with WebTransport enabled for
71+
conference mode. Refer to [README.webtransport](https://github.com/open-webrtc-toolkit/owt-client-native/blob/main/README.webtransport) for the version of webtransport library to be used.
7172
- The optional `--tests` will trigger unit tests after build.
7273

7374
#### iOS

README.webtransport

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
WebTransport SDK version:
2+
===================================
3+
Repo URL: https://github.com/open-webrtc-toolkit/owt-sdk-quic
4+
Revision: c53899b14b5b24e796ad51bd36c8d02ddb8cde48

talk/owt/BUILD.gn

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,15 @@
55
import("//build_overrides/webrtc.gni")
66
import("//testing/test.gni")
77

8+
declare_args() {
9+
include_internal_audio_device = true
10+
owt_msdk_lib_root = ""
11+
owt_msdk_header_root = ""
12+
}
13+
814
# Introduced for using libvpx config files. We only enable libvpx rate
915
# controller for VP9 on Windows.
10-
if (is_win) {
16+
if (is_win && owt_msdk_header_root != "") {
1117

1218
if (current_cpu == "x86") {
1319
cpu_arch_full = "ia32"
@@ -26,19 +32,17 @@ if (is_android) {
2632
import("//build/config/android/config.gni")
2733
import("//build/config/android/rules.gni")
2834
}
35+
2936
if (is_ios) {
3037
import("//build/config/ios/rules.gni")
3138
}
32-
declare_args() {
33-
include_internal_audio_device = true
34-
owt_msdk_lib_root = ""
35-
owt_msdk_header_root = ""
36-
}
39+
3740
if (is_ios || is_mac) {
3841
config("owt_sdk_objc_warnings_config") {
3942
cflags_objc = [ "-Wstrict-prototypes" ]
4043
}
4144
}
45+
4246
if (is_android) {
4347
config("libjingle_peerconnection_jni_warnings_config") {
4448
# The warnings below are enabled by default. Since GN orders compiler flags
@@ -52,6 +56,7 @@ if (is_android) {
5256
}
5357
}
5458
}
59+
5560
static_library("owt_deps") {
5661
deps = [
5762
"//third_party/webrtc/api:create_peerconnection_factory",
@@ -66,6 +71,7 @@ static_library("owt_deps") {
6671
}
6772
complete_static_lib = true
6873
}
74+
6975
if (!is_ios) {
7076
static_library("owt") {
7177
deps = [

talk/owt/docs/cpp/cpp.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ This SDK is interoperable with Open WebRTC Toolkit Client SDK for JavaScript\*,
77
Refer to the Release Notes for the latest information in the SDK release package, including features,
88
bug fixes and known issues.
99
# 2 Supported platforms {#section2}
10-
Open WebRTC Toolkit Client SDK for Windows supports Windows 7 and later versions.
10+
Open WebRTC Toolkit Client SDK for Windows supports Windows 8 and later versions.
1111
# 3 Getting started {#section3}
1212
Application on Open WebRTC Toolkit Client SDK for Windows should be built with Microsoft Visual Studio\* 2017 or 2019. Running time library for linking should be `Multi-threaded Debug (/MTd)` for debug version or `Multi-threaded (/MT)` for release version. Supported platform is x64.
1313
The release package includes one sample application to get you started quickly with the SDK. The following two static libraries are provided in the SDK for only x64, along with their headers:
1414
- owt-debug.lib - this library includes all the WebRTC features for debug usages.
1515
- owt-release.lib - this library includes all the WebRTC features for release usages.
1616
owt-debug.lib|owt-release references libraries in Windows SDK for DXVA support. Your application must statically link
17-
mfuuid.lib, mf.lib, mfplat.lib, d3d9.lib, dxgi.lib, d3d11.lib and dxva2.lib to build. Depending on your signaling
17+
mfuuid.lib, mf.lib, mfplat.lib, d3d9.lib, dxgi.lib, d3d11.lib, dcomp.lib and dxva2.lib to build. Depending on your signaling
1818
channel implementation, you can optionally link sioclient.lib or sioclient_tls.lib if neccessary.
1919
# 4 Socket.IO {#section4}
2020
Socket.IO cpp client is an open source project hosted on [Github](https://github.com/socketio/socket.io-client-cpp). Please follow official guide on GitHub to build and link it. The version works with OWT is b1216ee428dd7d1e72368da9b12aa43bfc487c93.
@@ -29,8 +29,8 @@ for P2P sessions can be customized by implementing `P2PSignalingChannelInterface
2929
can invoke its methods to notify `PeerClient` during your customized signaling channel implementation when a new
3030
message is coming or connection is lost.
3131
# 7 Video codecs {#section7}
32-
For the decoder, if hardware acceleration is not enabled, only VP8/VP9 is supported. If hardware acceleration is enabled, VP8,
33-
VP9, H.264 and HEVC are supported, but it will fallback to VP8 software decoder if GPU does not supports VP8 hardware decoding.
32+
For the decoder, if hardware acceleration is not enabled, only VP8/VP9/AV1 is supported. If hardware acceleration is enabled, VP8,
33+
VP9, H.264, HEVC and AV1 are supported, but it will fallback to VP8 software decoder if GPU does not supports VP8 hardware decoding.
3434
Most of the 5th-11th Generation Intel<sup>®</sup> Core(TM) Processor platforms support VP8 hardware decoding, refer to their specific documentation for details.
3535
Starting from 6th Generation Intel<sup>®</sup> Core(TM) Processor platforms, hardware encoding and decoding of HEVC is supported.
3636
You can turn off video encoding/decoding hardware acceleration via {@link owt.base.GlobalConfiguration GlobalConfiguration} API,

talk/owt/sdk/base/stream.cc

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -720,17 +720,13 @@ MediaStreamInterface* RemoteStream::MediaStream() {
720720
}
721721

722722
#ifdef OWT_ENABLE_QUIC
723-
QuicStream::QuicStream(owt::quic::QuicTransportStreamInterface* quic_stream,
723+
QuicStream::QuicStream(owt::quic::WebTransportStreamInterface* quic_stream,
724724
const std::string& session_id)
725725
: quic_stream_(quic_stream), session_id_(session_id), can_read_(true),
726726
can_write_(true), fin_read_(false) {
727727
}
728728

729729
QuicStream::~QuicStream() {
730-
if (quic_stream_) {
731-
delete quic_stream_;
732-
quic_stream_ = nullptr;
733-
}
734730
}
735731

736732
size_t QuicStream::Write(uint8_t* data, size_t length) {

talk/owt/sdk/conference/conferenceclient.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ void ConferenceClient::OnConnectionFailed() {
255255
}
256256

257257
void ConferenceClient::OnIncomingStream(const std::string& session_id,
258-
owt::quic::QuicTransportStreamInterface* stream) {
258+
owt::quic::WebTransportStreamInterface* stream) {
259259
RTC_LOG(LS_INFO) << "Quic client received a stream on session:" << session_id;
260260
// Check if the subscription exists for this stream. Trigger immediately
261261
// if exists. Otherwise push to pending list.
@@ -1046,11 +1046,11 @@ void ConferenceClient::Leave(
10461046
}
10471047
#ifdef OWT_ENABLE_QUIC
10481048
{
1049-
std::lock_guard<std::mutex> lock(quic_publications_mutex_);
1049+
// Do not hold the lock of quic_publications_ as only Stop
1050+
// will remove the publications from list.
10501051
for (auto& publication : quic_publications_) {
10511052
publication.second->Stop();
10521053
}
1053-
quic_publications_.clear();
10541054
}
10551055
{
10561056
std::lock_guard<std::mutex> lock(quic_subscriptions_mutex_);
@@ -1725,7 +1725,7 @@ void ConferenceClient::TriggerOnUserLeft(sio::message::ptr user_info) {
17251725
#ifdef OWT_ENABLE_QUIC
17261726
void ConferenceClient::TriggerOnIncomingStream(
17271727
const std::string& session_id,
1728-
owt::quic::QuicTransportStreamInterface* stream) {
1728+
owt::quic::WebTransportStreamInterface* stream) {
17291729
const std::lock_guard<std::mutex> lock(stream_update_observer_mutex_);
17301730
for (auto its = stream_update_observers_.begin();
17311731
its != stream_update_observers_.end(); ++its) {

talk/owt/sdk/conference/conferencesubscription.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ void ConferenceSubscription::OnStreamError(const std::string& error_msg) {
211211

212212
#ifdef OWT_ENABLE_QUIC
213213
void ConferenceSubscription::OnIncomingStream(const std::string& session_id,
214-
owt::quic::QuicTransportStreamInterface* stream) {
214+
owt::quic::WebTransportStreamInterface* stream) {
215215
if (ended_ || stream_id_ != session_id)
216216
return;
217217
quic_stream_ = std::make_shared<owt::base::QuicStream>(stream, session_id);

0 commit comments

Comments
 (0)