Add missing RTC_EXPORT for the component build.

Bug: webrtc:9419
Change-Id: I3225259fb4cc55e9820f590928795f4587f1e3cb
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/153884
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29479}
diff --git a/api/BUILD.gn b/api/BUILD.gn
index 4eed48c..a472b3d 100644
--- a/api/BUILD.gn
+++ b/api/BUILD.gn
@@ -33,6 +33,9 @@
   sources = [
     "call/call_factory_interface.h",
   ]
+  deps = [
+    "../rtc_base/system:rtc_export",
+  ]
 }
 
 if (!build_with_chromium) {
diff --git a/api/call/call_factory_interface.h b/api/call/call_factory_interface.h
index c3d5b41..6051409 100644
--- a/api/call/call_factory_interface.h
+++ b/api/call/call_factory_interface.h
@@ -13,6 +13,8 @@
 
 #include <memory>
 
+#include "rtc_base/system/rtc_export.h"
+
 namespace webrtc {
 
 // These classes are not part of the API, and are treated as opaque pointers.
@@ -29,7 +31,7 @@
   virtual Call* CreateCall(const CallConfig& config) = 0;
 };
 
-std::unique_ptr<CallFactoryInterface> CreateCallFactory();
+RTC_EXPORT std::unique_ptr<CallFactoryInterface> CreateCallFactory();
 
 }  // namespace webrtc
 
diff --git a/api/crypto/BUILD.gn b/api/crypto/BUILD.gn
index a9bd479..685dccd 100644
--- a/api/crypto/BUILD.gn
+++ b/api/crypto/BUILD.gn
@@ -24,6 +24,7 @@
   ]
   deps = [
     "../../rtc_base:rtc_base",
+    "../../rtc_base/system:rtc_export",
   ]
 }
 
diff --git a/api/crypto/crypto_options.h b/api/crypto/crypto_options.h
index f0b91d0..91a585a 100644
--- a/api/crypto/crypto_options.h
+++ b/api/crypto/crypto_options.h
@@ -13,12 +13,14 @@
 
 #include <vector>
 
+#include "rtc_base/system/rtc_export.h"
+
 namespace webrtc {
 
 // CryptoOptions defines advanced cryptographic settings for native WebRTC.
 // These settings must be passed into PeerConnectionFactoryInterface::Options
 // and are only applicable to native use cases of WebRTC.
-struct CryptoOptions {
+struct RTC_EXPORT CryptoOptions {
   CryptoOptions();
   CryptoOptions(const CryptoOptions& other);
   ~CryptoOptions();
diff --git a/api/data_channel_interface.h b/api/data_channel_interface.h
index fc47dbb..ccf3ad7 100644
--- a/api/data_channel_interface.h
+++ b/api/data_channel_interface.h
@@ -23,6 +23,7 @@
 #include "rtc_base/checks.h"
 #include "rtc_base/copy_on_write_buffer.h"
 #include "rtc_base/ref_count.h"
+#include "rtc_base/system/rtc_export.h"
 
 namespace webrtc {
 
@@ -96,7 +97,7 @@
   virtual ~DataChannelObserver() = default;
 };
 
-class DataChannelInterface : public rtc::RefCountInterface {
+class RTC_EXPORT DataChannelInterface : public rtc::RefCountInterface {
  public:
   // C++ version of: https://www.w3.org/TR/webrtc/#idl-def-rtcdatachannelstate
   // Unlikely to change, but keep in sync with DataChannel.java:State and
diff --git a/api/dtls_transport_interface.h b/api/dtls_transport_interface.h
index 1170e0f..8fd8cd1 100644
--- a/api/dtls_transport_interface.h
+++ b/api/dtls_transport_interface.h
@@ -20,6 +20,7 @@
 #include "api/scoped_refptr.h"
 #include "rtc_base/ref_count.h"
 #include "rtc_base/ssl_certificate.h"
+#include "rtc_base/system/rtc_export.h"
 
 namespace webrtc {
 
@@ -37,7 +38,7 @@
 
 // This object gives snapshot information about the changeable state of a
 // DTLSTransport.
-class DtlsTransportInformation {
+class RTC_EXPORT DtlsTransportInformation {
  public:
   DtlsTransportInformation();
   explicit DtlsTransportInformation(DtlsTransportState state);
diff --git a/api/jsep.h b/api/jsep.h
index 3f7f12a..7b4934a 100644
--- a/api/jsep.h
+++ b/api/jsep.h
@@ -52,7 +52,7 @@
 // a time and is therefore not expected to be thread safe.
 //
 // An instance can be created by CreateIceCandidate.
-class IceCandidateInterface {
+class RTC_EXPORT IceCandidateInterface {
  public:
   virtual ~IceCandidateInterface() {}
   // If present, this is the value of the "a=mid" attribute of the candidate's
diff --git a/api/media_stream_interface.h b/api/media_stream_interface.h
index 6150350..5fb73c9 100644
--- a/api/media_stream_interface.h
+++ b/api/media_stream_interface.h
@@ -145,8 +145,9 @@
 // PeerConnectionFactory::CreateVideoTrack can be used for creating a VideoTrack
 // that ensures thread safety and that all methods are called on the right
 // thread.
-class VideoTrackInterface : public MediaStreamTrackInterface,
-                            public rtc::VideoSourceInterface<VideoFrame> {
+class RTC_EXPORT VideoTrackInterface
+    : public MediaStreamTrackInterface,
+      public rtc::VideoSourceInterface<VideoFrame> {
  public:
   // Video track content hint, used to override the source is_screencast
   // property.
@@ -235,7 +236,7 @@
   ~AudioProcessorInterface() override = default;
 };
 
-class AudioTrackInterface : public MediaStreamTrackInterface {
+class RTC_EXPORT AudioTrackInterface : public MediaStreamTrackInterface {
  public:
   // TODO(deadbeef): Figure out if the following interface should be const or
   // not.
diff --git a/api/peer_connection_interface.h b/api/peer_connection_interface.h
index 12c5162..2b7da83 100644
--- a/api/peer_connection_interface.h
+++ b/api/peer_connection_interface.h
@@ -1253,7 +1253,7 @@
 // All new dependencies should be added as a unique_ptr to allow the
 // PeerConnection object to be the definitive owner of the dependencies
 // lifetime making injection safer.
-struct PeerConnectionDependencies final {
+struct RTC_EXPORT PeerConnectionDependencies final {
   explicit PeerConnectionDependencies(PeerConnectionObserver* observer_in);
   // This object is not copyable or assignable.
   PeerConnectionDependencies(const PeerConnectionDependencies&) = delete;
@@ -1284,7 +1284,7 @@
 // clear which are mandatory and optional. If possible please allow the peer
 // connection factory to take ownership of the dependency by adding a unique_ptr
 // to this structure.
-struct PeerConnectionFactoryDependencies final {
+struct RTC_EXPORT PeerConnectionFactoryDependencies final {
   PeerConnectionFactoryDependencies();
   // This object is not copyable or assignable.
   PeerConnectionFactoryDependencies(const PeerConnectionFactoryDependencies&) =
@@ -1457,7 +1457,7 @@
 // will create the necessary thread internally. If |signaling_thread| is null,
 // the PeerConnectionFactory will use the thread on which this method is called
 // as the signaling thread, wrapping it in an rtc::Thread object if needed.
-rtc::scoped_refptr<PeerConnectionFactoryInterface>
+RTC_EXPORT rtc::scoped_refptr<PeerConnectionFactoryInterface>
 CreateModularPeerConnectionFactory(
     PeerConnectionFactoryDependencies dependencies);
 
diff --git a/api/proxy.h b/api/proxy.h
index 6627aac..3e76ee7 100644
--- a/api/proxy.h
+++ b/api/proxy.h
@@ -61,6 +61,7 @@
 #include "rtc_base/message_handler.h"
 #include "rtc_base/message_queue.h"
 #include "rtc_base/ref_counted_object.h"
+#include "rtc_base/system/rtc_export.h"
 #include "rtc_base/thread.h"
 
 namespace rtc {
@@ -140,8 +141,8 @@
 
 namespace internal {
 
-class SynchronousMethodCall : public rtc::MessageData,
-                              public rtc::MessageHandler {
+class RTC_EXPORT SynchronousMethodCall : public rtc::MessageData,
+                                         public rtc::MessageHandler {
  public:
   explicit SynchronousMethodCall(rtc::MessageHandler* proxy);
   ~SynchronousMethodCall() override;
diff --git a/api/rtc_error.h b/api/rtc_error.h
index ffdcc0a..970507f 100644
--- a/api/rtc_error.h
+++ b/api/rtc_error.h
@@ -131,7 +131,7 @@
 //
 // Only intended to be used for logging/diagnostics. The returned char* points
 // to literal string that lives for the whole duration of the program.
-const char* ToString(RTCErrorType error);
+RTC_EXPORT const char* ToString(RTCErrorType error);
 
 #ifdef UNIT_TEST
 inline std::ostream& operator<<(  // no-presubmit-check TODO(webrtc:8982)
diff --git a/api/rtc_event_log/BUILD.gn b/api/rtc_event_log/BUILD.gn
index e420190..bd2570b 100644
--- a/api/rtc_event_log/BUILD.gn
+++ b/api/rtc_event_log/BUILD.gn
@@ -36,6 +36,7 @@
   deps = [
     ":rtc_event_log",
     "../../rtc_base:checks",
+    "../../rtc_base/system:rtc_export",
     "../task_queue",
   ]
 
diff --git a/api/rtc_event_log/rtc_event_log_factory.h b/api/rtc_event_log/rtc_event_log_factory.h
index 0efb1e5..06cc074 100644
--- a/api/rtc_event_log/rtc_event_log_factory.h
+++ b/api/rtc_event_log/rtc_event_log_factory.h
@@ -16,10 +16,11 @@
 #include "api/rtc_event_log/rtc_event_log.h"
 #include "api/rtc_event_log/rtc_event_log_factory_interface.h"
 #include "api/task_queue/task_queue_factory.h"
+#include "rtc_base/system/rtc_export.h"
 
 namespace webrtc {
 
-class RtcEventLogFactory : public RtcEventLogFactoryInterface {
+class RTC_EXPORT RtcEventLogFactory : public RtcEventLogFactoryInterface {
  public:
   explicit RtcEventLogFactory(TaskQueueFactory* task_queue_factory);
   ~RtcEventLogFactory() override {}
diff --git a/api/rtp_parameters.h b/api/rtp_parameters.h
index fe2ec80..77db960 100644
--- a/api/rtp_parameters.h
+++ b/api/rtp_parameters.h
@@ -91,7 +91,7 @@
 
 RTC_EXPORT extern const double kDefaultBitratePriority;
 
-struct RtcpFeedback {
+struct RTC_EXPORT RtcpFeedback {
   RtcpFeedbackType type = RtcpFeedbackType::CCM;
 
   // Equivalent to ORTC "parameter" field with slight differences:
@@ -116,7 +116,7 @@
 // RtpCodecCapability is to RtpCodecParameters as RtpCapabilities is to
 // RtpParameters. This represents the static capabilities of an endpoint's
 // implementation of a codec.
-struct RtpCodecCapability {
+struct RTC_EXPORT RtpCodecCapability {
   RtpCodecCapability();
   ~RtpCodecCapability();
 
@@ -230,7 +230,7 @@
 };
 
 // RTP header extension, see RFC8285.
-struct RtpExtension {
+struct RTC_EXPORT RtpExtension {
   RtpExtension();
   RtpExtension(const std::string& uri, int id);
   RtpExtension(const std::string& uri, int id, bool encrypt);
@@ -332,7 +332,7 @@
 // TODO(deadbeef): This is missing the "encrypt" flag, which is unimplemented.
 typedef RtpExtension RtpHeaderExtensionParameters;
 
-struct RtpFecParameters {
+struct RTC_EXPORT RtpFecParameters {
   // If unset, a value is chosen by the implementation.
   // Works just like RtpEncodingParameters::ssrc.
   absl::optional<uint32_t> ssrc;
@@ -352,7 +352,7 @@
   bool operator!=(const RtpFecParameters& o) const { return !(*this == o); }
 };
 
-struct RtpRtxParameters {
+struct RTC_EXPORT RtpRtxParameters {
   // If unset, a value is chosen by the implementation.
   // Works just like RtpEncodingParameters::ssrc.
   absl::optional<uint32_t> ssrc;
@@ -502,7 +502,7 @@
   }
 };
 
-struct RtpCodecParameters {
+struct RTC_EXPORT RtpCodecParameters {
   RtpCodecParameters();
   RtpCodecParameters(const RtpCodecParameters&);
   ~RtpCodecParameters();
diff --git a/api/rtp_receiver_interface.h b/api/rtp_receiver_interface.h
index ffd7497..b01e07d 100644
--- a/api/rtp_receiver_interface.h
+++ b/api/rtp_receiver_interface.h
@@ -27,6 +27,7 @@
 #include "api/transport/rtp/rtp_source.h"
 #include "rtc_base/deprecation.h"
 #include "rtc_base/ref_count.h"
+#include "rtc_base/system/rtc_export.h"
 
 namespace webrtc {
 
@@ -44,7 +45,7 @@
   virtual ~RtpReceiverObserverInterface() {}
 };
 
-class RtpReceiverInterface : public rtc::RefCountInterface {
+class RTC_EXPORT RtpReceiverInterface : public rtc::RefCountInterface {
  public:
   virtual rtc::scoped_refptr<MediaStreamTrackInterface> track() const = 0;
 
diff --git a/api/rtp_sender_interface.h b/api/rtp_sender_interface.h
index e6140db..5d6271f 100644
--- a/api/rtp_sender_interface.h
+++ b/api/rtp_sender_interface.h
@@ -27,10 +27,11 @@
 #include "api/rtp_parameters.h"
 #include "api/scoped_refptr.h"
 #include "rtc_base/ref_count.h"
+#include "rtc_base/system/rtc_export.h"
 
 namespace webrtc {
 
-class RtpSenderInterface : public rtc::RefCountInterface {
+class RTC_EXPORT RtpSenderInterface : public rtc::RefCountInterface {
  public:
   // Returns true if successful in setting the track.
   // Fails if an audio track is set on a video RtpSender, or vice-versa.
diff --git a/api/rtp_transceiver_interface.h b/api/rtp_transceiver_interface.h
index 4606632..2a60f98 100644
--- a/api/rtp_transceiver_interface.h
+++ b/api/rtp_transceiver_interface.h
@@ -65,7 +65,7 @@
 //
 // WebRTC specification for RTCRtpTransceiver, the JavaScript analog:
 // https://w3c.github.io/webrtc-pc/#dom-rtcrtptransceiver
-class RtpTransceiverInterface : public rtc::RefCountInterface {
+class RTC_EXPORT RtpTransceiverInterface : public rtc::RefCountInterface {
  public:
   // Media type of the transceiver. Any sender(s)/receiver(s) will have this
   // type as well.
diff --git a/api/stats_types.h b/api/stats_types.h
index 71bf164..e10834c 100644
--- a/api/stats_types.h
+++ b/api/stats_types.h
@@ -24,11 +24,12 @@
 #include "rtc_base/constructor_magic.h"
 #include "rtc_base/ref_count.h"
 #include "rtc_base/string_encode.h"
+#include "rtc_base/system/rtc_export.h"
 #include "rtc_base/thread_checker.h"
 
 namespace webrtc {
 
-class StatsReport {
+class RTC_EXPORT StatsReport {
  public:
   // Indicates whether a track is for sending or receiving.
   // Used in reports for audio/video tracks.
diff --git a/api/video/BUILD.gn b/api/video/BUILD.gn
index 0da9c6c..eda6d47 100644
--- a/api/video/BUILD.gn
+++ b/api/video/BUILD.gn
@@ -26,6 +26,7 @@
   deps = [
     "..:array_view",
     "../../rtc_base:rtc_base_approved",
+    "../../rtc_base/system:rtc_export",
     "//third_party/abseil-cpp/absl/types:optional",
   ]
 }
diff --git a/api/video/color_space.h b/api/video/color_space.h
index 91b4e17..a7ad86b 100644
--- a/api/video/color_space.h
+++ b/api/video/color_space.h
@@ -15,6 +15,7 @@
 
 #include "absl/types/optional.h"
 #include "api/video/hdr_metadata.h"
+#include "rtc_base/system/rtc_export.h"
 
 namespace webrtc {
 
@@ -31,7 +32,7 @@
 // E.2.1, "VUI parameters semantics", available from
 // https://www.itu.int/rec/T-REC-H.264.
 
-class ColorSpace {
+class RTC_EXPORT ColorSpace {
  public:
   enum class PrimaryID : uint8_t {
     // The indices are equal to the values specified in T-REC H.273 Table 2.
diff --git a/api/video/video_frame_buffer.h b/api/video/video_frame_buffer.h
index 3b8db14..d87a423 100644
--- a/api/video/video_frame_buffer.h
+++ b/api/video/video_frame_buffer.h
@@ -15,6 +15,7 @@
 
 #include "api/scoped_refptr.h"
 #include "rtc_base/ref_count.h"
+#include "rtc_base/system/rtc_export.h"
 
 namespace webrtc {
 
@@ -38,7 +39,7 @@
 // performance by providing an optimized path without intermediate conversions.
 // Frame metadata such as rotation and timestamp are stored in
 // webrtc::VideoFrame, and not here.
-class VideoFrameBuffer : public rtc::RefCountInterface {
+class RTC_EXPORT VideoFrameBuffer : public rtc::RefCountInterface {
  public:
   // New frame buffer types will be added conservatively when there is an
   // opportunity to optimize the path between some pair of video source and
@@ -113,7 +114,7 @@
   ~PlanarYuv8Buffer() override {}
 };
 
-class I420BufferInterface : public PlanarYuv8Buffer {
+class RTC_EXPORT I420BufferInterface : public PlanarYuv8Buffer {
  public:
   Type type() const override;
 
@@ -127,7 +128,7 @@
   ~I420BufferInterface() override {}
 };
 
-class I420ABufferInterface : public I420BufferInterface {
+class RTC_EXPORT I420ABufferInterface : public I420BufferInterface {
  public:
   Type type() const final;
   virtual const uint8_t* DataA() const = 0;