Windows + Initial WebRTC sys & Safe WebRTC + Initial livekit-core

This commit is contained in:
Théo Monnom
2022-09-12 12:51:54 +02:00
parent 7b09d6dd51
commit d9fd69b5c0
128 changed files with 4282 additions and 2282 deletions
-37
View File
@@ -1,37 +0,0 @@
/*
* Copyright 2015 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#include <jni.h>
#include "rtc_base/logging.h"
#include "rtc_base/ssl_adapter.h"
#include "sdk/android/native_api/jni/class_loader.h"
#include "sdk/android/src/jni/jni_helpers.h"
namespace webrtc {
namespace jni {
extern "C" jint JNIEXPORT JNICALL JNI_OnLoad(JavaVM* jvm, void* reserved) {
jint ret = InitGlobalJniVariables(jvm);
if (ret < 0)
return -1;
RTC_CHECK(rtc::InitializeSSL()) << "Failed to InitializeSSL()";
webrtc::InitClassLoader(GetEnv());
return ret;
}
extern "C" void JNIEXPORT JNICALL JNI_OnUnLoad(JavaVM* jvm, void* reserved) {
RTC_CHECK(rtc::CleanupSSL()) << "Failed to CleanupSSL()";
}
} // namespace jni
} // namespace webrtc
-15
View File
@@ -1,16 +1 @@
#[cxx::bridge(namespace = "lk")]
mod ffi {
unsafe extern "C++" {
include!("peer_connection_factory.h");
type PeerConnectionFactory;
fn CreatePeerConnectionFactory() -> UniquePtr<PeerConnectionFactory>;
}
}
#[no_mangle]
extern "C" fn test_rust() {
println!("Called test_rust");
let _factory = ffi::CreatePeerConnectionFactory();
}
-12
View File
@@ -1,12 +0,0 @@
#import "sdk/objc/base/RTCVideoCapturer.h"
#import "sdk/objc/components/capturer/RTCCameraVideoCapturer.h"
void LKPrintDevices() {
NSArray<AVCaptureDevice*>* devices = [RTCCameraVideoCapturer captureDevices];
[devices enumerateObjectsUsingBlock:^(AVCaptureDevice* device, NSUInteger i,
BOOL* stop) {
NSLog(@"%@", device.localizedName);
NSLog(@"%@", device.uniqueID);
NSLog(@"%@", device.modelID);
}];
}
-42
View File
@@ -1,42 +0,0 @@
//
// Created by Théo Monnom on 03/08/2022.
//
#include "peer_connection_factory.h"
#include <iostream>
#include "objc_test.h"
namespace lk{
PeerConnectionFactory::PeerConnectionFactory(){
rtc::LogMessage::LogToDebug(rtc::LS_INFO);
RTC_LOG(LS_INFO) << "PeerConnectionFactory::PeerConnectionFactory()";
network_thread_ = rtc::Thread::CreateWithSocketServer();
network_thread_->Start();
worker_thread_ = rtc::Thread::Create();
worker_thread_->Start();
signaling_thread_ = rtc::Thread::Create();
signaling_thread_->Start();
webrtc::PeerConnectionFactoryDependencies dependencies;
dependencies.network_thread = network_thread_.get();
dependencies.worker_thread = worker_thread_.get();
dependencies.signaling_thread = signaling_thread_.get();
peer_factory_ = webrtc::CreateModularPeerConnectionFactory(std::move(dependencies));
if (peer_factory_.get() == nullptr) {
RTC_LOG_ERR(LS_ERROR) << "Failed to create PeerConnectionFactory";
return;
}
// TODO(theomonnom) Close resources
}
std::unique_ptr<PeerConnectionFactory> CreatePeerConnectionFactory() {
LKPrintDevices(); // Just a tess
return std::make_unique<PeerConnectionFactory>();
}
} // namespace lk