mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-16 15:36:12 -04:00
Add WEB_RTC_NON_CELLULAR enum, IV
PiperOrigin-RevId: 686408097
This commit is contained in:
committed by
Copybara-Service
parent
77a75f4389
commit
e5f80e9fdc
@@ -114,6 +114,7 @@ class FeatureFlags {
|
||||
// from triggering an OutOfMemory error.
|
||||
std::uint32_t connection_max_frame_length = 1048576;
|
||||
std::uint32_t blocking_queue_stream_queue_capacity = 10;
|
||||
bool support_web_rtc_non_cellular_medium = false;
|
||||
};
|
||||
|
||||
static const FeatureFlags& GetInstance() {
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
|
||||
#include "absl/strings/string_view.h"
|
||||
#include "internal/platform/byte_array.h"
|
||||
#include "internal/platform/feature_flags.h"
|
||||
#include "internal/platform/implementation/platform.h"
|
||||
#include "internal/platform/implementation/webrtc.h"
|
||||
#include "webrtc/api/peer_connection_interface.h"
|
||||
@@ -87,9 +88,10 @@ class WebRtcMedium {
|
||||
// |callback|.
|
||||
void CreatePeerConnection(webrtc::PeerConnectionObserver* observer,
|
||||
PeerConnectionCallback callback) {
|
||||
// TODO(edwinwu): Add a flag to control this and add support for
|
||||
// non-cellular networks.
|
||||
if (non_cellular_) {
|
||||
if (FeatureFlags::GetInstance()
|
||||
.GetFlags()
|
||||
.support_web_rtc_non_cellular_medium) {
|
||||
// TODO(edwinwu): Add support for non-cellular networks.
|
||||
impl_->CreatePeerConnection(std::nullopt, observer, std::move(callback));
|
||||
} else {
|
||||
impl_->CreatePeerConnection(observer, std::move(callback));
|
||||
|
||||
Reference in New Issue
Block a user