Skip to content

Commit e87ad3b

Browse files
committed
[Third Party] Add libdatachannel
1 parent fb68f28 commit e87ad3b

File tree

4 files changed

+162
-0
lines changed

4 files changed

+162
-0
lines changed

.gitmodules

+4
Original file line numberDiff line numberDiff line change
@@ -349,3 +349,7 @@
349349
path = third_party/re2/src
350350
url = https://github.com/google/re2.git
351351
platforms = linux,darwin
352+
[submodule "third_party/libdatachannel/repo"]
353+
path = third_party/libdatachannel/repo
354+
url = https://github.com/paullouisageneau/libdatachannel.git
355+
platforms = linux

examples/chip-tool/BUILD.gn

+1
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ static_library("chip-tool-utils") {
136136
"${chip_root}/src/platform",
137137
"${chip_root}/third_party/inipp",
138138
"${chip_root}/third_party/jsoncpp",
139+
"${chip_root}/third_party/libdatachannel",
139140
]
140141

141142
public_configs = [ ":config" ]

third_party/libdatachannel/BUILD.gn

+156
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
# Copyright (c) 2025 Project CHIP Authors
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
config("libdatachannel_config") {
16+
include_dirs = [
17+
"repo/include",
18+
"repo/include/rtc",
19+
]
20+
}
21+
22+
config("libdatachannel_config_disable_warnings") {
23+
cflags_cc = [
24+
"-Wno-shadow",
25+
"-Wno-unreachable-code",
26+
"-Wno-non-virtual-dtor",
27+
"-Wno-implicit-fallthrough",
28+
"-Wno-unknown-warning-option",
29+
]
30+
}
31+
32+
config("libdatachannel_config_enable_features") {
33+
cflags_cc = [
34+
"-fexceptions",
35+
"-frtti",
36+
]
37+
}
38+
39+
source_set("libdatachannel") {
40+
include_dirs = [
41+
"repo/src",
42+
"repo/include/rtc",
43+
"repo/deps/plog/include",
44+
"repo/deps/usrsctp/usrsctplib",
45+
"repo/deps/libjuice/include",
46+
"repo/deps/libsrtp/include",
47+
]
48+
49+
# ---------------------------------------------------------------------------
50+
# Source files from repo/src/*.cpp
51+
# ---------------------------------------------------------------------------
52+
sources = [
53+
"repo/src/av1rtppacketizer.cpp",
54+
"repo/src/candidate.cpp",
55+
"repo/src/capi.cpp",
56+
"repo/src/channel.cpp",
57+
"repo/src/configuration.cpp",
58+
"repo/src/datachannel.cpp",
59+
"repo/src/description.cpp",
60+
"repo/src/global.cpp",
61+
"repo/src/h264rtpdepacketizer.cpp",
62+
"repo/src/h264rtppacketizer.cpp",
63+
"repo/src/h265nalunit.cpp",
64+
"repo/src/h265rtpdepacketizer.cpp",
65+
"repo/src/h265rtppacketizer.cpp",
66+
"repo/src/mediahandler.cpp",
67+
"repo/src/message.cpp",
68+
"repo/src/nalunit.cpp",
69+
"repo/src/pacinghandler.cpp",
70+
"repo/src/peerconnection.cpp",
71+
"repo/src/plihandler.cpp",
72+
"repo/src/rembhandler.cpp",
73+
"repo/src/rtcpnackresponder.cpp",
74+
"repo/src/rtcpreceivingsession.cpp",
75+
"repo/src/rtcpsrreporter.cpp",
76+
"repo/src/rtp.cpp",
77+
"repo/src/rtpdepacketizer.cpp",
78+
"repo/src/rtppacketizationconfig.cpp",
79+
"repo/src/rtppacketizer.cpp",
80+
"repo/src/track.cpp",
81+
"repo/src/websocket.cpp",
82+
"repo/src/websocketserver.cpp",
83+
]
84+
85+
# ---------------------------------------------------------------------------
86+
# Source files from repo/src/impl/*.cpp
87+
# ---------------------------------------------------------------------------
88+
sources += [
89+
"repo/src/impl/certificate.cpp",
90+
"repo/src/impl/channel.cpp",
91+
"repo/src/impl/datachannel.cpp",
92+
"repo/src/impl/dtlssrtptransport.cpp",
93+
"repo/src/impl/dtlstransport.cpp",
94+
"repo/src/impl/http.cpp",
95+
"repo/src/impl/httpproxytransport.cpp",
96+
"repo/src/impl/icetransport.cpp",
97+
"repo/src/impl/init.cpp",
98+
"repo/src/impl/logcounter.cpp",
99+
"repo/src/impl/peerconnection.cpp",
100+
"repo/src/impl/pollinterrupter.cpp",
101+
"repo/src/impl/pollservice.cpp",
102+
"repo/src/impl/processor.cpp",
103+
"repo/src/impl/sctptransport.cpp",
104+
"repo/src/impl/sha.cpp",
105+
"repo/src/impl/tcpserver.cpp",
106+
"repo/src/impl/tcptransport.cpp",
107+
"repo/src/impl/threadpool.cpp",
108+
"repo/src/impl/tls.cpp",
109+
"repo/src/impl/tlstransport.cpp",
110+
"repo/src/impl/track.cpp",
111+
"repo/src/impl/transport.cpp",
112+
"repo/src/impl/utils.cpp",
113+
"repo/src/impl/verifiedtlstransport.cpp",
114+
"repo/src/impl/websocket.cpp",
115+
"repo/src/impl/websocketserver.cpp",
116+
"repo/src/impl/wshandshake.cpp",
117+
"repo/src/impl/wstransport.cpp",
118+
]
119+
120+
public_configs = [ ":libdatachannel_config" ]
121+
configs += [
122+
":libdatachannel_config_disable_warnings",
123+
":libdatachannel_config_enable_features",
124+
]
125+
126+
defines = [
127+
"BUILD_SHARED_LIBS=1", # default ON in the CMake
128+
"BUILD_SHARED_DEPS_LIBS=0", # default OFF
129+
"USE_GNUTLS=0", # default OFF => no GnuTLS
130+
"USE_MBEDTLS=0", # default OFF => no MbedTLS
131+
"USE_NICE=0", # default OFF => no libnice
132+
"PREFER_SYSTEM_LIB=0", # default OFF
133+
"USE_SYSTEM_SRTP=0", # default from PREFER_SYSTEM_LIB
134+
"USE_SYSTEM_JUICE=0",
135+
"USE_SYSTEM_USRSCTP=0",
136+
"USE_SYSTEM_PLOG=0",
137+
"USE_SYSTEM_JSON=0",
138+
"NO_WEBSOCKET=0", # default OFF => websockets on
139+
"NO_MEDIA=0", # default OFF => media on
140+
"NO_EXAMPLES=0", # default OFF
141+
"NO_TESTS=0", # default OFF
142+
"WARNINGS_AS_ERRORS=0", # default OFF
143+
"CAPI_STDCALL=0", # default OFF
144+
"SCTP_DEBUG=0", # default OFF
145+
"RTC_UPDATE_VERSION_HEADER=0", # default OFF
146+
147+
# Because NO_WEBSOCKET=0 => RTC_ENABLE_WEBSOCKET=1
148+
"RTC_ENABLE_WEBSOCKET=1",
149+
150+
# Because NO_MEDIA=0 => RTC_ENABLE_MEDIA=1
151+
"RTC_ENABLE_MEDIA=1",
152+
153+
# Because USE_SYSTEM_SRTP=0 => RTC_SYSTEM_SRTP=1
154+
"RTC_SYSTEM_SRTP=0",
155+
]
156+
}

third_party/libdatachannel/repo

Submodule repo added at 6fa7cff

0 commit comments

Comments
 (0)