Files
client-sdk-rust/webrtc-sys/include/livekit/webrtc.h
T
2023-02-12 20:19:01 +01:00

60 lines
1.5 KiB
C++

/*
* Copyright 2023 LiveKit
*
* 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
*
* http://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.
*/
#pragma once
#include "rtc_base/physical_socket_server.h"
#include "rtc_base/ssl_adapter.h"
#ifdef WEBRTC_WIN
#include "rtc_base/win32_socket_init.h"
#endif
namespace livekit {
class RTCRuntime;
}
#include "webrtc-sys/src/webrtc.rs.h"
namespace livekit {
class RTCRuntime {
public:
RTCRuntime();
~RTCRuntime();
RTCRuntime(const RTCRuntime&) = delete;
RTCRuntime& operator=(const RTCRuntime&) = delete;
rtc::Thread* network_thread() const;
rtc::Thread* worker_thread() const;
rtc::Thread* signaling_thread() const;
private:
std::unique_ptr<rtc::Thread> network_thread_;
std::unique_ptr<rtc::Thread> worker_thread_;
std::unique_ptr<rtc::Thread> signaling_thread_;
#ifdef WEBRTC_WIN
rtc::WinsockInitializer winsock_;
rtc::PhysicalSocketServer ss_;
rtc::AutoSocketServerThread main_thread_{&ss_};
#endif
};
std::shared_ptr<RTCRuntime> create_rtc_runtime();
} // namespace livekit