mirror of
https://github.com/mii443/libdatachannel.git
synced 2025-08-22 23:25:33 +00:00
Start exporting c++ API for windows.
This commit is contained in:
@ -25,7 +25,7 @@
|
||||
|
||||
namespace rtc {
|
||||
|
||||
class Candidate {
|
||||
class RTC_CPP_EXPORT Candidate {
|
||||
public:
|
||||
enum class Family { Unresolved, Ipv4, Ipv6 };
|
||||
enum class Type { Unknown, Host, ServerReflexive, PeerReflexive, Relayed };
|
||||
|
@ -28,7 +28,7 @@
|
||||
|
||||
namespace rtc {
|
||||
|
||||
class Channel {
|
||||
class RTC_CPP_EXPORT Channel {
|
||||
public:
|
||||
Channel() = default;
|
||||
virtual ~Channel() = default;
|
||||
|
@ -26,7 +26,7 @@
|
||||
|
||||
namespace rtc {
|
||||
|
||||
struct IceServer {
|
||||
struct RTC_CPP_EXPORT IceServer {
|
||||
enum class Type { Stun, Turn };
|
||||
enum class RelayType { TurnUdp, TurnTcp, TurnTls };
|
||||
|
||||
|
@ -36,7 +36,7 @@ namespace rtc {
|
||||
class SctpTransport;
|
||||
class PeerConnection;
|
||||
|
||||
class DataChannel : public std::enable_shared_from_this<DataChannel>, public Channel {
|
||||
class RTC_CPP_EXPORT DataChannel : public std::enable_shared_from_this<DataChannel>, public Channel {
|
||||
public:
|
||||
DataChannel(std::weak_ptr<PeerConnection> pc, uint16_t stream, string label, string protocol,
|
||||
Reliability reliability);
|
||||
|
@ -32,7 +32,7 @@
|
||||
|
||||
namespace rtc {
|
||||
|
||||
class Description {
|
||||
class RTC_CPP_EXPORT Description {
|
||||
public:
|
||||
enum class Type { Unspec, Offer, Answer, Pranswer, Rollback };
|
||||
enum class Role { ActPass, Passive, Active };
|
||||
|
@ -28,9 +28,12 @@
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
#define RTC_CPP_EXPORT __declspec(dllexport)
|
||||
#ifndef _WIN32_WINNT
|
||||
#define _WIN32_WINNT 0x0602 // Windows 8
|
||||
#endif
|
||||
#else
|
||||
#define RTC_CPP_EXPORT
|
||||
#endif
|
||||
|
||||
#include "log.hpp"
|
||||
|
@ -35,6 +35,12 @@
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
#define RTC_CPP_EXPORT __declspec(dllexport)
|
||||
#else
|
||||
#define RTC_CPP_EXPORT
|
||||
#endif
|
||||
|
||||
namespace rtc {
|
||||
|
||||
enum class LogLevel { // Don't change, it must match plog severity
|
||||
@ -47,8 +53,8 @@ enum class LogLevel { // Don't change, it must match plog severity
|
||||
Verbose = 6
|
||||
};
|
||||
|
||||
void InitLogger(LogLevel level);
|
||||
void InitLogger(plog::Severity severity, plog::IAppender *appender = nullptr);
|
||||
RTC_CPP_EXPORT void InitLogger(LogLevel level);
|
||||
RTC_CPP_EXPORT void InitLogger(plog::Severity severity, plog::IAppender *appender = nullptr);
|
||||
} // namespace rtc
|
||||
|
||||
#endif
|
||||
|
@ -57,7 +57,7 @@ struct DataChannelInit {
|
||||
string protocol = "";
|
||||
};
|
||||
|
||||
class PeerConnection final : public std::enable_shared_from_this<PeerConnection> {
|
||||
class RTC_CPP_EXPORT PeerConnection final : public std::enable_shared_from_this<PeerConnection> {
|
||||
public:
|
||||
enum class State : int {
|
||||
New = RTC_NEW,
|
||||
@ -203,8 +203,8 @@ private:
|
||||
|
||||
} // namespace rtc
|
||||
|
||||
std::ostream &operator<<(std::ostream &out, rtc::PeerConnection::State state);
|
||||
std::ostream &operator<<(std::ostream &out, rtc::PeerConnection::GatheringState state);
|
||||
std::ostream &operator<<(std::ostream &out, rtc::PeerConnection::SignalingState state);
|
||||
RTC_CPP_EXPORT std::ostream &operator<<(std::ostream &out, rtc::PeerConnection::State state);
|
||||
RTC_CPP_EXPORT std::ostream &operator<<(std::ostream &out, rtc::PeerConnection::GatheringState state);
|
||||
RTC_CPP_EXPORT std::ostream &operator<<(std::ostream &out, rtc::PeerConnection::SignalingState state);
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user