From d65d179a503932274dd935e96d437ef1b9b8ca5c Mon Sep 17 00:00:00 2001 From: Mirko Bonadei Date: Wed, 17 Oct 2018 16:50:07 +0200 Subject: [PATCH] Export symbols needed by the Chromium component build (part 4). This CL uses RTC_EXPORT (defined in rtc_base/system/rtc_export.h) to mark WebRTC symbols as visible from a shared library, this doesn't mean these symbols are part of the public API (please continue to refer to [1] for info about what is considered public WebRTC API). [1] - https://webrtc.googlesource.com/src/+/HEAD/native-api.md Bug: webrtc:9419 Change-Id: I12ef6f85ccef7dae3afe9ecff99725af13d551e2 Reviewed-on: https://webrtc-review.googlesource.com/c/106684 Commit-Queue: Mirko Bonadei Reviewed-by: Karl Wiberg Cr-Commit-Position: refs/heads/master@{#25246} --- media/base/codec.h | 10 ++++++---- media/base/h264_profile_level_id.h | 4 ++-- media/base/mediaconstants.h | 10 ++++++---- media/base/videocapturer.h | 6 ++++-- media/engine/webrtcvideoencoderfactory.h | 3 ++- p2p/BUILD.gn | 1 + p2p/stunprober/stunprober.h | 3 ++- 7 files changed, 23 insertions(+), 14 deletions(-) diff --git a/media/base/codec.h b/media/base/codec.h index db133f6e27..82885e9967 100644 --- a/media/base/codec.h +++ b/media/base/codec.h @@ -20,6 +20,7 @@ #include "api/video_codecs/sdp_video_format.h" #include "common_types.h" // NOLINT(build/include) #include "media/base/mediaconstants.h" +#include "rtc_base/system/rtc_export.h" namespace cricket { @@ -62,7 +63,7 @@ class FeedbackParams { std::vector params_; }; -struct Codec { +struct RTC_EXPORT Codec { int id; std::string name; int clockrate; @@ -142,7 +143,7 @@ struct AudioCodec : public Codec { bool operator!=(const AudioCodec& c) const { return !(*this == c); } }; -struct VideoCodec : public Codec { +struct RTC_EXPORT VideoCodec : public Codec { // Creates a codec with the given parameters. VideoCodec(int id, const std::string& name); // Creates a codec with the given name and empty id. @@ -215,8 +216,9 @@ const Codec* FindCodecById(const std::vector& codecs, int payload_type) { return nullptr; } -bool CodecNamesEq(const std::string& name1, const std::string& name2); -bool CodecNamesEq(const char* name1, const char* name2); +RTC_EXPORT bool CodecNamesEq(const std::string& name1, + const std::string& name2); +RTC_EXPORT bool CodecNamesEq(const char* name1, const char* name2); bool HasNack(const Codec& codec); bool HasRemb(const Codec& codec); bool HasRrtr(const Codec& codec); diff --git a/media/base/h264_profile_level_id.h b/media/base/h264_profile_level_id.h index e4ea5146d3..6a3e7cdb32 100644 --- a/media/base/h264_profile_level_id.h +++ b/media/base/h264_profile_level_id.h @@ -62,7 +62,7 @@ absl::optional ParseProfileLevelId(const char* str); // contained in an SDP key-value map. A default profile level id will be // returned if the profile-level-id key is missing. Nothing will be returned if // the key is present but the string is invalid. -absl::optional ParseSdpProfileLevelId( +RTC_EXPORT absl::optional ParseSdpProfileLevelId( const CodecParameterMap& params); // Given that a decoder supports up to a given frame size (in pixels) at up to a @@ -74,7 +74,7 @@ RTC_EXPORT absl::optional SupportedLevel(int max_frame_pixel_count, // Returns canonical string representation as three hex bytes of the profile // level id, or returns nothing for invalid profile level ids. -absl::optional ProfileLevelIdToString( +RTC_EXPORT absl::optional ProfileLevelIdToString( const ProfileLevelId& profile_level_id); // Generate codec parameters that will be used as answer in an SDP negotiation diff --git a/media/base/mediaconstants.h b/media/base/mediaconstants.h index 14c49baf72..c4a3406fd8 100644 --- a/media/base/mediaconstants.h +++ b/media/base/mediaconstants.h @@ -13,6 +13,8 @@ #include +#include "rtc_base/system/rtc_export.h" + // This file contains constants related to media. namespace cricket { @@ -127,12 +129,12 @@ extern const char kComfortNoiseCodecName[]; extern const char kVp8CodecName[]; extern const char kVp9CodecName[]; -extern const char kH264CodecName[]; +RTC_EXPORT extern const char kH264CodecName[]; // RFC 6184 RTP Payload Format for H.264 video -extern const char kH264FmtpProfileLevelId[]; -extern const char kH264FmtpLevelAsymmetryAllowed[]; -extern const char kH264FmtpPacketizationMode[]; +RTC_EXPORT extern const char kH264FmtpProfileLevelId[]; +RTC_EXPORT extern const char kH264FmtpLevelAsymmetryAllowed[]; +RTC_EXPORT extern const char kH264FmtpPacketizationMode[]; extern const char kH264FmtpSpropParameterSets[]; extern const char kH264ProfileLevelConstrainedBaseline[]; diff --git a/media/base/videocapturer.h b/media/base/videocapturer.h index 826e38fa5a..32742062aa 100644 --- a/media/base/videocapturer.h +++ b/media/base/videocapturer.h @@ -26,6 +26,7 @@ #include "media/base/videocommon.h" #include "rtc_base/constructormagic.h" #include "rtc_base/criticalsection.h" +#include "rtc_base/system/rtc_export.h" #include "rtc_base/third_party/sigslot/sigslot.h" #include "rtc_base/thread_checker.h" #include "rtc_base/timestampaligner.h" @@ -72,8 +73,9 @@ enum CaptureState { // media engine thread). Hence, the VideoCapture subclasses dont need to be // thread safe. // -class VideoCapturer : public sigslot::has_slots<>, - public rtc::VideoSourceInterface { +class RTC_EXPORT VideoCapturer + : public sigslot::has_slots<>, + public rtc::VideoSourceInterface { public: VideoCapturer(); diff --git a/media/engine/webrtcvideoencoderfactory.h b/media/engine/webrtcvideoencoderfactory.h index 97ac03b473..4fc2e70b79 100644 --- a/media/engine/webrtcvideoencoderfactory.h +++ b/media/engine/webrtcvideoencoderfactory.h @@ -16,6 +16,7 @@ #include "common_types.h" // NOLINT(build/include) #include "media/base/codec.h" +#include "rtc_base/system/rtc_export.h" namespace webrtc { class VideoEncoder; @@ -25,7 +26,7 @@ namespace cricket { // Deprecated. Use webrtc::VideoEncoderFactory instead. // https://bugs.chromium.org/p/webrtc/issues/detail?id=7925 -class WebRtcVideoEncoderFactory { +class RTC_EXPORT WebRtcVideoEncoderFactory { public: virtual ~WebRtcVideoEncoderFactory() {} diff --git a/p2p/BUILD.gn b/p2p/BUILD.gn index 389f31bbdb..48b81591ba 100644 --- a/p2p/BUILD.gn +++ b/p2p/BUILD.gn @@ -211,6 +211,7 @@ rtc_static_library("libstunprober") { "..:webrtc_common", "../rtc_base:checks", "../rtc_base:rtc_base", + "../rtc_base/system:rtc_export", ] } diff --git a/p2p/stunprober/stunprober.h b/p2p/stunprober/stunprober.h index 9f1d42f32c..a4feecd813 100644 --- a/p2p/stunprober/stunprober.h +++ b/p2p/stunprober/stunprober.h @@ -22,6 +22,7 @@ #include "rtc_base/ipaddress.h" #include "rtc_base/network.h" #include "rtc_base/socketaddress.h" +#include "rtc_base/system/rtc_export.h" #include "rtc_base/thread.h" #include "rtc_base/thread_checker.h" @@ -49,7 +50,7 @@ enum NatType { NATTYPE_NON_SYMMETRIC // Behind a non-symmetric NAT. }; -class StunProber : public sigslot::has_slots<> { +class RTC_EXPORT StunProber : public sigslot::has_slots<> { public: enum Status { // Used in UMA_HISTOGRAM_ENUMERATION. SUCCESS, // Successfully received bytes from the server.