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

Enable owt dynamic library built out and fix adm init error issue. #309

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions build_overrides/ssl/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ if (owt_use_openssl) {
}
} else {
libs = [
"libeay32.lib",
"ssleay32.lib",
"crypto",
"ssl",
]
}
if (is_clang) {
Expand Down
2 changes: 1 addition & 1 deletion scripts/build_linux.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def ninjabuild(arch, scheme):
if subprocess.call(['ninja', '-C', out_path], cwd=HOME_PATH, shell=False) != 0:
return False
src_lib_path = os.path.join(out_path, r'obj/talk/owt/libowt.a')
shutil.copy(src_lib_path, gen_lib_path(scheme))
# shutil.copy(src_lib_path, gen_lib_path(scheme))
return True

def runtest(scheme):
Expand Down
5 changes: 5 additions & 0 deletions scripts/prepare_dev.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
LIBSRTP_PATH = os.path.join(THIRD_PARTY_PATH, 'libsrtp')
LIBJPEG_TURBO_PATH = os.path.join(THIRD_PARTY_PATH, 'libjpeg_turbo')
WEBRTC_OVERRIDES_PATH = os.path.join(THIRD_PARTY_PATH, 'webrtc_overrides')
LIBYUV_PATH = os.path.join(THIRD_PARTY_PATH, 'libyuv')
BUILD_PATH = os.path.join(HOME_PATH, 'build')
TOOL_PATH = os.path.join(HOME_PATH, 'tools')
BASE_PATH = os.path.join(HOME_PATH, 'base')
Expand Down Expand Up @@ -54,6 +55,10 @@ def _patch():
subprocess.call(['git', 'am', '--skip'], shell=useShell, cwd=LIBJPEG_TURBO_PATH)
#if (subprocess.call(['git', 'am', os.path.join(PATCH_PATH, '0012-ios-Adds-CFBundleShortVersionString-to-the-plist-for.patch')], shell=useShell, cwd=TESTING_PATH)) != 0:
subprocess.call(['git', 'am', '--skip'], shell=useShell, cwd=TESTING_PATH)
if (subprocess.call(['git', 'am', os.path.join(PATCH_PATH, '0001-Export-symbols-of-jsoncpp.patch')], shell=useShell, cwd=THIRD_PARTY_PATH)) != 0:
subprocess.call(['git', 'am', '--skip'], shell=useShell, cwd=THIRD_PARTY_PATH)
if (subprocess.call(['git', 'am', os.path.join(PATCH_PATH, '0001-Export-symbols-of-libyuv.patch')], shell=useShell, cwd=LIBYUV_PATH)) != 0:
subprocess.call(['git', 'am', '--skip'], shell=useShell, cwd=LIBYUV_PATH)

def main(argv):
_patch()
Expand Down
15 changes: 12 additions & 3 deletions talk/owt/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,17 @@ static_library("owt_deps") {
complete_static_lib = true
}
if (!is_ios) {
static_library("owt") {
shared_library("owt") {
deps = [
":owt_sdk_base",
":owt_sdk_conf",
# ":owt_sdk_conf",
":owt_sdk_p2p",
"//third_party/protobuf:protobuf_lite",
"//third_party/webrtc",
"//third_party/webrtc:webrtc",
"//third_party/webrtc/api:libjingle_peerconnection_api",
]
complete_static_lib = true
# complete_static_lib = true
}
}
static_library("owt_sdk_base") {
Expand Down Expand Up @@ -226,6 +226,9 @@ static_library("owt_sdk_base") {
"-Wno-reorder",
]
}

configs -= [ "//build/config/gcc:symbol_visibility_hidden" ]
configs += [ "//build/config/gcc:symbol_visibility_default" ]
}
static_library("owt_sdk_p2p") {
deps = [
Expand Down Expand Up @@ -254,6 +257,9 @@ static_library("owt_sdk_p2p") {
if (is_clang) {
configs -= [ "//build/config/clang:find_bad_constructs" ]
}

configs -= [ "//build/config/gcc:symbol_visibility_hidden" ]
configs += [ "//build/config/gcc:symbol_visibility_default" ]
}
static_library("owt_sdk_conf") {
deps = [
Expand Down Expand Up @@ -282,6 +288,9 @@ static_library("owt_sdk_conf") {
if (is_clang) {
configs -= [ "//build/config/clang:find_bad_constructs" ]
}

configs -= [ "//build/config/gcc:symbol_visibility_hidden" ]
configs += [ "//build/config/gcc:symbol_visibility_default" ]
}
if (is_ios) {
static_library("owt_sdk_objc") {
Expand Down
27 changes: 27 additions & 0 deletions talk/owt/patches/0001-Export-symbols-of-jsoncpp.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
From 3f42957b5e3f4224d6948881587a278aa18542f9 Mon Sep 17 00:00:00 2001
From: "Liu, Kai1" <[email protected]>
Date: Tue, 10 Mar 2020 14:59:49 +0800
Subject: [PATCH] Export symbols of jsoncpp

Signed-off-by: Liu, Kai1 <[email protected]>
---
jsoncpp/BUILD.gn | 3 +++
1 file changed, 3 insertions(+)

diff --git a/jsoncpp/BUILD.gn b/jsoncpp/BUILD.gn
index f2f48b9ee7c..b7603fa2d12 100644
--- a/jsoncpp/BUILD.gn
+++ b/jsoncpp/BUILD.gn
@@ -44,6 +44,9 @@ source_set("jsoncpp") {
"JSON_USE_NULLREF=0",
]

+ configs -= [ "//build/config/gcc:symbol_visibility_hidden" ]
+ configs += [ "//build/config/gcc:symbol_visibility_default" ]
+
include_dirs = [ "source/src/lib_json" ]

if (!is_win || is_clang) {
--
2.17.1

26 changes: 26 additions & 0 deletions talk/owt/patches/0001-Export-symbols-of-libyuv.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
From a59ad6fef977e98015a5ee2a0986e31e571fd06f Mon Sep 17 00:00:00 2001
From: "Liu, Kai1" <[email protected]>
Date: Tue, 10 Mar 2020 15:00:35 +0800
Subject: [PATCH] Export symbols of libyuv

Signed-off-by: Liu, Kai1 <[email protected]>
---
BUILD.gn | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/BUILD.gn b/BUILD.gn
index 8904fd6c..f8f41578 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -16,7 +16,7 @@ declare_args() {
# When building a shared library using a target in WebRTC or
# Chromium projects that depends on libyuv, setting this flag
# to true makes libyuv symbols visible inside that library.
- libyuv_symbols_visible = false
+ libyuv_symbols_visible = true
}

config("libyuv_config") {
--
2.17.1

5 changes: 5 additions & 0 deletions talk/owt/sdk/p2p/p2pclient.cc
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,11 @@ void P2PClient::OnStopped(const std::string& remote_id) {
{
const std::lock_guard<std::mutex> lock(removed_pc_channels_mutex_);
removed_pc_channels_.push_back(pc_channels_[remote_id]);
const int kCachedPccNum = 20;
while (removed_pc_channels_.size() > kCachedPccNum) {
std::vector<std::shared_ptr<P2PPeerConnectionChannel>>::iterator iter = removed_pc_channels_.begin();
removed_pc_channels_.erase(iter);
}
}
const std::lock_guard<std::mutex> lock(pc_channels_mutex_);
pc_channels_.erase(remote_id);
Expand Down
1 change: 0 additions & 1 deletion talk/owt/sdk/p2p/p2ppeerconnectionchannel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,6 @@ void P2PPeerConnectionChannel::OnMessageStop() {
}
ClosePeerConnection();
ChangeSessionState(kSessionStateReady);
TriggerOnStopped();
}
void P2PPeerConnectionChannel::OnMessageSignal(Json::Value& message) {
RTC_LOG(LS_INFO) << "OnMessageSignal";
Expand Down