Files
nearby/connections/implementation/mediums/webrtc/BUILD
T
Nick Bourdakos 2a09838b61 Remove the need for WebRtc stub
PiperOrigin-RevId: 917974575
2026-05-19 12:46:45 -07:00

159 lines
5.6 KiB
Python

load("@rules_cc//cc:cc_library.bzl", "cc_library")
load("@rules_cc//cc:cc_test.bzl", "cc_test")
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
licenses(["notice"])
cc_library(
name = "webrtc",
hdrs = [
"data_channel_listener.h",
"local_ice_candidate_listener.h",
"session_description_wrapper.h",
],
copts = ["-DNO_WEBRTC"],
deps = [
"//connections:core_types",
"//connections/implementation/mediums:webrtc_socket",
# "//third_party/webrtc/files/stable/webrtc/api:create_peerconnection_factory", # buildcleaner: keep
# "//third_party/webrtc/files/stable/webrtc/api:jsep",
# "//third_party/webrtc/files/stable/webrtc/api:peer_connection_interface",
"@com_google_absl//absl/functional:any_invocable",
],
)
cc_library(
name = "connection_flow",
srcs = ["connection_flow.cc"],
hdrs = ["connection_flow.h"],
deps = [
":webrtc",
":webrtc_socket_impl",
"//connections/implementation/mediums:webrtc_socket",
"//internal/platform:base",
"//internal/platform:comm",
"//internal/platform:logging",
"//internal/platform:types",
# "//third_party/webrtc/files/stable/webrtc/api:data_channel_interface",
# "//third_party/webrtc/files/stable/webrtc/api:jsep",
# "//third_party/webrtc/files/stable/webrtc/api:libjingle_peerconnection_api",
"@com_google_absl//absl/base:core_headers",
"@com_google_absl//absl/functional:any_invocable",
"@com_google_absl//absl/memory",
"@com_google_absl//absl/time",
],
)
cc_library(
name = "signaling_frames",
srcs = ["signaling_frames.cc"],
hdrs = ["signaling_frames.h"],
deps = [
"//connections/implementation/mediums:webrtc_peer_id",
"//internal/platform:base",
"//proto/mediums:web_rtc_signaling_frames_cc_proto",
# "//third_party/webrtc/files/stable/webrtc/api:libjingle_peerconnection_api",
],
)
cc_library(
name = "webrtc_socket_impl",
srcs = ["webrtc_socket_impl.cc"],
hdrs = ["webrtc_socket_impl.h"],
visibility = [
"//connections/implementation:__subpackages__",
],
deps = [
"//connections/implementation/mediums:webrtc_socket",
"//internal/platform:base",
"//internal/platform:logging",
"//internal/platform:types",
# "//third_party/webrtc/files/stable/webrtc/api:data_channel_interface",
# "//third_party/webrtc/files/stable/webrtc/api:scoped_refptr",
"@com_google_absl//absl/functional:any_invocable",
"@com_google_absl//absl/strings:string_view",
],
)
cc_library(
name = "webrtc_impl",
srcs = ["webrtc_impl.cc"],
hdrs = ["webrtc_impl.h"],
visibility = [
"//connections/implementation:__subpackages__",
],
deps = [
":connection_flow",
":signaling_frames",
":webrtc",
"//connections/implementation/mediums:webrtc",
"//connections/implementation/mediums:webrtc_peer_id",
"//connections/implementation/mediums:webrtc_socket",
"//internal/platform:base",
"//internal/platform:cancellation_flag",
"//internal/platform:comm",
"//internal/platform:logging",
"//internal/platform:types",
"//proto/mediums:web_rtc_signaling_frames_cc_proto",
# "//third_party/webrtc/files/stable/webrtc/api:jsep",
"//third_party/webrtc/files/stable/webrtc/rtc_base:network_constants",
"@com_google_absl//absl/base:core_headers",
"@com_google_absl//absl/container:flat_hash_map",
"@com_google_absl//absl/container:flat_hash_set",
"@com_google_absl//absl/functional:bind_front",
"@com_google_absl//absl/time",
],
)
cc_test(
name = "webrtc_test",
timeout = "short",
srcs = [
"connection_flow_test.cc",
"signaling_frames_test.cc",
"webrtc_impl_test.cc",
"webrtc_socket_impl_test.cc",
],
shard_count = 16,
tags = [
"notsan", # NOTE(b/139734036): known data race in usrsctplib.
"requires-net:external",
],
deps = [
":connection_flow",
":signaling_frames",
":webrtc",
":webrtc_impl",
":webrtc_socket_impl",
"//connections/implementation/mediums:webrtc_peer_id",
"//connections/implementation/mediums:webrtc_socket",
"//internal/platform:base",
"//internal/platform:cancellation_flag",
"//internal/platform:comm",
"//internal/platform:test_util",
"//internal/platform:types",
"//internal/platform/implementation/g3", # buildcleaner: keep
"//internal/test",
# "//third_party/webrtc/files/stable/webrtc/api:data_channel_interface",
# "//third_party/webrtc/files/stable/webrtc/api:jsep",
# "//third_party/webrtc/files/stable/webrtc/api:scoped_refptr",
"@com_github_protobuf_matchers//protobuf-matchers",
"@com_google_absl//absl/strings:string_view",
"@com_google_absl//absl/time",
"@com_google_googletest//:gtest_main",
"@com_google_protobuf//:protobuf",
],
)