diff --git a/api/BUILD.gn b/api/BUILD.gn index ac3e3087b6..babc260160 100644 --- a/api/BUILD.gn +++ b/api/BUILD.gn @@ -128,6 +128,7 @@ rtc_static_library("libjingle_peerconnection_api") { "../rtc_base:rtc_base", "../rtc_base:rtc_base_approved", "../rtc_base:stringutils", + "../rtc_base/system:rtc_export", ] if (is_nacl) { @@ -250,6 +251,7 @@ rtc_source_set("rtc_stats_api") { deps = [ "../rtc_base:checks", "../rtc_base:rtc_base_approved", + "../rtc_base/system:rtc_export", ] } diff --git a/api/audio_codecs/L16/BUILD.gn b/api/audio_codecs/L16/BUILD.gn index e3620678dc..a7d56d0c72 100644 --- a/api/audio_codecs/L16/BUILD.gn +++ b/api/audio_codecs/L16/BUILD.gn @@ -43,6 +43,7 @@ rtc_static_library("audio_decoder_L16") { "../../..:webrtc_common", "../../../modules/audio_coding:pcm16b", "../../../rtc_base:rtc_base_approved", + "../../../rtc_base/system:rtc_export", "//third_party/abseil-cpp/absl/memory", "//third_party/abseil-cpp/absl/types:optional", ] diff --git a/api/audio_codecs/L16/audio_decoder_L16.h b/api/audio_codecs/L16/audio_decoder_L16.h index 184ec24ed9..b38627dcc3 100644 --- a/api/audio_codecs/L16/audio_decoder_L16.h +++ b/api/audio_codecs/L16/audio_decoder_L16.h @@ -18,6 +18,7 @@ #include "api/audio_codecs/audio_codec_pair_id.h" #include "api/audio_codecs/audio_decoder.h" #include "api/audio_codecs/audio_format.h" +#include "rtc_base/system/rtc_export.h" namespace webrtc { @@ -25,7 +26,7 @@ namespace webrtc { // CreateAudioDecoderFactory<...>(). // // NOTE: This struct is still under development and may change without notice. -struct AudioDecoderL16 { +struct RTC_EXPORT AudioDecoderL16 { struct Config { bool IsOk() const { return (sample_rate_hz == 8000 || sample_rate_hz == 16000 || diff --git a/api/audio_codecs/g711/BUILD.gn b/api/audio_codecs/g711/BUILD.gn index 860ba3de18..ebd0b3299f 100644 --- a/api/audio_codecs/g711/BUILD.gn +++ b/api/audio_codecs/g711/BUILD.gn @@ -43,6 +43,7 @@ rtc_static_library("audio_decoder_g711") { "../../..:webrtc_common", "../../../modules/audio_coding:g711", "../../../rtc_base:rtc_base_approved", + "../../../rtc_base/system:rtc_export", "//third_party/abseil-cpp/absl/memory", "//third_party/abseil-cpp/absl/types:optional", ] diff --git a/api/audio_codecs/g711/audio_decoder_g711.h b/api/audio_codecs/g711/audio_decoder_g711.h index 8275a8c7a1..0c67e5e3ef 100644 --- a/api/audio_codecs/g711/audio_decoder_g711.h +++ b/api/audio_codecs/g711/audio_decoder_g711.h @@ -18,6 +18,7 @@ #include "api/audio_codecs/audio_codec_pair_id.h" #include "api/audio_codecs/audio_decoder.h" #include "api/audio_codecs/audio_format.h" +#include "rtc_base/system/rtc_export.h" namespace webrtc { @@ -25,7 +26,7 @@ namespace webrtc { // CreateAudioDecoderFactory<...>(). // // NOTE: This struct is still under development and may change without notice. -struct AudioDecoderG711 { +struct RTC_EXPORT AudioDecoderG711 { struct Config { enum class Type { kPcmU, kPcmA }; bool IsOk() const { diff --git a/api/audio_codecs/g722/BUILD.gn b/api/audio_codecs/g722/BUILD.gn index d69596b1d0..101c7a994d 100644 --- a/api/audio_codecs/g722/BUILD.gn +++ b/api/audio_codecs/g722/BUILD.gn @@ -51,6 +51,7 @@ rtc_static_library("audio_decoder_g722") { "../../..:webrtc_common", "../../../modules/audio_coding:g722", "../../../rtc_base:rtc_base_approved", + "../../../rtc_base/system:rtc_export", "//third_party/abseil-cpp/absl/memory", "//third_party/abseil-cpp/absl/types:optional", ] diff --git a/api/audio_codecs/g722/audio_decoder_g722.h b/api/audio_codecs/g722/audio_decoder_g722.h index b7bb0893f3..7601b3cf1a 100644 --- a/api/audio_codecs/g722/audio_decoder_g722.h +++ b/api/audio_codecs/g722/audio_decoder_g722.h @@ -18,6 +18,7 @@ #include "api/audio_codecs/audio_codec_pair_id.h" #include "api/audio_codecs/audio_decoder.h" #include "api/audio_codecs/audio_format.h" +#include "rtc_base/system/rtc_export.h" namespace webrtc { @@ -25,7 +26,7 @@ namespace webrtc { // CreateAudioDecoderFactory<...>(). // // NOTE: This struct is still under development and may change without notice. -struct AudioDecoderG722 { +struct RTC_EXPORT AudioDecoderG722 { struct Config { bool IsOk() const { return num_channels == 1 || num_channels == 2; } int num_channels; diff --git a/api/audio_codecs/opus/BUILD.gn b/api/audio_codecs/opus/BUILD.gn index 9c9bf33c8c..af3cd7fc44 100644 --- a/api/audio_codecs/opus/BUILD.gn +++ b/api/audio_codecs/opus/BUILD.gn @@ -20,6 +20,7 @@ rtc_static_library("audio_encoder_opus_config") { ] deps = [ "../../../rtc_base:rtc_base_approved", + "../../../rtc_base/system:rtc_export", "//third_party/abseil-cpp/absl/types:optional", ] defines = [] diff --git a/api/audio_codecs/opus/audio_encoder_opus_config.h b/api/audio_codecs/opus/audio_encoder_opus_config.h index c7067bb1c3..98a6ef5cbc 100644 --- a/api/audio_codecs/opus/audio_encoder_opus_config.h +++ b/api/audio_codecs/opus/audio_encoder_opus_config.h @@ -16,11 +16,12 @@ #include #include "absl/types/optional.h" +#include "rtc_base/system/rtc_export.h" namespace webrtc { // NOTE: This struct is still under development and may change without notice. -struct AudioEncoderOpusConfig { +struct RTC_EXPORT AudioEncoderOpusConfig { static constexpr int kDefaultFrameSizeMs = 20; // Opus API allows a min bitrate of 500bps, but Opus documentation suggests diff --git a/api/candidate.h b/api/candidate.h index 0a8459153b..4c650d9bdb 100644 --- a/api/candidate.h +++ b/api/candidate.h @@ -20,13 +20,14 @@ #include "rtc_base/checks.h" #include "rtc_base/network_constants.h" #include "rtc_base/socketaddress.h" +#include "rtc_base/system/rtc_export.h" namespace cricket { // Candidate for ICE based connection discovery. // TODO(phoglund): remove things in here that are not needed in the public API. -class Candidate { +class RTC_EXPORT Candidate { public: Candidate(); // TODO(pthatcher): Match the ordering and param list as per RFC 5245 diff --git a/api/jsep.h b/api/jsep.h index 4d4bcc0bfb..03ce6d7e6a 100644 --- a/api/jsep.h +++ b/api/jsep.h @@ -29,6 +29,7 @@ #include "absl/types/optional.h" #include "api/rtcerror.h" #include "rtc_base/refcount.h" +#include "rtc_base/system/rtc_export.h" namespace cricket { class Candidate; @@ -73,13 +74,13 @@ class IceCandidateInterface { // Creates a IceCandidateInterface based on SDP string. // Returns null if the sdp string can't be parsed. // |error| may be null. -IceCandidateInterface* CreateIceCandidate(const std::string& sdp_mid, - int sdp_mline_index, - const std::string& sdp, - SdpParseError* error); +RTC_EXPORT IceCandidateInterface* CreateIceCandidate(const std::string& sdp_mid, + int sdp_mline_index, + const std::string& sdp, + SdpParseError* error); // Creates an IceCandidateInterface based on a parsed candidate structure. -std::unique_ptr CreateIceCandidate( +RTC_EXPORT std::unique_ptr CreateIceCandidate( const std::string& sdp_mid, int sdp_mline_index, const cricket::Candidate& candidate); @@ -121,7 +122,7 @@ absl::optional SdpTypeFromString(const std::string& type_str); // and is therefore not expected to be thread safe. // // An instance can be created by CreateSessionDescription. -class SessionDescriptionInterface { +class RTC_EXPORT SessionDescriptionInterface { public: // String representations of the supported SDP types. static const char kOffer[]; @@ -181,21 +182,21 @@ class SessionDescriptionInterface { // |error| may be null. // TODO(steveanton): This function is deprecated. Please use the functions below // which take an SdpType enum instead. Remove this once it is no longer used. -SessionDescriptionInterface* CreateSessionDescription(const std::string& type, - const std::string& sdp, - SdpParseError* error); +RTC_EXPORT SessionDescriptionInterface* CreateSessionDescription( + const std::string& type, + const std::string& sdp, + SdpParseError* error); // Creates a SessionDescriptionInterface based on the SDP string and the type. // Returns null if the SDP string cannot be parsed. // If using the signature with |error_out|, details of the parsing error may be // written to |error_out| if it is not null. -std::unique_ptr CreateSessionDescription( - SdpType type, - const std::string& sdp); -std::unique_ptr CreateSessionDescription( - SdpType type, - const std::string& sdp, - SdpParseError* error_out); +RTC_EXPORT std::unique_ptr +CreateSessionDescription(SdpType type, const std::string& sdp); +RTC_EXPORT std::unique_ptr +CreateSessionDescription(SdpType type, + const std::string& sdp, + SdpParseError* error_out); // Creates a SessionDescriptionInterface based on a parsed SDP structure and the // given type, ID and version. diff --git a/api/stats/rtcstatsreport.h b/api/stats/rtcstatsreport.h index f7410b39f7..8bf1cb57d9 100644 --- a/api/stats/rtcstatsreport.h +++ b/api/stats/rtcstatsreport.h @@ -20,12 +20,13 @@ #include "rtc_base/refcount.h" #include "rtc_base/refcountedobject.h" #include "rtc_base/scoped_ref_ptr.h" +#include "rtc_base/system/rtc_export.h" namespace webrtc { // A collection of stats. // This is accessible as a map from |RTCStats::id| to |RTCStats|. -class RTCStatsReport : public rtc::RefCountInterface { +class RTC_EXPORT RTCStatsReport : public rtc::RefCountInterface { public: typedef std::map> StatsMap; diff --git a/p2p/BUILD.gn b/p2p/BUILD.gn index f1466d706e..389f31bbdb 100644 --- a/p2p/BUILD.gn +++ b/p2p/BUILD.gn @@ -95,6 +95,7 @@ rtc_static_library("rtc_p2p") { "../rtc_base:safe_minmax", "../rtc_base:stringutils", "../rtc_base:weak_ptr", + "../rtc_base/system:rtc_export", "../rtc_base/third_party/base64", "../rtc_base/third_party/sigslot", "../system_wrappers:field_trial", diff --git a/p2p/base/packetsocketfactory.h b/p2p/base/packetsocketfactory.h index 4667bb1fd7..c903df06c8 100644 --- a/p2p/base/packetsocketfactory.h +++ b/p2p/base/packetsocketfactory.h @@ -17,6 +17,7 @@ #include "rtc_base/constructormagic.h" #include "rtc_base/proxyinfo.h" #include "rtc_base/sslcertificate.h" +#include "rtc_base/system/rtc_export.h" namespace rtc { @@ -36,7 +37,7 @@ struct PacketSocketTcpOptions { class AsyncPacketSocket; class AsyncResolverInterface; -class PacketSocketFactory { +class RTC_EXPORT PacketSocketFactory { public: enum Options { OPT_STUN = 0x04, diff --git a/p2p/base/portallocator.h b/p2p/base/portallocator.h index 988447c156..7026f2b2b6 100644 --- a/p2p/base/portallocator.h +++ b/p2p/base/portallocator.h @@ -21,6 +21,7 @@ #include "rtc_base/helpers.h" #include "rtc_base/proxyinfo.h" #include "rtc_base/sslcertificate.h" +#include "rtc_base/system/rtc_export.h" #include "rtc_base/third_party/sigslot/sigslot.h" #include "rtc_base/thread.h" #include "rtc_base/thread_checker.h" @@ -146,7 +147,7 @@ struct RelayCredentials { typedef std::vector PortList; // TODO(deadbeef): Rename to TurnServerConfig. -struct RelayServerConfig { +struct RTC_EXPORT RelayServerConfig { explicit RelayServerConfig(RelayType type); RelayServerConfig(const rtc::SocketAddress& address, const std::string& username, @@ -183,7 +184,7 @@ struct RelayServerConfig { rtc::SSLCertificateVerifier* tls_cert_verifier = nullptr; }; -class PortAllocatorSession : public sigslot::has_slots<> { +class RTC_EXPORT PortAllocatorSession : public sigslot::has_slots<> { public: // Content name passed in mostly for logging and debugging. PortAllocatorSession(const std::string& content_name, @@ -330,7 +331,7 @@ class PortAllocatorSession : public sigslot::has_slots<> { // // This allows a PortAllocator subclass to be constructed and configured on one // thread, and passed into an object that uses it on a different thread. -class PortAllocator : public sigslot::has_slots<> { +class RTC_EXPORT PortAllocator : public sigslot::has_slots<> { public: PortAllocator(); ~PortAllocator() override; diff --git a/p2p/client/basicportallocator.h b/p2p/client/basicportallocator.h index 8b951cae9e..fd47bbbf1b 100644 --- a/p2p/client/basicportallocator.h +++ b/p2p/client/basicportallocator.h @@ -22,11 +22,12 @@ #include "rtc_base/checks.h" #include "rtc_base/messagequeue.h" #include "rtc_base/network.h" +#include "rtc_base/system/rtc_export.h" #include "rtc_base/thread.h" namespace cricket { -class BasicPortAllocator : public PortAllocator { +class RTC_EXPORT BasicPortAllocator : public PortAllocator { public: // note: The (optional) relay_port_factory is owned by caller // and must have a life time that exceeds that of BasicPortAllocator. @@ -110,8 +111,8 @@ enum class SessionState { // process will be started. }; -class BasicPortAllocatorSession : public PortAllocatorSession, - public rtc::MessageHandler { +class RTC_EXPORT BasicPortAllocatorSession : public PortAllocatorSession, + public rtc::MessageHandler { public: BasicPortAllocatorSession(BasicPortAllocator* allocator, const std::string& content_name, @@ -274,7 +275,7 @@ class BasicPortAllocatorSession : public PortAllocatorSession, // Records configuration information useful in creating ports. // TODO(deadbeef): Rename "relay" to "turn_server" in this struct. -struct PortConfiguration : public rtc::MessageData { +struct RTC_EXPORT PortConfiguration : public rtc::MessageData { // TODO(jiayl): remove |stun_address| when Chrome is updated. rtc::SocketAddress stun_address; ServerAddresses stun_servers; diff --git a/pc/BUILD.gn b/pc/BUILD.gn index 37bd5049b3..c9d3fa4010 100644 --- a/pc/BUILD.gn +++ b/pc/BUILD.gn @@ -203,6 +203,7 @@ rtc_static_library("peerconnection") { "../rtc_base:rtc_base_approved", "../rtc_base:stringutils", "../rtc_base/experiments:congestion_controller_experiment", + "../rtc_base/system:rtc_export", "../rtc_base/third_party/base64", "../rtc_base/third_party/sigslot", "../stats", diff --git a/pc/videotracksource.h b/pc/videotracksource.h index 50488dd2c6..cedb75b3c8 100644 --- a/pc/videotracksource.h +++ b/pc/videotracksource.h @@ -15,13 +15,14 @@ #include "api/notifier.h" #include "api/video/video_sink_interface.h" #include "media/base/mediachannel.h" +#include "rtc_base/system/rtc_export.h" #include "rtc_base/thread_checker.h" namespace webrtc { // VideoTrackSource is a convenience base class for implementations of // VideoTrackSourceInterface. -class VideoTrackSource : public Notifier { +class RTC_EXPORT VideoTrackSource : public Notifier { public: explicit VideoTrackSource(bool remote); void SetState(SourceState new_state);