Skip to content

Commit

Permalink
Export symbols needed by the Chromium component build (part 8).
Browse files Browse the repository at this point in the history
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: Ib2c29054b2ae008f5291bd3b762a504b18534326
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/130513
Commit-Queue: Mirko Bonadei <[email protected]>
Reviewed-by: Karl Wiberg <[email protected]>
Cr-Commit-Position: refs/heads/master@{#27410}
  • Loading branch information
MirkoBonadei authored and Commit Bot committed Apr 2, 2019
1 parent db6335e commit 66e7679
Show file tree
Hide file tree
Showing 37 changed files with 90 additions and 54 deletions.
1 change: 1 addition & 0 deletions api/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,7 @@ rtc_source_set("ice_transport_factory") {
":scoped_refptr",
"../p2p:rtc_p2p",
"../rtc_base",
"../rtc_base/system:rtc_export",
"//third_party/abseil-cpp/absl/memory",
]
}
Expand Down
3 changes: 2 additions & 1 deletion api/ice_transport_factory.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

#include "api/ice_transport_interface.h"
#include "api/scoped_refptr.h"
#include "rtc_base/system/rtc_export.h"

namespace cricket {
class PortAllocator;
Expand All @@ -25,7 +26,7 @@ namespace webrtc {
// The returned object must be accessed and destroyed on the thread that
// created it.
// The PortAllocator must outlive the created IceTransportInterface object.
rtc::scoped_refptr<IceTransportInterface> CreateIceTransport(
RTC_EXPORT rtc::scoped_refptr<IceTransportInterface> CreateIceTransport(
cricket::PortAllocator* port_allocator);

} // namespace webrtc
Expand Down
3 changes: 2 additions & 1 deletion api/jsep_ice_candidate.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@
#include "api/candidate.h"
#include "api/jsep.h"
#include "rtc_base/constructor_magic.h"
#include "rtc_base/system/rtc_export.h"

namespace webrtc {

// Implementation of IceCandidateInterface.
class JsepIceCandidate : public IceCandidateInterface {
class RTC_EXPORT JsepIceCandidate : public IceCandidateInterface {
public:
JsepIceCandidate(const std::string& sdp_mid, int sdp_mline_index);
JsepIceCandidate(const std::string& sdp_mid,
Expand Down
11 changes: 6 additions & 5 deletions api/media_stream_interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include "api/video/video_source_interface.h"
#include "modules/audio_processing/include/audio_processing_statistics.h"
#include "rtc_base/ref_count.h"
#include "rtc_base/system/rtc_export.h"

namespace webrtc {

Expand All @@ -52,8 +53,8 @@ class NotifierInterface {

// Base class for sources. A MediaStreamTrack has an underlying source that
// provides media. A source can be shared by multiple tracks.
class MediaSourceInterface : public rtc::RefCountInterface,
public NotifierInterface {
class RTC_EXPORT MediaSourceInterface : public rtc::RefCountInterface,
public NotifierInterface {
public:
enum SourceState { kInitializing, kLive, kEnded, kMuted };

Expand All @@ -74,8 +75,8 @@ class MediaSourceInterface : public rtc::RefCountInterface,

// C++ version of MediaStreamTrack.
// See: https://www.w3.org/TR/mediacapture-streams/#mediastreamtrack
class MediaStreamTrackInterface : public rtc::RefCountInterface,
public NotifierInterface {
class RTC_EXPORT MediaStreamTrackInterface : public rtc::RefCountInterface,
public NotifierInterface {
public:
enum TrackState {
kLive,
Expand Down Expand Up @@ -190,7 +191,7 @@ class AudioTrackSinkInterface {

// AudioSourceInterface is a reference counted source used for AudioTracks.
// The same source can be used by multiple AudioTracks.
class AudioSourceInterface : public MediaSourceInterface {
class RTC_EXPORT AudioSourceInterface : public MediaSourceInterface {
public:
class AudioObserver {
public:
Expand Down
4 changes: 3 additions & 1 deletion api/media_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,16 @@

#include <string>

#include "rtc_base/system/rtc_export.h"

// The cricket and webrtc have separate definitions for what a media type is.
// They're not compatible. Watch out for this.

namespace cricket {

enum MediaType { MEDIA_TYPE_AUDIO, MEDIA_TYPE_VIDEO, MEDIA_TYPE_DATA };

std::string MediaTypeToString(MediaType type);
RTC_EXPORT std::string MediaTypeToString(MediaType type);
// Aborts on invalid string. Only expected to be used on strings that are
// guaranteed to be valid, such as MediaStreamTrackInterface::kind().
MediaType MediaTypeFromString(const std::string& type_str);
Expand Down
2 changes: 1 addition & 1 deletion api/peer_connection_interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ class StatsObserver : public rtc::RefCountInterface {

enum class SdpSemantics { kPlanB, kUnifiedPlan };

class PeerConnectionInterface : public rtc::RefCountInterface {
class RTC_EXPORT PeerConnectionInterface : public rtc::RefCountInterface {
public:
// See https://w3c.github.io/webrtc-pc/#dom-rtcsignalingstate
enum SignalingState {
Expand Down
3 changes: 2 additions & 1 deletion api/rtc_error.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "absl/strings/string_view.h"
#include "rtc_base/checks.h"
#include "rtc_base/logging.h"
#include "rtc_base/system/rtc_export.h"

namespace webrtc {

Expand Down Expand Up @@ -80,7 +81,7 @@ enum class RTCErrorType {
//
// Doesn't contain anything beyond a type and message now, but will in the
// future as more errors are implemented.
class RTCError {
class RTC_EXPORT RTCError {
public:
// Constructors.

Expand Down
6 changes: 3 additions & 3 deletions api/rtp_parameters.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ enum class DegradationPreference {
BALANCED,
};

extern const double kDefaultBitratePriority;
RTC_EXPORT extern const double kDefaultBitratePriority;

struct RtcpFeedback {
RtcpFeedbackType type = RtcpFeedbackType::CCM;
Expand Down Expand Up @@ -362,7 +362,7 @@ struct RtpRtxParameters {
bool operator!=(const RtpRtxParameters& o) const { return !(*this == o); }
};

struct RtpEncodingParameters {
struct RTC_EXPORT RtpEncodingParameters {
RtpEncodingParameters();
RtpEncodingParameters(const RtpEncodingParameters&);
~RtpEncodingParameters();
Expand Down Expand Up @@ -561,7 +561,7 @@ struct RtpCodecParameters {
// RtpCapabilities is used to represent the static capabilities of an
// endpoint. An application can use these capabilities to construct an
// RtpParameters.
struct RtpCapabilities {
struct RTC_EXPORT RtpCapabilities {
RtpCapabilities();
~RtpCapabilities();

Expand Down
3 changes: 2 additions & 1 deletion api/rtp_transceiver_interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "api/rtp_sender_interface.h"
#include "api/scoped_refptr.h"
#include "rtc_base/ref_count.h"
#include "rtc_base/system/rtc_export.h"

namespace webrtc {

Expand All @@ -36,7 +37,7 @@ enum class RtpTransceiverDirection {
// Structure for initializing an RtpTransceiver in a call to
// PeerConnectionInterface::AddTransceiver.
// https://w3c.github.io/webrtc-pc/#dom-rtcrtptransceiverinit
struct RtpTransceiverInit final {
struct RTC_EXPORT RtpTransceiverInit final {
RtpTransceiverInit();
RtpTransceiverInit(const RtpTransceiverInit&);
~RtpTransceiverInit();
Expand Down
2 changes: 1 addition & 1 deletion api/sctp_transport_interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ enum class SctpTransportState {
// SctpTransport.
// It reflects the readonly attributes of the object in the specification.
// http://w3c.github.io/webrtc-pc/#rtcsctptransport-interface
class SctpTransportInformation {
class RTC_EXPORT SctpTransportInformation {
public:
explicit SctpTransportInformation(SctpTransportState state);
SctpTransportInformation(
Expand Down
1 change: 1 addition & 0 deletions api/transport/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ rtc_source_set("bitrate_settings") {
"bitrate_settings.h",
]
deps = [
"../../rtc_base/system:rtc_export",
"//third_party/abseil-cpp/absl/types:optional",
]
}
Expand Down
3 changes: 2 additions & 1 deletion api/transport/bitrate_settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#define API_TRANSPORT_BITRATE_SETTINGS_H_

#include "absl/types/optional.h"
#include "rtc_base/system/rtc_export.h"

namespace webrtc {

Expand All @@ -20,7 +21,7 @@ namespace webrtc {
// estimator, and for initial configuration of the encoder. We may
// want to create separate apis for those, and use a smaller struct
// with only the min and max constraints.
struct BitrateSettings {
struct RTC_EXPORT BitrateSettings {
BitrateSettings();
~BitrateSettings();
BitrateSettings(const BitrateSettings&);
Expand Down
1 change: 1 addition & 0 deletions api/video/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ rtc_source_set("video_bitrate_allocation") {
"../../rtc_base:checks",
"../../rtc_base:safe_conversions",
"../../rtc_base:stringutils",
"../../rtc_base/system:rtc_export",
"//third_party/abseil-cpp/absl/types:optional",
]
}
Expand Down
3 changes: 2 additions & 1 deletion api/video/video_bitrate_allocation.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

#include "absl/types/optional.h"
#include "api/video/video_codec_constants.h"
#include "rtc_base/system/rtc_export.h"

namespace webrtc {

Expand All @@ -27,7 +28,7 @@ namespace webrtc {
// layers are dependent or not, it is up to the user to aggregate.
// For each index, the bitrate can also both set and unset. This is used with a
// set bps = 0 to signal an explicit "turn off" signal.
class VideoBitrateAllocation {
class RTC_EXPORT VideoBitrateAllocation {
public:
static constexpr uint32_t kMaxBitrateBps =
std::numeric_limits<uint32_t>::max();
Expand Down
1 change: 1 addition & 0 deletions api/video_codecs/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ rtc_static_library("rtc_software_fallback_wrappers") {
"../../rtc_base:checks",
"../../rtc_base:rtc_base_approved",
"../../rtc_base/system:fallthrough",
"../../rtc_base/system:rtc_export",
"../../system_wrappers:field_trial",
"../video:encoded_image",
"../video:video_bitrate_allocation",
Expand Down
6 changes: 4 additions & 2 deletions api/video_codecs/sdp_video_format.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@ struct RTC_EXPORT SdpVideoFormat {

~SdpVideoFormat();

friend bool operator==(const SdpVideoFormat& a, const SdpVideoFormat& b);
friend bool operator!=(const SdpVideoFormat& a, const SdpVideoFormat& b) {
friend RTC_EXPORT bool operator==(const SdpVideoFormat& a,
const SdpVideoFormat& b);
friend RTC_EXPORT bool operator!=(const SdpVideoFormat& a,
const SdpVideoFormat& b) {
return !(a == b);
}

Expand Down
4 changes: 3 additions & 1 deletion api/video_codecs/video_decoder_factory.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,16 @@
#include <string>
#include <vector>

#include "rtc_base/system/rtc_export.h"

namespace webrtc {

class VideoDecoder;
struct SdpVideoFormat;

// A factory that creates VideoDecoders.
// NOTE: This class is still under development and may change without notice.
class VideoDecoderFactory {
class RTC_EXPORT VideoDecoderFactory {
public:
// Returns a list of supported video formats in order of preference, to use
// for signaling etc.
Expand Down
4 changes: 3 additions & 1 deletion api/video_codecs/video_decoder_software_fallback_wrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@
#include <memory>

#include "api/video_codecs/video_decoder.h"
#include "rtc_base/system/rtc_export.h"

namespace webrtc {

// Used to wrap external VideoDecoders to provide a fallback option on
// software decoding when a hardware decoder fails to decode a stream due to
// hardware restrictions, such as max resolution.
std::unique_ptr<VideoDecoder> CreateVideoDecoderSoftwareFallbackWrapper(
RTC_EXPORT std::unique_ptr<VideoDecoder>
CreateVideoDecoderSoftwareFallbackWrapper(
std::unique_ptr<VideoDecoder> sw_fallback_decoder,
std::unique_ptr<VideoDecoder> hw_decoder);

Expand Down
4 changes: 3 additions & 1 deletion api/video_codecs/video_encoder_software_fallback_wrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@
#include <memory>

#include "api/video_codecs/video_encoder.h"
#include "rtc_base/system/rtc_export.h"

namespace webrtc {

// Used to wrap external VideoEncoders to provide a fallback option on
// software encoding when a hardware encoder fails to encode a stream due to
// hardware restrictions, such as max resolution.
std::unique_ptr<VideoEncoder> CreateVideoEncoderSoftwareFallbackWrapper(
RTC_EXPORT std::unique_ptr<VideoEncoder>
CreateVideoEncoderSoftwareFallbackWrapper(
std::unique_ptr<VideoEncoder> sw_fallback_encoder,
std::unique_ptr<VideoEncoder> hw_encoder);

Expand Down
3 changes: 3 additions & 0 deletions media/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ rtc_source_set("rtc_vp9_profile") {
"..:webrtc_common",
"../api/video_codecs:video_codecs_api",
"../rtc_base:rtc_base_approved",
"../rtc_base/system:rtc_export",
"//third_party/abseil-cpp/absl/types:optional",
]
}
Expand Down Expand Up @@ -168,6 +169,7 @@ rtc_static_library("rtc_simulcast_encoder_adapter") {
"../rtc_base:rtc_base_approved",
"../rtc_base:sequenced_task_checker",
"../rtc_base/experiments:rate_control_settings",
"../rtc_base/system:rtc_export",
"../system_wrappers",
"../system_wrappers:field_trial",
"//third_party/abseil-cpp/absl/types:optional",
Expand All @@ -189,6 +191,7 @@ rtc_static_library("rtc_encoder_simulcast_proxy") {
"../api/video:video_frame",
"../api/video_codecs:video_codecs_api",
"../modules/video_coding:video_codec_interface",
"../rtc_base/system:rtc_export",
]
}

Expand Down
3 changes: 2 additions & 1 deletion media/base/adapted_video_track_source.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "media/base/video_adapter.h"
#include "media/base/video_broadcaster.h"
#include "rtc_base/critical_section.h"
#include "rtc_base/system/rtc_export.h"
#include "rtc_base/thread_annotations.h"

namespace rtc {
Expand All @@ -30,7 +31,7 @@ namespace rtc {
// capture sources. Sinks must be added and removed on one and only
// one thread, while AdaptFrame and OnFrame may be called on any
// thread.
class AdaptedVideoTrackSource
class RTC_EXPORT AdaptedVideoTrackSource
: public webrtc::Notifier<webrtc::VideoTrackSourceInterface> {
public:
AdaptedVideoTrackSource();
Expand Down
8 changes: 4 additions & 4 deletions media/base/codec.h
Original file line number Diff line number Diff line change
Expand Up @@ -224,10 +224,10 @@ bool HasTransportCc(const Codec& codec);
const VideoCodec* FindMatchingCodec(
const std::vector<VideoCodec>& supported_codecs,
const VideoCodec& codec);
bool IsSameCodec(const std::string& name1,
const CodecParameterMap& params1,
const std::string& name2,
const CodecParameterMap& params2);
RTC_EXPORT bool IsSameCodec(const std::string& name1,
const CodecParameterMap& params1,
const std::string& name2,
const CodecParameterMap& params2);

} // namespace cricket

Expand Down
4 changes: 2 additions & 2 deletions media/base/media_constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ extern const char kGoogleSctpDataCodecName[];

extern const char kComfortNoiseCodecName[];

extern const char kVp8CodecName[];
extern const char kVp9CodecName[];
RTC_EXPORT extern const char kVp8CodecName[];
RTC_EXPORT extern const char kVp9CodecName[];
RTC_EXPORT extern const char kH264CodecName[];

// RFC 6184 RTP Payload Format for H.264 video
Expand Down
7 changes: 4 additions & 3 deletions media/base/vp9_profile.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@

#include "absl/types/optional.h"
#include "api/video_codecs/sdp_video_format.h"
#include "rtc_base/system/rtc_export.h"

namespace webrtc {

// Profile information for VP9 video.
extern const char kVP9FmtpProfileId[];
extern RTC_EXPORT const char kVP9FmtpProfileId[];

enum class VP9Profile {
kProfile0,
Expand All @@ -28,7 +29,7 @@ enum class VP9Profile {

// Helper functions to convert VP9Profile to std::string. Returns "0" by
// default.
std::string VP9ProfileToString(VP9Profile profile);
RTC_EXPORT std::string VP9ProfileToString(VP9Profile profile);

// Helper functions to convert std::string to VP9Profile. Returns null if given
// an invalid profile string.
Expand All @@ -38,7 +39,7 @@ absl::optional<VP9Profile> StringToVP9Profile(const std::string& str);
// SDP key-value map. A default profile(kProfile0) will be returned if the
// profile key is missing. Nothing will be returned if the key is present but
// the string is invalid.
absl::optional<VP9Profile> ParseSdpForVP9Profile(
RTC_EXPORT absl::optional<VP9Profile> ParseSdpForVP9Profile(
const SdpVideoFormat::Parameters& params);

// Returns true if the parameters have the same VP9 profile, or neither contains
Expand Down
Loading

0 comments on commit 66e7679

Please sign in to comment.