Add native self-hosted instance connection to fluxer_desktop
Trimmed monorepo checkout (fluxer_desktop + packages/voice_engine_v2 + tools/ci) with a "Connect to a Different Server" menu item and popout that lets the desktop app switch to any self-hosted Fluxer instance, plus fixes for well-known discovery on single-domain self-hosted deployments and a false-positive ERR_ABORTED on same-origin client redirects during the switch. Defaults to chat.fluxr.chat and uses an isolated userData directory from the official build.
This commit is contained in:
+36
@@ -0,0 +1,36 @@
|
||||
diff --git a/BUILD.gn b/BUILD.gn
|
||||
index ca8d8faa61..13e07a2f28 100644
|
||||
--- a/BUILD.gn
|
||||
+++ b/BUILD.gn
|
||||
@@ -24,6 +24,9 @@
|
||||
import("//build/config/linux/pkg_config.gni")
|
||||
import("//build/config/sanitizers/sanitizers.gni")
|
||||
import("webrtc.gni")
|
||||
+import("//third_party/libaom/options.gni")
|
||||
+
|
||||
+
|
||||
if (rtc_enable_protobuf) {
|
||||
import("//third_party/protobuf/proto_library.gni")
|
||||
}
|
||||
@@ -331,6 +334,10 @@ config("common_config") {
|
||||
defines += [ "WEBRTC_INCLUDE_INTERNAL_AUDIO_DEVICE" ]
|
||||
}
|
||||
|
||||
+ if (enable_libaom) {
|
||||
+ defines += [ "RTC_USE_LIBAOM_AV1_ENCODER" ]
|
||||
+ }
|
||||
+
|
||||
if (rtc_libvpx_build_vp9) {
|
||||
defines += [ "RTC_ENABLE_VP9" ]
|
||||
}
|
||||
@@ -565,6 +572,10 @@ if (!build_with_chromium) {
|
||||
"pc:rtc_pc",
|
||||
"sdk",
|
||||
"video",
|
||||
+ "//third_party/zlib",
|
||||
+ "rtc_base:log_sinks",
|
||||
+ "media:rtc_simulcast_encoder_adapter",
|
||||
+ "api/crypto:frame_crypto_transformer",
|
||||
]
|
||||
|
||||
if (rtc_include_builtin_audio_codecs) {
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
diff --git a/tools_webrtc/libs/generate_licenses.py b/tools_webrtc/libs/generate_licenses.py
|
||||
index d945b43..5f3e457 100755
|
||||
--- a/tools_webrtc/libs/generate_licenses.py
|
||||
+++ b/tools_webrtc/libs/generate_licenses.py
|
||||
@@ -86,6 +86,18 @@ LIB_TO_LICENSES_DICT = {
|
||||
# Compile time dependencies, no license needed:
|
||||
'ow2_asm': [],
|
||||
'jdk': [],
|
||||
+
|
||||
+ 'ffmpeg':[
|
||||
+ 'third_party/ffmpeg/COPYING.GPLv2',
|
||||
+ 'third_party/ffmpeg/COPYING.GPLv3',
|
||||
+ 'third_party/ffmpeg/COPYING.LGPLv2.1',
|
||||
+ 'third_party/ffmpeg/COPYING.LGPLv3'
|
||||
+ ],
|
||||
+ 'openh264': ['third_party/openh264/src/LICENSE'],
|
||||
+ 'catapult': [],
|
||||
+ 'google_benchmark': [],
|
||||
+ 'googletest': [],
|
||||
+ 'vinn': [],
|
||||
}
|
||||
|
||||
# Third_party library _regex_ to licences mapping. Keys are regular expression
|
||||
Vendored
+22
@@ -0,0 +1,22 @@
|
||||
--- src/buildtools/third_party/libunwind/BUILD.gn 2023-07-10 10:19:16
|
||||
+++ src/buildtools/third_party/libunwind/BUILD.gn 2023-07-10 10:19:23
|
||||
@@ -21,7 +21,7 @@ config("libunwind_config") {
|
||||
|
||||
# TODO(crbug.com/40273848): Move this build file to third_party/libc++/BUILD.gn once submodule migration is done
|
||||
source_set("libunwind") {
|
||||
- visibility = [ "//buildtools/third_party/libc++abi" ]
|
||||
+ visibility = [ "//buildtools/third_party/libc++abi", "//build/config:common_deps" ]
|
||||
if (is_android) {
|
||||
visibility += [ "//services/tracing/public/cpp" ]
|
||||
}
|
||||
--- src/build/config/BUILD.gn 2023-07-10 10:23:49
|
||||
+++ src/build/config/BUILD.gn 2023-07-10 10:23:54
|
||||
@@ -296,6 +296,8 @@ group("common_deps") {
|
||||
|
||||
if (use_custom_libcxx) {
|
||||
public_deps += [ "//buildtools/third_party/libc++" ]
|
||||
+ } else {
|
||||
+ public_deps += [ "//buildtools/third_party/libunwind" ]
|
||||
}
|
||||
|
||||
if (use_llvm_libatomic) {
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
diff --git a/dav1d/BUILD.gn b/dav1d/BUILD.gn
|
||||
index 9348e15c3c..f34db7ff98 100644
|
||||
--- a/dav1d/BUILD.gn
|
||||
+++ b/dav1d/BUILD.gn
|
||||
@@ -101,7 +101,7 @@ if (is_win) {
|
||||
dav1d_copts += [ "-D_DARWIN_C_SOURCE" ]
|
||||
}
|
||||
if (is_linux || is_chromeos || is_android || current_os == "aix") {
|
||||
- if (!is_clang) {
|
||||
+ if (!is_clang && (current_cpu == "x86" || current_cpu == "x64")) {
|
||||
dav1d_copts += [ "-D_GNU_SOURCE" ]
|
||||
}
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
diff --git a/config/compiler/BUILD.gn b/config/compiler/BUILD.gn
|
||||
index c09c9677b..3cfce80a1 100644
|
||||
--- a/config/compiler/BUILD.gn
|
||||
+++ b/config/compiler/BUILD.gn
|
||||
@@ -721,14 +721,6 @@ config("compiler") {
|
||||
} else {
|
||||
cflags += [ "-ffp-contract=off" ]
|
||||
}
|
||||
-
|
||||
- # Enable ELF CREL (see crbug.com/357878242) for all platforms that use ELF.
|
||||
- # TODO(crbug.com/376278218): This causes segfault on Linux ARM builds.
|
||||
- # It also causes segfault on Linux s390x:
|
||||
- # https://github.com/llvm/llvm-project/issues/149511
|
||||
- if (is_linux && use_lld && current_cpu != "arm" && current_cpu != "s390x") {
|
||||
- cflags += [ "-Wa,--crel,--allow-experimental-crel" ]
|
||||
- }
|
||||
}
|
||||
|
||||
# C11/C++11 compiler flags setup.
|
||||
fluxer_desktop/native/webrtc-sender/vendor/webrtc-sys/libwebrtc/patches/disable_sme_for_libyuv.patch
Vendored
+13
@@ -0,0 +1,13 @@
|
||||
diff --git a/libyuv.gni b/libyuv.gni
|
||||
index 3334df70..9859a121 100644
|
||||
--- a/libyuv.gni
|
||||
+++ b/libyuv.gni
|
||||
@@ -24,7 +24,7 @@ declare_args() {
|
||||
# errors on Fuchsia, macOS, and compilation errors on Windows.
|
||||
# TODO: bug 359006069 - Remove the restriction after the linker and
|
||||
# compilation errors are fixed.
|
||||
- libyuv_use_sme = current_cpu == "arm64" && (is_linux || is_android)
|
||||
+ libyuv_use_sme = false
|
||||
libyuv_use_msa =
|
||||
(current_cpu == "mips64el" || current_cpu == "mipsel") && mips_use_msa
|
||||
libyuv_use_mmi =
|
||||
Vendored
+142
@@ -0,0 +1,142 @@
|
||||
diff --git a/api/media_stream_interface.h b/api/media_stream_interface.h
|
||||
index fb1cc4e58e..85062ba60e 100644
|
||||
--- a/api/media_stream_interface.h
|
||||
+++ b/api/media_stream_interface.h
|
||||
@@ -267,6 +267,11 @@ class RTC_EXPORT AudioSourceInterface : public MediaSourceInterface {
|
||||
// (for some of the settings this approach is broken, e.g. setting
|
||||
// audio network adaptation on the source is the wrong layer of abstraction).
|
||||
virtual const AudioOptions options() const;
|
||||
+
|
||||
+ // Returns true if this source delivers audio externally (via AddSink),
|
||||
+ // bypassing the ADM/AudioState audio distribution path.
|
||||
+ // When true, AudioSendStream should not register with AudioState.
|
||||
+ virtual bool is_external_source() const { return false; }
|
||||
};
|
||||
|
||||
// Interface of the audio processor used by the audio track to collect
|
||||
diff --git a/audio/audio_send_stream.cc b/audio/audio_send_stream.cc
|
||||
index 76156ce830..10b59d3ff6 100644
|
||||
--- a/audio/audio_send_stream.cc
|
||||
+++ b/audio/audio_send_stream.cc
|
||||
@@ -373,8 +373,13 @@ void AudioSendStream::Start() {
|
||||
}
|
||||
channel_send_->StartSend();
|
||||
sending_ = true;
|
||||
- audio_state()->AddSendingStream(this, encoder_sample_rate_hz_,
|
||||
- encoder_num_channels_);
|
||||
+ // Only register with AudioState if not using external source.
|
||||
+ // External sources (like NativeAudioSource) deliver audio directly via AddSink,
|
||||
+ // so we don't want AudioState to also send device audio to this stream.
|
||||
+ if (!config_.external_source) {
|
||||
+ audio_state()->AddSendingStream(this, encoder_sample_rate_hz_,
|
||||
+ encoder_num_channels_);
|
||||
+ }
|
||||
}
|
||||
|
||||
void AudioSendStream::Stop() {
|
||||
@@ -386,7 +391,10 @@ void AudioSendStream::Stop() {
|
||||
RemoveBitrateObserver();
|
||||
channel_send_->StopSend();
|
||||
sending_ = false;
|
||||
- audio_state()->RemoveSendingStream(this);
|
||||
+ // Only unregister if we registered (when not using external source).
|
||||
+ if (!config_.external_source) {
|
||||
+ audio_state()->RemoveSendingStream(this);
|
||||
+ }
|
||||
}
|
||||
|
||||
void AudioSendStream::SendAudioData(std::unique_ptr<AudioFrame> audio_frame) {
|
||||
diff --git a/call/audio_send_stream.h b/call/audio_send_stream.h
|
||||
index 84341b5cb1..9359777bc9 100644
|
||||
--- a/call/audio_send_stream.h
|
||||
+++ b/call/audio_send_stream.h
|
||||
@@ -178,6 +178,12 @@ class AudioSendStream : public AudioSender {
|
||||
// An optional frame transformer used by insertable streams to transform
|
||||
// encoded frames.
|
||||
scoped_refptr<webrtc::FrameTransformerInterface> frame_transformer;
|
||||
+
|
||||
+ // When true, this stream uses an external audio source (not ADM).
|
||||
+ // AudioState will NOT send device-captured audio to this stream.
|
||||
+ // Audio is delivered directly via the source's AddSink mechanism.
|
||||
+ // This prevents mixing of device audio with externally-sourced audio.
|
||||
+ bool external_source = false;
|
||||
};
|
||||
|
||||
virtual ~AudioSendStream() = default;
|
||||
diff --git a/media/base/audio_source.h b/media/base/audio_source.h
|
||||
index 04a7d19dfa..9f513f3c75 100644
|
||||
--- a/media/base/audio_source.h
|
||||
+++ b/media/base/audio_source.h
|
||||
@@ -49,6 +49,10 @@ class AudioSource {
|
||||
// to the source at a time.
|
||||
virtual void SetSink(Sink* sink) = 0;
|
||||
|
||||
+ // Returns true if this source delivers audio externally (bypassing ADM).
|
||||
+ // When true, AudioSendStream should not register with AudioState.
|
||||
+ virtual bool is_external_source() const { return false; }
|
||||
+
|
||||
protected:
|
||||
virtual ~AudioSource() {}
|
||||
};
|
||||
diff --git a/media/engine/webrtc_voice_engine.cc b/media/engine/webrtc_voice_engine.cc
|
||||
index 762f9d584c..4ce07ddc9d 100644
|
||||
--- a/media/engine/webrtc_voice_engine.cc
|
||||
+++ b/media/engine/webrtc_voice_engine.cc
|
||||
@@ -1017,6 +1017,14 @@ class WebRtcVoiceSendChannel::WebRtcAudioSendStream : public AudioSource::Sink {
|
||||
RTC_DCHECK(source_ == source);
|
||||
return;
|
||||
}
|
||||
+
|
||||
+ // Check if this is an external audio source (delivers audio via AddSink).
|
||||
+ // If so, mark the config so AudioState doesn't send device audio to this
|
||||
+ // stream. This must be done before UpdateSendState() calls Start().
|
||||
+ if (source->is_external_source() && !config_.external_source) {
|
||||
+ config_.external_source = true;
|
||||
+ stream_->Reconfigure(config_, nullptr);
|
||||
+ }
|
||||
source->SetSink(this);
|
||||
source_ = source;
|
||||
UpdateSendState();
|
||||
diff --git a/pc/rtp_sender.cc b/pc/rtp_sender.cc
|
||||
index d5edbbf0ed..c14ddfe868 100644
|
||||
--- a/pc/rtp_sender.cc
|
||||
+++ b/pc/rtp_sender.cc
|
||||
@@ -786,6 +786,13 @@ void AudioRtpSender::SetSend() {
|
||||
RTC_DCHECK_RUN_ON(signaling_thread_);
|
||||
RTC_DCHECK(!stopped_);
|
||||
RTC_DCHECK(can_send_track());
|
||||
+
|
||||
+ // Propagate is_external_source from AudioSourceInterface to the sink adapter.
|
||||
+ // This ensures the voice engine knows not to mix ADM audio with external sources.
|
||||
+ if (audio_track()->GetSource() && audio_track()->GetSource()->is_external_source()) {
|
||||
+ sink_adapter_->set_is_external_source(true);
|
||||
+ }
|
||||
+
|
||||
if (!media_channel_) {
|
||||
RTC_LOG(LS_ERROR) << "SetAudioSend: No audio channel exists.";
|
||||
return;
|
||||
diff --git a/pc/rtp_sender.h b/pc/rtp_sender.h
|
||||
index eaffd4ef0f..d0489df9e7 100644
|
||||
--- a/pc/rtp_sender.h
|
||||
+++ b/pc/rtp_sender.h
|
||||
@@ -307,6 +307,12 @@ class LocalAudioSinkAdapter : public AudioTrackSinkInterface,
|
||||
LocalAudioSinkAdapter();
|
||||
virtual ~LocalAudioSinkAdapter();
|
||||
|
||||
+ // Set whether the original AudioSourceInterface is an external source.
|
||||
+ // This propagates the is_external_source state from AudioSourceInterface
|
||||
+ // to this AudioSource adapter.
|
||||
+ void set_is_external_source(bool value) { is_external_source_ = value; }
|
||||
+ bool is_external_source() const override { return is_external_source_; }
|
||||
+
|
||||
private:
|
||||
// AudioSinkInterface implementation.
|
||||
void OnData(const void* audio_data,
|
||||
@@ -337,6 +343,7 @@ class LocalAudioSinkAdapter : public AudioTrackSinkInterface,
|
||||
// Critical section protecting `sink_`.
|
||||
Mutex lock_;
|
||||
int num_preferred_channels_ = -1;
|
||||
+ bool is_external_source_ = false;
|
||||
};
|
||||
|
||||
class AudioRtpSender : public DtmfProviderInterface, public RtpSenderBase {
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
diff --git a/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc b/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc
|
||||
index 070257f072..61fd0c8f3b 100644
|
||||
--- a/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc
|
||||
+++ b/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc
|
||||
@@ -71,10 +71,10 @@ constexpr int CursorMetaSize(int w, int h) {
|
||||
w * h * kCursorBpp);
|
||||
}
|
||||
|
||||
-constexpr PipeWireVersion kDmaBufModifierMinVersion = {.major = 0,
|
||||
+const PipeWireVersion kDmaBufModifierMinVersion = {.major = 0,
|
||||
.minor = 3,
|
||||
.micro = 33};
|
||||
-constexpr PipeWireVersion kDropSingleModifierMinVersion = {.major = 0,
|
||||
+const PipeWireVersion kDropSingleModifierMinVersion = {.major = 0,
|
||||
.minor = 3,
|
||||
.micro = 40};
|
||||
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
diff --git a/tools_webrtc/libs/generate_licenses.py b/tools_webrtc/libs/generate_licenses.py
|
||||
--- a/tools_webrtc/libs/generate_licenses.py
|
||||
+++ b/tools_webrtc/libs/generate_licenses.py
|
||||
@@ -211,6 +211,12 @@ class LicenseBuilder:
|
||||
|
||||
def _get_third_party_libraries(self, buildfile_dir, target):
|
||||
license_json = LicenseBuilder._run_gn(buildfile_dir, target)
|
||||
+ # Strip any non-JSON content (e.g., GN warnings) before the actual JSON.
|
||||
+ # GN may output warnings before the JSON when certain build args trigger
|
||||
+ # deprecation notices.
|
||||
+ json_start = license_json.find('{')
|
||||
+ if json_start > 0:
|
||||
+ license_json = license_json[json_start:]
|
||||
try:
|
||||
output = json.loads(license_json)
|
||||
except:
|
||||
+317
@@ -0,0 +1,317 @@
|
||||
diff --git a/modules/video_coding/codecs/test/android_codec_factory_helper.cc b/modules/video_coding/codecs/test/android_codec_factory_helper.cc
|
||||
index f6a5046210..4ce5a79d25 100644
|
||||
--- a/modules/video_coding/codecs/test/android_codec_factory_helper.cc
|
||||
+++ b/modules/video_coding/codecs/test/android_codec_factory_helper.cc
|
||||
@@ -54,9 +54,9 @@ void InitializeAndroidObjects() {
|
||||
std::unique_ptr<VideoEncoderFactory> CreateAndroidEncoderFactory() {
|
||||
JNIEnv* env = AttachCurrentThreadIfNeeded();
|
||||
ScopedJavaLocalRef<jclass> factory_class =
|
||||
- GetClass(env, "org/webrtc/HardwareVideoEncoderFactory");
|
||||
+ GetClass(env, "livekit/org/webrtc/HardwareVideoEncoderFactory");
|
||||
jmethodID factory_constructor = env->GetMethodID(
|
||||
- factory_class.obj(), "<init>", "(Lorg/webrtc/EglBase$Context;ZZ)V");
|
||||
+ factory_class.obj(), "<init>", "(Llivekit/org/webrtc/EglBase$Context;ZZ)V");
|
||||
ScopedJavaLocalRef<jobject> factory_object =
|
||||
ScopedJavaLocalRef<jobject>::Adopt(
|
||||
env, env->NewObject(factory_class.obj(), factory_constructor,
|
||||
@@ -69,9 +69,9 @@ std::unique_ptr<VideoEncoderFactory> CreateAndroidEncoderFactory() {
|
||||
std::unique_ptr<VideoDecoderFactory> CreateAndroidDecoderFactory() {
|
||||
JNIEnv* env = AttachCurrentThreadIfNeeded();
|
||||
ScopedJavaLocalRef<jclass> factory_class =
|
||||
- GetClass(env, "org/webrtc/HardwareVideoDecoderFactory");
|
||||
+ GetClass(env, "livekit/org/webrtc/HardwareVideoDecoderFactory");
|
||||
jmethodID factory_constructor = env->GetMethodID(
|
||||
- factory_class.obj(), "<init>", "(Lorg/webrtc/EglBase$Context;)V");
|
||||
+ factory_class.obj(), "<init>", "(Llivekit/org/webrtc/EglBase$Context;)V");
|
||||
ScopedJavaLocalRef<jobject> factory_object =
|
||||
ScopedJavaLocalRef<jobject>::Adopt(
|
||||
env, env->NewObject(factory_class.obj(), factory_constructor,
|
||||
diff --git a/sdk/android/BUILD.gn b/sdk/android/BUILD.gn
|
||||
index 8ce74e2c8c..2e88760d0a 100644
|
||||
--- a/sdk/android/BUILD.gn
|
||||
+++ b/sdk/android/BUILD.gn
|
||||
@@ -1446,11 +1446,13 @@ if (current_os == "linux" || is_android) {
|
||||
generate_jni("generated_environment_jni") {
|
||||
sources = [ "api/org/webrtc/Environment.java" ]
|
||||
namespace = "webrtc::jni"
|
||||
+ package_prefix = android_package_prefix
|
||||
}
|
||||
|
||||
generate_jni("generated_metrics_jni") {
|
||||
sources = [ "api/org/webrtc/Metrics.java" ]
|
||||
namespace = "webrtc::jni"
|
||||
+ package_prefix = android_package_prefix
|
||||
}
|
||||
|
||||
# Generated JNI for public JNI targets, matching order of targets
|
||||
@@ -1464,6 +1466,7 @@ if (current_os == "linux" || is_android) {
|
||||
"src/java/org/webrtc/JniCommon.java",
|
||||
]
|
||||
namespace = "webrtc::jni"
|
||||
+ package_prefix = android_package_prefix
|
||||
}
|
||||
|
||||
generate_jni("generated_video_jni") {
|
||||
@@ -1493,11 +1496,13 @@ if (current_os == "linux" || is_android) {
|
||||
"src/java/org/webrtc/WrappedNativeI420Buffer.java",
|
||||
]
|
||||
namespace = "webrtc::jni"
|
||||
+ package_prefix = android_package_prefix
|
||||
}
|
||||
|
||||
generate_jni("generated_video_egl_jni") {
|
||||
sources = [ "src/java/org/webrtc/EglBase10Impl.java" ]
|
||||
namespace = "webrtc::jni"
|
||||
+ package_prefix = android_package_prefix
|
||||
}
|
||||
|
||||
generate_jni("generated_libvpx_vp8_jni") {
|
||||
@@ -1507,6 +1512,7 @@ if (current_os == "linux" || is_android) {
|
||||
]
|
||||
|
||||
namespace = "webrtc::jni"
|
||||
+ package_prefix = android_package_prefix
|
||||
}
|
||||
|
||||
generate_jni("generated_libvpx_vp9_jni") {
|
||||
@@ -1516,18 +1522,21 @@ if (current_os == "linux" || is_android) {
|
||||
]
|
||||
|
||||
namespace = "webrtc::jni"
|
||||
+ package_prefix = android_package_prefix
|
||||
}
|
||||
|
||||
generate_jni("generated_libaom_av1_encoder_jni") {
|
||||
sources = [ "api/org/webrtc/LibaomAv1Encoder.java" ]
|
||||
|
||||
namespace = "webrtc::jni"
|
||||
+ package_prefix = android_package_prefix
|
||||
}
|
||||
|
||||
generate_jni("generated_dav1d_jni") {
|
||||
sources = [ "api/org/webrtc/Dav1dDecoder.java" ]
|
||||
|
||||
namespace = "webrtc::jni"
|
||||
+ package_prefix = android_package_prefix
|
||||
}
|
||||
|
||||
generate_jni("generated_swcodecs_jni") {
|
||||
@@ -1537,11 +1546,13 @@ if (current_os == "linux" || is_android) {
|
||||
]
|
||||
|
||||
namespace = "webrtc::jni"
|
||||
+ package_prefix = android_package_prefix
|
||||
}
|
||||
|
||||
generate_jni("generated_rtcerror_jni") {
|
||||
sources = [ "src/java/org/webrtc/RtcError.java" ]
|
||||
namespace = "webrtc::jni"
|
||||
+ package_prefix = android_package_prefix
|
||||
}
|
||||
|
||||
generate_jni("generated_peerconnection_jni") {
|
||||
@@ -1585,11 +1596,13 @@ if (current_os == "linux" || is_android) {
|
||||
"api/org/webrtc/TurnCustomizer.java",
|
||||
]
|
||||
namespace = "webrtc::jni"
|
||||
+ package_prefix = android_package_prefix
|
||||
}
|
||||
|
||||
generate_jni("generated_java_audio_jni") {
|
||||
sources = [ "api/org/webrtc/audio/JavaAudioDeviceModule.java" ]
|
||||
namespace = "webrtc::jni"
|
||||
+ package_prefix = android_package_prefix
|
||||
}
|
||||
|
||||
generate_jni("generated_builtin_audio_codecs_jni") {
|
||||
@@ -1598,6 +1611,7 @@ if (current_os == "linux" || is_android) {
|
||||
"api/org/webrtc/BuiltinAudioEncoderFactoryFactory.java",
|
||||
]
|
||||
namespace = "webrtc::jni"
|
||||
+ package_prefix = android_package_prefix
|
||||
}
|
||||
|
||||
# Generated JNI for native API targets
|
||||
@@ -1609,17 +1623,20 @@ if (current_os == "linux" || is_android) {
|
||||
"src/java/org/webrtc/WebRtcClassLoader.java",
|
||||
]
|
||||
namespace = "webrtc::jni"
|
||||
+ package_prefix = android_package_prefix
|
||||
}
|
||||
|
||||
# Generated JNI for internal targets.
|
||||
|
||||
generate_jni("generated_logging_jni") {
|
||||
sources = [ "src/java/org/webrtc/JNILogging.java" ]
|
||||
+ package_prefix = android_package_prefix
|
||||
}
|
||||
|
||||
generate_jni("generated_audio_device_module_base_jni") {
|
||||
sources = [ "src/java/org/webrtc/audio/WebRtcAudioManager.java" ]
|
||||
namespace = "webrtc::jni"
|
||||
+ package_prefix = android_package_prefix
|
||||
}
|
||||
|
||||
generate_jni("generated_java_audio_device_module_native_jni") {
|
||||
@@ -1628,6 +1645,7 @@ if (current_os == "linux" || is_android) {
|
||||
"src/java/org/webrtc/audio/WebRtcAudioTrack.java",
|
||||
]
|
||||
namespace = "webrtc::jni"
|
||||
+ package_prefix = android_package_prefix
|
||||
}
|
||||
}
|
||||
|
||||
diff --git a/sdk/android/api/org/webrtc/PeerConnectionFactory.java b/sdk/android/api/org/webrtc/PeerConnectionFactory.java
|
||||
index 01679ad12b..7b8545902d 100644
|
||||
--- a/sdk/android/api/org/webrtc/PeerConnectionFactory.java
|
||||
+++ b/sdk/android/api/org/webrtc/PeerConnectionFactory.java
|
||||
@@ -88,7 +88,7 @@ public class PeerConnectionFactory {
|
||||
private String fieldTrials = "";
|
||||
private boolean enableInternalTracer;
|
||||
private NativeLibraryLoader nativeLibraryLoader = new NativeLibrary.DefaultLoader();
|
||||
- private String nativeLibraryName = "jingle_peerconnection_so";
|
||||
+ private String nativeLibraryName = "lkjingle_peerconnection_so";
|
||||
@Nullable private Loggable loggable;
|
||||
@Nullable private Severity loggableSeverity;
|
||||
|
||||
diff --git a/sdk/android/src/jni/jni_helpers.h b/sdk/android/src/jni/jni_helpers.h
|
||||
index d86c8fa4ad..30f307a2ca 100644
|
||||
--- a/sdk/android/src/jni/jni_helpers.h
|
||||
+++ b/sdk/android/src/jni/jni_helpers.h
|
||||
@@ -29,10 +29,10 @@
|
||||
// boundary. crbug.com/655248
|
||||
#define JNI_FUNCTION_DECLARATION(rettype, name, ...) \
|
||||
__attribute__((force_align_arg_pointer)) extern "C" JNIEXPORT rettype \
|
||||
- JNICALL Java_org_webrtc_##name(__VA_ARGS__)
|
||||
+ JNICALL Java_livekit_org_webrtc_##name(__VA_ARGS__)
|
||||
#else
|
||||
#define JNI_FUNCTION_DECLARATION(rettype, name, ...) \
|
||||
- extern "C" JNIEXPORT rettype JNICALL Java_org_webrtc_##name(__VA_ARGS__)
|
||||
+ extern "C" JNIEXPORT rettype JNICALL Java_livekit_org_webrtc_##name(__VA_ARGS__)
|
||||
#endif
|
||||
|
||||
namespace webrtc {
|
||||
diff --git a/sdk/android/src/jni/simulcast_video_encoder.cc b/sdk/android/src/jni/simulcast_video_encoder.cc
|
||||
index 6d4ba5b3b6..48d3cb3541 100644
|
||||
--- a/sdk/android/src/jni/simulcast_video_encoder.cc
|
||||
+++ b/sdk/android/src/jni/simulcast_video_encoder.cc
|
||||
@@ -15,7 +15,14 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
// (VideoEncoderFactory primary, VideoEncoderFactory fallback, VideoCodecInfo info)
|
||||
-JNIEXPORT jlong JNICALL Java_org_webrtc_SimulcastVideoEncoder_nativeCreateEncoder(JNIEnv *env, jclass klass, jlong webrtcEnvRef, jobject primary, jobject fallback, jobject info) {
|
||||
+JNI_FUNCTION_DECLARATION(jlong,
|
||||
+ SimulcastVideoEncoder_nativeCreateEncoder,
|
||||
+ JNIEnv *env,
|
||||
+ jclass klass,
|
||||
+ jlong webrtcEnvRef,
|
||||
+ jobject primary,
|
||||
+ jobject fallback,
|
||||
+ jobject info) {
|
||||
RTC_LOG(LS_INFO) << "Create simulcast video encoder";
|
||||
auto info_ref = JavaParamRef<jobject>::CreateLeaky(env, info);
|
||||
SdpVideoFormat format = VideoCodecInfoToSdpVideoFormat(env, info_ref);
|
||||
diff --git a/tools_webrtc/android/build_aar.py b/tools_webrtc/android/build_aar.py
|
||||
index 2fbce97c60..130b3d5fa7 100755
|
||||
--- a/tools_webrtc/android/build_aar.py
|
||||
+++ b/tools_webrtc/android/build_aar.py
|
||||
@@ -254,7 +254,7 @@ def BuildAar(build_dir,
|
||||
Collect(aar_file, build_dir, arch, unstripped)
|
||||
|
||||
license_dir = os.path.dirname(os.path.realpath(output_file))
|
||||
- GenerateLicenses(license_dir, build_dir, archs)
|
||||
+ #GenerateLicenses(license_dir, build_dir, archs)
|
||||
|
||||
|
||||
def main():
|
||||
diff --git a/webrtc.gni b/webrtc.gni
|
||||
index 468ba33b01..ca81ce298c 100644
|
||||
--- a/webrtc.gni
|
||||
+++ b/webrtc.gni
|
||||
@@ -241,6 +241,10 @@ declare_args() {
|
||||
# hasn't been registered.
|
||||
rtc_strict_field_trials = ""
|
||||
|
||||
+ if (is_android) {
|
||||
+ android_package_prefix = "livekit"
|
||||
+ }
|
||||
+
|
||||
# If different from "", symbols exported with RTC_OBJC_EXPORT will be prefixed
|
||||
# with this string.
|
||||
# See the definition of RTC_OBJC_TYPE_PREFIX in the code.
|
||||
diff --git a/third_party/jni_zero/BUILD.gn b/third_party/jni_zero/BUILD.gn
|
||||
index 7056bdd033c1..2b97de476de7 100644
|
||||
--- a/third_party/jni_zero/BUILD.gn
|
||||
+++ b/third_party/jni_zero/BUILD.gn
|
||||
@@ -17,6 +17,7 @@ generate_jni("generate_jni") {
|
||||
":*",
|
||||
"//components/cronet/android/*",
|
||||
]
|
||||
+ package_prefix = "livekit"
|
||||
}
|
||||
|
||||
generate_jar_jni("system_jni") {
|
||||
diff --git a/third_party/jni_zero/codegen/header_common.py b/third_party/jni_zero/codegen/header_common.py
|
||||
index 338cd748079f..be2577281a91 100644
|
||||
--- a/third_party/jni_zero/codegen/header_common.py
|
||||
+++ b/third_party/jni_zero/codegen/header_common.py
|
||||
@@ -12,7 +12,8 @@ def class_accessors(sb, java_classes, module_name):
|
||||
for java_class in java_classes:
|
||||
if java_class in (java_types.OBJECT_CLASS, java_types.STRING_CLASS):
|
||||
continue
|
||||
- escaped_name = java_class.to_cpp()
|
||||
+ escaped_name = java_class.class_without_prefix.to_cpp()
|
||||
+ print("header accessor: ", escaped_name)
|
||||
# #ifdef needed when multple .h files are #included that common classes.
|
||||
sb(f"""\
|
||||
#ifndef {escaped_name}_clazz_defined
|
||||
@@ -44,7 +45,7 @@ def class_accessor_expression(java_class):
|
||||
if java_class == java_types.STRING_CLASS:
|
||||
return 'jni_zero::g_string_class'
|
||||
|
||||
- return f'{java_class.to_cpp()}_clazz(env)'
|
||||
+ return f'{java_class.class_without_prefix.to_cpp()}_clazz(env)'
|
||||
|
||||
|
||||
def header_preamble(script_name,
|
||||
@@ -53,7 +54,7 @@ def header_preamble(script_name,
|
||||
user_includes=None,
|
||||
header_guard=None):
|
||||
if header_guard is None:
|
||||
- header_guard = f'{java_class.to_cpp()}_JNI'
|
||||
+ header_guard = f'{java_class.class_without_prefix.to_cpp()}_JNI'
|
||||
sb = []
|
||||
sb.append(f"""\
|
||||
// This file was generated by
|
||||
diff --git a/third_party/jni_zero/jni_zero.gni b/third_party/jni_zero/jni_zero.gni
|
||||
index 71826b906d10..22d8eaf6e232 100644
|
||||
--- a/third_party/jni_zero/jni_zero.gni
|
||||
+++ b/third_party/jni_zero/jni_zero.gni
|
||||
@@ -123,7 +123,7 @@ template("_invoke_jni_zero") {
|
||||
# namespace: Registration functions will be wrapped into this. (optional)
|
||||
# priority_java_targets: List of java targets that, if using multiplexing,
|
||||
# will always be placed first in the sequential switch numbers. (optional)
|
||||
-#
|
||||
+# package_prefix: package prefix to add to jni
|
||||
# Example
|
||||
# generate_jni_registration("chrome_jni_registration") {
|
||||
# java_targets = [ ":chrome_public_apk" ]
|
||||
@@ -327,6 +327,7 @@ template("generate_jni_impl") {
|
||||
"deps",
|
||||
"metadata",
|
||||
"public_deps",
|
||||
+ "package_prefix",
|
||||
])
|
||||
if (!defined(public_deps)) {
|
||||
public_deps = []
|
||||
@@ -421,7 +422,9 @@ template("generate_jni_impl") {
|
||||
if (defined(invoker.split_name)) {
|
||||
args += [ "--split-name=${invoker.split_name}" ]
|
||||
}
|
||||
-
|
||||
+ if (defined(package_prefix)) {
|
||||
+ args += [ "--package-prefix=${package_prefix}" ]
|
||||
+ }
|
||||
foreach(_name, _input_names) {
|
||||
_name =
|
||||
string_replace(get_path_info(_name, "name"), "\$", "__") + "_jni.h"
|
||||
+62
@@ -0,0 +1,62 @@
|
||||
diff --git a/rtc_base/boringssl_certificate.cc b/rtc_base/boringssl_certificate.cc
|
||||
index a4f919fbbe..fe3beeaed9 100644
|
||||
--- a/rtc_base/boringssl_certificate.cc
|
||||
+++ b/rtc_base/boringssl_certificate.cc
|
||||
@@ -252,6 +252,12 @@ BoringSSLCertificate::BoringSSLCertificate(
|
||||
RTC_DCHECK(cert_buffer_ != nullptr);
|
||||
}
|
||||
|
||||
+BoringSSLCertificate::BoringSSLCertificate(
|
||||
+ bssl::UniquePtr<CRYPTO_BUFFER> cert_buffer, SSL* ssl)
|
||||
+ : cert_buffer_(std::move(cert_buffer)), ssl_(ssl) {
|
||||
+ RTC_DCHECK(cert_buffer_ != nullptr);
|
||||
+}
|
||||
+
|
||||
std::unique_ptr<BoringSSLCertificate> BoringSSLCertificate::Generate(
|
||||
OpenSSLKeyPair* key_pair,
|
||||
const SSLIdentityParams& params) {
|
||||
diff --git a/rtc_base/boringssl_certificate.h b/rtc_base/boringssl_certificate.h
|
||||
index b5a18d0843..53759fd064 100644
|
||||
--- a/rtc_base/boringssl_certificate.h
|
||||
+++ b/rtc_base/boringssl_certificate.h
|
||||
@@ -34,6 +34,7 @@ namespace webrtc {
|
||||
class BoringSSLCertificate final : public SSLCertificate {
|
||||
public:
|
||||
explicit BoringSSLCertificate(bssl::UniquePtr<CRYPTO_BUFFER> cert_buffer);
|
||||
+ BoringSSLCertificate(bssl::UniquePtr<CRYPTO_BUFFER> cert_buffer, SSL* ssl);
|
||||
|
||||
static std::unique_ptr<BoringSSLCertificate> Generate(
|
||||
OpenSSLKeyPair* key_pair,
|
||||
@@ -66,6 +67,10 @@ class BoringSSLCertificate final : public SSLCertificate {
|
||||
private:
|
||||
// A handle to the DER encoded certificate data.
|
||||
bssl::UniquePtr<CRYPTO_BUFFER> cert_buffer_;
|
||||
+ SSL* ssl_ = nullptr;
|
||||
+
|
||||
+ public:
|
||||
+ SSL* ssl() const { return ssl_; }
|
||||
};
|
||||
|
||||
} // namespace webrtc
|
||||
diff --git a/rtc_base/openssl_adapter.cc b/rtc_base/openssl_adapter.cc
|
||||
index b80e665d78..1f3dd28795 100644
|
||||
--- a/rtc_base/openssl_adapter.cc
|
||||
+++ b/rtc_base/openssl_adapter.cc
|
||||
@@ -846,7 +846,7 @@ enum ssl_verify_result_t OpenSSLAdapter::SSLVerifyInternal(SSL* ssl,
|
||||
std::vector<std::unique_ptr<SSLCertificate>> certs;
|
||||
for (size_t i = 0; i < sk_CRYPTO_BUFFER_num(chain); ++i) {
|
||||
certs.emplace_back(new BoringSSLCertificate(
|
||||
- bssl::UpRef(sk_CRYPTO_BUFFER_value(chain, i))));
|
||||
+ bssl::UpRef(sk_CRYPTO_BUFFER_value(chain, i)), ssl));
|
||||
}
|
||||
|
||||
SSLCertChain cert_chain(std::move(certs));
|
||||
@@ -932,7 +932,7 @@ int OpenSSLAdapter::SSLVerifyInternal(int previous_status,
|
||||
RTC_LOG(LS_ERROR) << "Failed to allocate CRYPTO_BUFFER.";
|
||||
return previous_status;
|
||||
}
|
||||
- certs.emplace_back(new BoringSSLCertificate(std::move(crypto_buffer)));
|
||||
+ certs.emplace_back(new BoringSSLCertificate(std::move(crypto_buffer), ssl));
|
||||
#else
|
||||
certs.emplace_back(new OpenSSLCertificate(x509_cert));
|
||||
#endif
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
|
||||
index 8048ec5e8..4e00f7e53 100644
|
||||
--- a/build/config/compiler/BUILD.gn
|
||||
+++ b/build/config/compiler/BUILD.gn
|
||||
@@ -1424,6 +1424,9 @@ config("default_warnings") {
|
||||
# gethostbyname. Fires mostly in non-Chromium code. We probably
|
||||
# want to remove this define eventually.
|
||||
"_WINSOCK_DEPRECATED_NO_WARNINGS",
|
||||
+
|
||||
+ "_SILENCE_ALL_CXX17_DEPRECATION_WARNINGS",
|
||||
+ "_SILENCE_ALL_CXX20_DEPRECATION_WARNINGS",
|
||||
]
|
||||
if (!is_clang) {
|
||||
# TODO(thakis): Remove this once
|
||||
Reference in New Issue
Block a user