Start exporting c++ API for windows.

This commit is contained in:
Hanseul Jun
2020-11-17 22:20:54 -08:00
parent 90eb610bfe
commit 12098e7c41
8 changed files with 20 additions and 11 deletions

View File

@ -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 };

View File

@ -28,7 +28,7 @@
namespace rtc {
class Channel {
class RTC_CPP_EXPORT Channel {
public:
Channel() = default;
virtual ~Channel() = default;

View File

@ -26,7 +26,7 @@
namespace rtc {
struct IceServer {
struct RTC_CPP_EXPORT IceServer {
enum class Type { Stun, Turn };
enum class RelayType { TurnUdp, TurnTcp, TurnTls };

View File

@ -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);

View File

@ -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 };

View File

@ -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"

View File

@ -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

View File

@ -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