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

Commit

Permalink
Switch from QuicTransport to WebTransport for conference SDK. (#538)
Browse files Browse the repository at this point in the history
  • Loading branch information
taste1981 authored Jul 12, 2021
1 parent eb6a401 commit a0e63da
Show file tree
Hide file tree
Showing 14 changed files with 142 additions and 104 deletions.
25 changes: 13 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,17 @@ The following dependencies are for Windows only:
- Create a file named .gclient in the directory above the `src` dir, with these contents:

```
solutions = [
{
"managed": False,
"name": "src",
"url": "https://github.com/open-webrtc-toolkit/owt-client-native.git",
"custom_deps": {},
"deps_file": "DEPS",
"safesync_url": "",
},
]
target_os = []
solutions = [
{
"managed": False,
"name": "src",
"url": "https://github.com/open-webrtc-toolkit/owt-client-native.git",
"custom_deps": {},
"deps_file": "DEPS",
"safesync_url": "",
},
]
target_os = []
```

### Build
Expand All @@ -67,7 +67,8 @@ Common build options shared by Windows and Linux:
- 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.
- 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.
- Use `--gn_gen` to generate args.gn during the first build or when you change either `ssl_root`/`msdk_root`/`quic_root` options.
- 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.
- 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
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.
- The optional `--tests` will trigger unit tests after build.

#### iOS
Expand Down
4 changes: 4 additions & 0 deletions README.webtransport
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
WebTransport SDK version:
===================================
Repo URL: https://github.com/open-webrtc-toolkit/owt-sdk-quic
Revision: c53899b14b5b24e796ad51bd36c8d02ddb8cde48
18 changes: 12 additions & 6 deletions talk/owt/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,15 @@
import("//build_overrides/webrtc.gni")
import("//testing/test.gni")

declare_args() {
include_internal_audio_device = true
owt_msdk_lib_root = ""
owt_msdk_header_root = ""
}

# Introduced for using libvpx config files. We only enable libvpx rate
# controller for VP9 on Windows.
if (is_win) {
if (is_win && owt_msdk_header_root != "") {

if (current_cpu == "x86") {
cpu_arch_full = "ia32"
Expand All @@ -26,19 +32,17 @@ if (is_android) {
import("//build/config/android/config.gni")
import("//build/config/android/rules.gni")
}

if (is_ios) {
import("//build/config/ios/rules.gni")
}
declare_args() {
include_internal_audio_device = true
owt_msdk_lib_root = ""
owt_msdk_header_root = ""
}

if (is_ios || is_mac) {
config("owt_sdk_objc_warnings_config") {
cflags_objc = [ "-Wstrict-prototypes" ]
}
}

if (is_android) {
config("libjingle_peerconnection_jni_warnings_config") {
# The warnings below are enabled by default. Since GN orders compiler flags
Expand All @@ -52,6 +56,7 @@ if (is_android) {
}
}
}

static_library("owt_deps") {
deps = [
"//third_party/webrtc/api:create_peerconnection_factory",
Expand All @@ -66,6 +71,7 @@ static_library("owt_deps") {
}
complete_static_lib = true
}

if (!is_ios) {
static_library("owt") {
deps = [
Expand Down
8 changes: 4 additions & 4 deletions talk/owt/docs/cpp/cpp.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ This SDK is interoperable with Open WebRTC Toolkit Client SDK for JavaScript\*,
Refer to the Release Notes for the latest information in the SDK release package, including features,
bug fixes and known issues.
# 2 Supported platforms {#section2}
Open WebRTC Toolkit Client SDK for Windows supports Windows 7 and later versions.
Open WebRTC Toolkit Client SDK for Windows supports Windows 8 and later versions.
# 3 Getting started {#section3}
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.
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:
- owt-debug.lib - this library includes all the WebRTC features for debug usages.
- owt-release.lib - this library includes all the WebRTC features for release usages.
owt-debug.lib|owt-release references libraries in Windows SDK for DXVA support. Your application must statically link
mfuuid.lib, mf.lib, mfplat.lib, d3d9.lib, dxgi.lib, d3d11.lib and dxva2.lib to build. Depending on your signaling
mfuuid.lib, mf.lib, mfplat.lib, d3d9.lib, dxgi.lib, d3d11.lib, dcomp.lib and dxva2.lib to build. Depending on your signaling
channel implementation, you can optionally link sioclient.lib or sioclient_tls.lib if neccessary.
# 4 Socket.IO {#section4}
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.
Expand All @@ -29,8 +29,8 @@ for P2P sessions can be customized by implementing `P2PSignalingChannelInterface
can invoke its methods to notify `PeerClient` during your customized signaling channel implementation when a new
message is coming or connection is lost.
# 7 Video codecs {#section7}
For the decoder, if hardware acceleration is not enabled, only VP8/VP9 is supported. If hardware acceleration is enabled, VP8,
VP9, H.264 and HEVC are supported, but it will fallback to VP8 software decoder if GPU does not supports VP8 hardware decoding.
For the decoder, if hardware acceleration is not enabled, only VP8/VP9/AV1 is supported. If hardware acceleration is enabled, VP8,
VP9, H.264, HEVC and AV1 are supported, but it will fallback to VP8 software decoder if GPU does not supports VP8 hardware decoding.
Most of the 5th-11th Generation Intel<sup>®</sup> Core(TM) Processor platforms support VP8 hardware decoding, refer to their specific documentation for details.
Starting from 6th Generation Intel<sup>®</sup> Core(TM) Processor platforms, hardware encoding and decoding of HEVC is supported.
You can turn off video encoding/decoding hardware acceleration via {@link owt.base.GlobalConfiguration GlobalConfiguration} API,
Expand Down
6 changes: 1 addition & 5 deletions talk/owt/sdk/base/stream.cc
Original file line number Diff line number Diff line change
Expand Up @@ -720,17 +720,13 @@ MediaStreamInterface* RemoteStream::MediaStream() {
}

#ifdef OWT_ENABLE_QUIC
QuicStream::QuicStream(owt::quic::QuicTransportStreamInterface* quic_stream,
QuicStream::QuicStream(owt::quic::WebTransportStreamInterface* quic_stream,
const std::string& session_id)
: quic_stream_(quic_stream), session_id_(session_id), can_read_(true),
can_write_(true), fin_read_(false) {
}

QuicStream::~QuicStream() {
if (quic_stream_) {
delete quic_stream_;
quic_stream_ = nullptr;
}
}

size_t QuicStream::Write(uint8_t* data, size_t length) {
Expand Down
8 changes: 4 additions & 4 deletions talk/owt/sdk/conference/conferenceclient.cc
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ void ConferenceClient::OnConnectionFailed() {
}

void ConferenceClient::OnIncomingStream(const std::string& session_id,
owt::quic::QuicTransportStreamInterface* stream) {
owt::quic::WebTransportStreamInterface* stream) {
RTC_LOG(LS_INFO) << "Quic client received a stream on session:" << session_id;
// Check if the subscription exists for this stream. Trigger immediately
// if exists. Otherwise push to pending list.
Expand Down Expand Up @@ -1046,11 +1046,11 @@ void ConferenceClient::Leave(
}
#ifdef OWT_ENABLE_QUIC
{
std::lock_guard<std::mutex> lock(quic_publications_mutex_);
// Do not hold the lock of quic_publications_ as only Stop
// will remove the publications from list.
for (auto& publication : quic_publications_) {
publication.second->Stop();
}
quic_publications_.clear();
}
{
std::lock_guard<std::mutex> lock(quic_subscriptions_mutex_);
Expand Down Expand Up @@ -1725,7 +1725,7 @@ void ConferenceClient::TriggerOnUserLeft(sio::message::ptr user_info) {
#ifdef OWT_ENABLE_QUIC
void ConferenceClient::TriggerOnIncomingStream(
const std::string& session_id,
owt::quic::QuicTransportStreamInterface* stream) {
owt::quic::WebTransportStreamInterface* stream) {
const std::lock_guard<std::mutex> lock(stream_update_observer_mutex_);
for (auto its = stream_update_observers_.begin();
its != stream_update_observers_.end(); ++its) {
Expand Down
2 changes: 1 addition & 1 deletion talk/owt/sdk/conference/conferencesubscription.cc
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ void ConferenceSubscription::OnStreamError(const std::string& error_msg) {

#ifdef OWT_ENABLE_QUIC
void ConferenceSubscription::OnIncomingStream(const std::string& session_id,
owt::quic::QuicTransportStreamInterface* stream) {
owt::quic::WebTransportStreamInterface* stream) {
if (ended_ || stream_id_ != session_id)
return;
quic_stream_ = std::make_shared<owt::base::QuicStream>(stream, session_id);
Expand Down
Loading

0 comments on commit a0e63da

Please sign in to comment.