diff --git a/api/audio/echo_canceller3_config_json.h b/api/audio/echo_canceller3_config_json.h index b315bf07f5..3c8b97589f 100644 --- a/api/audio/echo_canceller3_config_json.h +++ b/api/audio/echo_canceller3_config_json.h @@ -15,13 +15,15 @@ #include "absl/strings/string_view.h" #include "api/audio/echo_canceller3_config.h" +#include "rtc_base/system/rtc_export.h" namespace webrtc { // Parses a JSON-encoded string into an Aec3 config. Fields corresponds to // substruct names, with the addition that there must be a top-level node // "aec3". Returns default config values for anything that cannot be parsed from // the string. -EchoCanceller3Config Aec3ConfigFromJsonString(absl::string_view json_string); +RTC_EXPORT EchoCanceller3Config +Aec3ConfigFromJsonString(absl::string_view json_string); // Encodes an Aec3 config in JSON format. Fields corresponds to substruct names, // with the addition that the top-level node is named "aec3". diff --git a/api/audio_codecs/isac/BUILD.gn b/api/audio_codecs/isac/BUILD.gn index e1bed07e7d..9025360f2f 100644 --- a/api/audio_codecs/isac/BUILD.gn +++ b/api/audio_codecs/isac/BUILD.gn @@ -114,6 +114,7 @@ rtc_static_library("audio_encoder_isac_float") { "../../..:webrtc_common", "../../../modules/audio_coding:isac", "../../../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/isac/audio_encoder_isac_float.h b/api/audio_codecs/isac/audio_encoder_isac_float.h index 5df2dd3d6f..81b5c2e2c7 100644 --- a/api/audio_codecs/isac/audio_encoder_isac_float.h +++ b/api/audio_codecs/isac/audio_encoder_isac_float.h @@ -18,6 +18,7 @@ #include "api/audio_codecs/audio_codec_pair_id.h" #include "api/audio_codecs/audio_encoder.h" #include "api/audio_codecs/audio_format.h" +#include "rtc_base/system/rtc_export.h" namespace webrtc { @@ -25,7 +26,7 @@ namespace webrtc { // parameter to CreateAudioEncoderFactory<...>(). // // NOTE: This struct is still under development and may change without notice. -struct AudioEncoderIsacFloat { +struct RTC_EXPORT AudioEncoderIsacFloat { struct Config { bool IsOk() const { switch (sample_rate_hz) { diff --git a/api/peerconnectioninterface.h b/api/peerconnectioninterface.h index 141b2c9272..8775cf0de3 100644 --- a/api/peerconnectioninterface.h +++ b/api/peerconnectioninterface.h @@ -113,6 +113,7 @@ #include "rtc_base/socketaddress.h" #include "rtc_base/sslcertificate.h" #include "rtc_base/sslstreamadapter.h" +#include "rtc_base/system/rtc_export.h" namespace rtc { class SSLIdentity; @@ -1376,7 +1377,8 @@ rtc::scoped_refptr CreatePeerConnectionFactory( // be created and used. // If |network_controller_factory| is provided, it will be used if enabled via // field trial. -rtc::scoped_refptr CreatePeerConnectionFactory( +RTC_EXPORT rtc::scoped_refptr +CreatePeerConnectionFactory( rtc::Thread* network_thread, rtc::Thread* worker_thread, rtc::Thread* signaling_thread, diff --git a/api/stats/rtcstats.h b/api/stats/rtcstats.h index 1705f6ab58..f65df289e1 100644 --- a/api/stats/rtcstats.h +++ b/api/stats/rtcstats.h @@ -18,6 +18,7 @@ #include #include "rtc_base/checks.h" +#include "rtc_base/system/rtc_export.h" namespace webrtc { @@ -47,7 +48,7 @@ class RTCStatsMemberInterface; // for (const RTCStatsMemberInterface* member : foo.Members()) { // printf("%s = %s\n", member->name(), member->ValueToString().c_str()); // } -class RTCStats { +class RTC_EXPORT RTCStats { public: RTCStats(const std::string& id, int64_t timestamp_us) : id_(id), timestamp_us_(timestamp_us) {} @@ -247,7 +248,7 @@ class RTCStatsMemberInterface { // (undefined reference to |kType|). The supported types are the ones described // by |RTCStatsMemberInterface::Type|. template -class RTCStatsMember : public RTCStatsMemberInterface { +class RTC_EXPORT RTCStatsMember : public RTCStatsMemberInterface { public: static const Type kType; diff --git a/api/stats/rtcstats_objects.h b/api/stats/rtcstats_objects.h index f377809ba3..dc9da72ec9 100644 --- a/api/stats/rtcstats_objects.h +++ b/api/stats/rtcstats_objects.h @@ -16,6 +16,7 @@ #include #include "api/stats/rtcstats.h" +#include "rtc_base/system/rtc_export.h" namespace webrtc { @@ -73,7 +74,7 @@ struct RTCNetworkType { }; // https://w3c.github.io/webrtc-stats/#certificatestats-dict* -class RTCCertificateStats final : public RTCStats { +class RTC_EXPORT RTCCertificateStats final : public RTCStats { public: WEBRTC_RTCSTATS_DECL(); @@ -89,7 +90,7 @@ class RTCCertificateStats final : public RTCStats { }; // https://w3c.github.io/webrtc-stats/#codec-dict* -class RTCCodecStats final : public RTCStats { +class RTC_EXPORT RTCCodecStats final : public RTCStats { public: WEBRTC_RTCSTATS_DECL(); @@ -110,7 +111,7 @@ class RTCCodecStats final : public RTCStats { }; // https://w3c.github.io/webrtc-stats/#dcstats-dict* -class RTCDataChannelStats final : public RTCStats { +class RTC_EXPORT RTCDataChannelStats final : public RTCStats { public: WEBRTC_RTCSTATS_DECL(); @@ -132,7 +133,7 @@ class RTCDataChannelStats final : public RTCStats { // https://w3c.github.io/webrtc-stats/#candidatepair-dict* // TODO(hbos): Tracking bug https://bugs.webrtc.org/7062 -class RTCIceCandidatePairStats final : public RTCStats { +class RTC_EXPORT RTCIceCandidatePairStats final : public RTCStats { public: WEBRTC_RTCSTATS_DECL(); @@ -186,7 +187,7 @@ class RTCIceCandidatePairStats final : public RTCStats { // crbug.com/632723 // TODO(qingsi): Add the stats of STUN binding requests (keepalives) and collect // them in the new PeerConnection::GetStats. -class RTCIceCandidateStats : public RTCStats { +class RTC_EXPORT RTCIceCandidateStats : public RTCStats { public: WEBRTC_RTCSTATS_DECL(); @@ -221,7 +222,7 @@ class RTCIceCandidateStats : public RTCStats { // |kType| need to be different ("RTCStatsType type") in the local/remote case. // https://w3c.github.io/webrtc-stats/#rtcstatstype-str* // This forces us to have to override copy() and type(). -class RTCLocalIceCandidateStats final : public RTCIceCandidateStats { +class RTC_EXPORT RTCLocalIceCandidateStats final : public RTCIceCandidateStats { public: static const char kType[]; RTCLocalIceCandidateStats(const std::string& id, int64_t timestamp_us); @@ -230,7 +231,8 @@ class RTCLocalIceCandidateStats final : public RTCIceCandidateStats { const char* type() const override; }; -class RTCRemoteIceCandidateStats final : public RTCIceCandidateStats { +class RTC_EXPORT RTCRemoteIceCandidateStats final + : public RTCIceCandidateStats { public: static const char kType[]; RTCRemoteIceCandidateStats(const std::string& id, int64_t timestamp_us); @@ -241,7 +243,7 @@ class RTCRemoteIceCandidateStats final : public RTCIceCandidateStats { // https://w3c.github.io/webrtc-stats/#msstats-dict* // TODO(hbos): Tracking bug crbug.com/660827 -class RTCMediaStreamStats final : public RTCStats { +class RTC_EXPORT RTCMediaStreamStats final : public RTCStats { public: WEBRTC_RTCSTATS_DECL(); @@ -256,7 +258,7 @@ class RTCMediaStreamStats final : public RTCStats { // https://w3c.github.io/webrtc-stats/#mststats-dict* // TODO(hbos): Tracking bug crbug.com/659137 -class RTCMediaStreamTrackStats final : public RTCStats { +class RTC_EXPORT RTCMediaStreamTrackStats final : public RTCStats { public: WEBRTC_RTCSTATS_DECL(); @@ -309,7 +311,7 @@ class RTCMediaStreamTrackStats final : public RTCStats { }; // https://w3c.github.io/webrtc-stats/#pcstats-dict* -class RTCPeerConnectionStats final : public RTCStats { +class RTC_EXPORT RTCPeerConnectionStats final : public RTCStats { public: WEBRTC_RTCSTATS_DECL(); @@ -324,7 +326,7 @@ class RTCPeerConnectionStats final : public RTCStats { // https://w3c.github.io/webrtc-stats/#streamstats-dict* // TODO(hbos): Tracking bug crbug.com/657854 -class RTCRTPStreamStats : public RTCStats { +class RTC_EXPORT RTCRTPStreamStats : public RTCStats { public: WEBRTC_RTCSTATS_DECL(); @@ -362,7 +364,7 @@ class RTCRTPStreamStats : public RTCStats { // https://w3c.github.io/webrtc-stats/#inboundrtpstats-dict* // TODO(hbos): Support the remote case |is_remote = true|. // https://bugs.webrtc.org/7065 -class RTCInboundRTPStreamStats final : public RTCRTPStreamStats { +class RTC_EXPORT RTCInboundRTPStreamStats final : public RTCRTPStreamStats { public: WEBRTC_RTCSTATS_DECL(); @@ -406,7 +408,7 @@ class RTCInboundRTPStreamStats final : public RTCRTPStreamStats { // https://w3c.github.io/webrtc-stats/#outboundrtpstats-dict* // TODO(hbos): Support the remote case |is_remote = true|. // https://bugs.webrtc.org/7066 -class RTCOutboundRTPStreamStats final : public RTCRTPStreamStats { +class RTC_EXPORT RTCOutboundRTPStreamStats final : public RTCRTPStreamStats { public: WEBRTC_RTCSTATS_DECL(); @@ -423,7 +425,7 @@ class RTCOutboundRTPStreamStats final : public RTCRTPStreamStats { }; // https://w3c.github.io/webrtc-stats/#transportstats-dict* -class RTCTransportStats final : public RTCStats { +class RTC_EXPORT RTCTransportStats final : public RTCStats { public: WEBRTC_RTCSTATS_DECL(); diff --git a/api/video_codecs/BUILD.gn b/api/video_codecs/BUILD.gn index 152caaf5db..6bf1a04d64 100644 --- a/api/video_codecs/BUILD.gn +++ b/api/video_codecs/BUILD.gn @@ -35,6 +35,7 @@ rtc_source_set("video_codecs_api") { "../..:webrtc_common", "../../rtc_base:checks", "../../rtc_base:rtc_base_approved", + "../../rtc_base/system:rtc_export", "../video:encoded_image", "../video:video_bitrate_allocation", "../video:video_frame", diff --git a/api/video_codecs/video_codec.h b/api/video_codecs/video_codec.h index 5b4ebb25c0..c5758a4dbb 100644 --- a/api/video_codecs/video_codec.h +++ b/api/video_codecs/video_codec.h @@ -14,6 +14,7 @@ #include #include "common_types.h" // NOLINT(build/include) +#include "rtc_base/system/rtc_export.h" namespace webrtc { @@ -98,7 +99,7 @@ union VideoCodecUnion { enum class VideoCodecMode { kRealtimeVideo, kScreensharing }; // Common video codec properties -class VideoCodec { +class RTC_EXPORT VideoCodec { public: VideoCodec(); diff --git a/api/video_codecs/video_decoder.h b/api/video_codecs/video_decoder.h index 569e3cf326..83763e2bb3 100644 --- a/api/video_codecs/video_decoder.h +++ b/api/video_codecs/video_decoder.h @@ -18,6 +18,7 @@ #include "api/video/encoded_image.h" #include "api/video/video_frame.h" #include "api/video_codecs/video_codec.h" +#include "rtc_base/system/rtc_export.h" namespace webrtc { @@ -47,7 +48,7 @@ class DecodedImageCallback { virtual int32_t ReceivedDecodedFrame(const uint64_t pictureId); }; -class VideoDecoder { +class RTC_EXPORT VideoDecoder { public: virtual ~VideoDecoder() {} diff --git a/api/video_codecs/video_encoder.h b/api/video_codecs/video_encoder.h index 4a4a8b6ad9..8f7d619a7b 100644 --- a/api/video_codecs/video_encoder.h +++ b/api/video_codecs/video_encoder.h @@ -21,6 +21,7 @@ #include "api/video/video_frame.h" #include "api/video_codecs/video_codec.h" #include "rtc_base/checks.h" +#include "rtc_base/system/rtc_export.h" namespace webrtc { @@ -73,7 +74,7 @@ class EncodedImageCallback { virtual void OnDroppedFrame(DropReason reason) {} }; -class VideoEncoder { +class RTC_EXPORT VideoEncoder { public: struct QpThresholds { QpThresholds(int l, int h) : low(l), high(h) {} diff --git a/media/BUILD.gn b/media/BUILD.gn index 5b40e86a73..be3fd3756d 100644 --- a/media/BUILD.gn +++ b/media/BUILD.gn @@ -42,6 +42,7 @@ rtc_source_set("rtc_h264_profile_id") { "..:webrtc_common", "../rtc_base:rtc_base", "../rtc_base:rtc_base_approved", + "../rtc_base/system:rtc_export", "//third_party/abseil-cpp/absl/types:optional", ] } @@ -218,6 +219,7 @@ rtc_static_library("rtc_internal_video_codecs") { "../rtc_base:checks", "../rtc_base:rtc_base_approved", "../rtc_base:sequenced_task_checker", + "../rtc_base/system:rtc_export", "../system_wrappers", "//third_party/abseil-cpp/absl/types:optional", "//third_party/libyuv", @@ -239,6 +241,7 @@ rtc_static_library("rtc_audio_video") { "../modules/video_coding:video_coding_utility", "../rtc_base:audio_format_to_string", "../rtc_base:checks", + "../rtc_base/system:rtc_export", "../rtc_base/third_party/base64", "../system_wrappers:field_trial", "../system_wrappers:metrics", diff --git a/media/base/h264_profile_level_id.h b/media/base/h264_profile_level_id.h index b4ff88369c..e4ea5146d3 100644 --- a/media/base/h264_profile_level_id.h +++ b/media/base/h264_profile_level_id.h @@ -16,6 +16,7 @@ #include "absl/types/optional.h" #include "common_types.h" // NOLINT(build/include) +#include "rtc_base/system/rtc_export.h" namespace webrtc { namespace H264 { @@ -68,7 +69,8 @@ absl::optional ParseSdpProfileLevelId( // given number of frames per second, return the highest H.264 level where it // can guarantee that it will be able to support all valid encoded streams that // are within that level. -absl::optional SupportedLevel(int max_frame_pixel_count, float max_fps); +RTC_EXPORT absl::optional SupportedLevel(int max_frame_pixel_count, + float max_fps); // Returns canonical string representation as three hex bytes of the profile // level id, or returns nothing for invalid profile level ids. diff --git a/media/engine/convert_legacy_video_factory.h b/media/engine/convert_legacy_video_factory.h index 5bd3580a6f..27383ab386 100644 --- a/media/engine/convert_legacy_video_factory.h +++ b/media/engine/convert_legacy_video_factory.h @@ -13,6 +13,8 @@ #include +#include "rtc_base/system/rtc_export.h" + namespace webrtc { class VideoEncoderFactory; class VideoDecoderFactory; @@ -27,10 +29,12 @@ class WebRtcVideoDecoderFactory; // new type of codec factories. The purpose of these functions is to provide an // easy way for clients to migrate to the API with new factory types. // TODO(magjed): Remove once old factories are gone, webrtc:7925. -std::unique_ptr ConvertVideoEncoderFactory( +RTC_EXPORT std::unique_ptr +ConvertVideoEncoderFactory( std::unique_ptr external_encoder_factory); -std::unique_ptr ConvertVideoDecoderFactory( +RTC_EXPORT std::unique_ptr +ConvertVideoDecoderFactory( std::unique_ptr external_decoder_factory); } // namespace cricket diff --git a/media/engine/multiplexcodecfactory.h b/media/engine/multiplexcodecfactory.h index 7a851c8c1e..ae099a4ef3 100644 --- a/media/engine/multiplexcodecfactory.h +++ b/media/engine/multiplexcodecfactory.h @@ -16,6 +16,7 @@ #include "api/video_codecs/video_decoder_factory.h" #include "api/video_codecs/video_encoder_factory.h" +#include "rtc_base/system/rtc_export.h" namespace webrtc { // Multiplex codec is a completely modular/optional codec that allows users to @@ -36,7 +37,7 @@ namespace webrtc { // and decoder instance(s) using these factories. // - Use Multiplex*coderFactory classes in CreatePeerConnectionFactory() calls. // - Select "multiplex" codec in SDP negotiation. -class MultiplexEncoderFactory : public VideoEncoderFactory { +class RTC_EXPORT MultiplexEncoderFactory : public VideoEncoderFactory { public: // |supports_augmenting_data| defines if the encoder would support augmenting // data. If set, the encoder expects to receive video frame buffers of type @@ -54,7 +55,7 @@ class MultiplexEncoderFactory : public VideoEncoderFactory { const bool supports_augmenting_data_; }; -class MultiplexDecoderFactory : public VideoDecoderFactory { +class RTC_EXPORT MultiplexDecoderFactory : public VideoDecoderFactory { public: // |supports_augmenting_data| defines if the decoder would support augmenting // data. If set, the decoder is expected to output video frame buffers of type diff --git a/media/engine/webrtcvideodecoderfactory.h b/media/engine/webrtcvideodecoderfactory.h index 016cb09da0..b81ac3447f 100644 --- a/media/engine/webrtcvideodecoderfactory.h +++ b/media/engine/webrtcvideodecoderfactory.h @@ -16,6 +16,7 @@ #include "common_types.h" // NOLINT(build/include) #include "media/base/codec.h" #include "rtc_base/refcount.h" +#include "rtc_base/system/rtc_export.h" namespace webrtc { class VideoDecoder; @@ -29,7 +30,7 @@ struct VideoDecoderParams { // Deprecated. Use webrtc::VideoDecoderFactory instead. // https://bugs.chromium.org/p/webrtc/issues/detail?id=7925 -class WebRtcVideoDecoderFactory { +class RTC_EXPORT WebRtcVideoDecoderFactory { public: // Caller takes the ownership of the returned object and it should be released // by calling DestroyVideoDecoder(). diff --git a/modules/BUILD.gn b/modules/BUILD.gn index 1df9865d45..ef029914b3 100644 --- a/modules/BUILD.gn +++ b/modules/BUILD.gn @@ -54,6 +54,7 @@ rtc_source_set("module_api") { "../api:libjingle_peerconnection_api", "../modules/rtp_rtcp:rtp_video_header", "../rtc_base:safe_conversions", + "../rtc_base/system:rtc_export", ] } diff --git a/modules/include/module_common_types.h b/modules/include/module_common_types.h index 98ff767311..e058cc84e6 100644 --- a/modules/include/module_common_types.h +++ b/modules/include/module_common_types.h @@ -19,6 +19,7 @@ #include "modules/include/module_common_types_public.h" #include "modules/include/module_fec_types.h" #include "modules/rtp_rtcp/source/rtp_video_header.h" +#include "rtc_base/system/rtc_export.h" namespace webrtc { @@ -33,7 +34,7 @@ struct WebRtcRTPHeader { int64_t ntp_time_ms; }; -class RTPFragmentationHeader { +class RTC_EXPORT RTPFragmentationHeader { public: RTPFragmentationHeader(); RTPFragmentationHeader(const RTPFragmentationHeader&) = delete; diff --git a/modules/video_coding/BUILD.gn b/modules/video_coding/BUILD.gn index afa677dd28..6ff9bc4e30 100644 --- a/modules/video_coding/BUILD.gn +++ b/modules/video_coding/BUILD.gn @@ -303,6 +303,7 @@ rtc_static_library("webrtc_h264") { "../../media:rtc_media_base", "../../rtc_base:checks", "../../rtc_base:rtc_base", + "../../rtc_base/system:rtc_export", "../../system_wrappers:metrics", "//third_party/abseil-cpp/absl/memory", "//third_party/libyuv", diff --git a/modules/video_coding/codecs/h264/include/h264.h b/modules/video_coding/codecs/h264/include/h264.h index e23818b756..f5cebcfe62 100644 --- a/modules/video_coding/codecs/h264/include/h264.h +++ b/modules/video_coding/codecs/h264/include/h264.h @@ -17,6 +17,7 @@ #include "media/base/codec.h" #include "modules/video_coding/include/video_codec_interface.h" +#include "rtc_base/system/rtc_export.h" namespace webrtc { @@ -26,13 +27,13 @@ struct SdpVideoFormat; // |rtc_use_h264| build flag is true (if false, this function does nothing). // This function should only be called before or during WebRTC initialization // and is not thread-safe. -void DisableRtcUseH264(); +RTC_EXPORT void DisableRtcUseH264(); // Returns a vector with all supported internal H264 profiles that we can // negotiate in SDP, in order of preference. std::vector SupportedH264Codecs(); -class H264Encoder : public VideoEncoder { +class RTC_EXPORT H264Encoder : public VideoEncoder { public: static std::unique_ptr Create(const cricket::VideoCodec& codec); // If H.264 is supported (any implementation). @@ -41,7 +42,7 @@ class H264Encoder : public VideoEncoder { ~H264Encoder() override {} }; -class H264Decoder : public VideoDecoder { +class RTC_EXPORT H264Decoder : public VideoDecoder { public: static std::unique_ptr Create(); static bool IsSupported();