Reland "Export symbols needed by the Chromium component build (part 1)."
This reverts commit 16fe3f290a524a136f71660a114d0b03ef501f10.
Reason for revert:
After discussing this problem with nisse@ and yvesg@, we decided to modify
how RTC_EXPORT works and avoid to depend on the macro COMPONENT_BUILD.
RTC_EXPORT will instead depend on a macro WEBRTC_COMPONENT_BUILD (which
can be set as a GN argument which defaults to false).
When all the symbols needed by Chromium will be marked with RTC_EXPORT we
will flip the GN arg in Chromium, setting to to `component_build` and from
that moment, Chromium will depend on a WebRTC shared library when
`component_build=true`.
Original change's description:
> Revert "Export symbols needed by the Chromium component build (part 1)."
>
> This reverts commit 99eea42fc1fe0be0ebed13c5eba7e1e42059bc5a.
>
> Reason for revert:
> lld-link: error: undefined symbol: "__declspec(dllimport) bool __cdecl cricket::UnwrapTurnPacket(unsigned char const *, unsigned int, unsigned int *, unsigned int *)" (__imp_?UnwrapTurnPacket@cricket@@YA_NPBEIPAI1@Z)
> >>> referenced by obj/services/network/network_service/socket_manager.obj:("virtual void __thiscall network::P2PSocketManager::DumpPacket(class base::span<unsigned char const, 4294967295>, bool)" (?DumpPacket@P2PSocketManager@network@@EAEXV?$span@$$CBE$0PPPPPPPP@@base@@_N@Z))
> lld-link: error: undefined symbol: "__declspec(dllimport) bool __cdecl cricket::ValidateRtpHeader(unsigned char const *, unsigned int, unsigned int *)" (__imp_?ValidateRtpHeader@cricket@@YA_NPBEIPAI@Z)
> >>> referenced by obj/services/network/network_service/socket_manager.obj:("virtual void __thiscall network::P2PSocketManager::DumpPacket(class base::span<unsigned char const, 4294967295>, bool)" (?DumpPacket@P2PSocketManager@network@@EAEXV?$span@$$CBE$0PPPPPPPP@@base@@_N@Z))
> lld-link: error: undefined symbol: "__declspec(dllimport) bool __cdecl cricket::ApplyPacketOptions(unsigned char *, unsigned int, struct rtc::PacketTimeUpdateParams const &, unsigned __int64)" (__imp_?ApplyPacketOptions@cricket@@YA_NPAEIABUPacketTimeUpdateParams@rtc@@_K@Z)
> >>> referenced by obj/services/network/network_service/socket_tcp.obj:("virtual void __thiscall network::P2PSocketTcp::DoSend(class net::IPEndPoint const &, class std::vector<signed char, class std::allocator<signed char>> const &, struct rtc::PacketOptions const &, struct net::NetworkTrafficAnnotationTag)" (?DoSend@P2PSocketTcp@network@@MAEXABVIPEndPoint@net@@ABV?$vector@CV?$allocator@C@std@@@std@@ABUPacketOptions@rtc@@UNetworkTrafficAnnotationTag@4@@Z))
> >>> referenced by obj/services/network/network_service/socket_tcp.obj:("virtual void __thiscall network::P2PSocketStunTcp::DoSend(class net::IPEndPoint const &, class std::vector<signed char, class std::allocator<signed char>> const &, struct rtc::PacketOptions const &, struct net::NetworkTrafficAnnotationTag)" (?DoSend@P2PSocketStunTcp@network@@MAEXABVIPEndPoint@net@@ABV?$vector@CV?$allocator@C@std@@@std@@ABUPacketOptions@rtc@@UNetworkTrafficAnnotationTag@4@@Z))
> lld-link: error: undefined symbol: "__declspec(dllimport) bool __cdecl cricket::ApplyPacketOptions(unsigned char *, unsigned int, struct rtc::PacketTimeUpdateParams const &, unsigned __int64)" (__imp_?ApplyPacketOptions@cricket@@YA_NPAEIABUPacketTimeUpdateParams@rtc@@_K@Z)
> >>> referenced by obj/services/network/network_service/socket_udp.obj:("bool __thiscall network::P2PSocketUdp::DoSend(struct network::P2PSocketUdp::PendingPacket const &)" (?DoSend@P2PSocketUdp@network@@AAE_NABUPendingPacket@12@@Z))
>
> Original change's description:
> > Reland "Reland "Export symbols needed by the Chromium component build (part 1).""
> >
> > This reverts commit b49520bfc08f5c5832dda1d642125f0bb898f974.
> >
> > Reason for revert: Problem fixed in https://chromium-review.googlesource.com/c/chromium/src/+/1261398.
> >
> > Original change's description:
> > > Revert "Reland "Export symbols needed by the Chromium component build (part 1).""
> > >
> > > This reverts commit 588f4642d1a29f7beaf28265dbd08728191b4c52.
> > >
> > > Reason for revert: Breaks WebRTC Chromium FYI Win Builder (dbg).
> > > lld-link: error: undefined symbol: "__declspec(dllimport) __thiscall webrtc::Config::Config(void)" (__imp_??0Config@webrtc@@QAE@XZ)
> > > [...]
> > >
> > > Original change's description:
> > > > Reland "Export symbols needed by the Chromium component build (part 1)."
> > > >
> > > > This reverts commit 2ea9af227517556136fd629dd2663c0d75d77c7b.
> > > >
> > > > Reason for revert: The problem will be fixed by
> > > > https://chromium-review.googlesource.com/c/chromium/src/+/1261122.
> > > >
> > > > Original change's description:
> > > > > Revert "Export symbols needed by the Chromium component build (part 1)."
> > > > >
> > > > > This reverts commit 9e24dcff167c4eb3555bf0ce6eaba090c10fbe53.
> > > > >
> > > > > Reason for revert: Breaks chromium.webrtc.fyi bots.
> > > > >
> > > > > Original change's description:
> > > > > > Export symbols needed by the Chromium component build (part 1).
> > > > > >
> > > > > > 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: I802abd32874d42d3aa5ecd3c8022e7cf5e043d99
> > > > > > Reviewed-on: https://webrtc-review.googlesource.com/c/103505
> > > > > > Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
> > > > > > Reviewed-by: Niels Moller <nisse@webrtc.org>
> > > > > > Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> > > > > > Cr-Commit-Position: refs/heads/master@{#24969}
> > > > >
> > > > > TBR=mbonadei@webrtc.org,kwiberg@webrtc.org,nisse@webrtc.org
> > > > >
> > > > > Change-Id: I01f6e18f0d2c0f0309cdaa6c943c3927e1f1f49f
> > > > > No-Presubmit: true
> > > > > No-Tree-Checks: true
> > > > > No-Try: true
> > > > > Bug: webrtc:9419
> > > > > Reviewed-on: https://webrtc-review.googlesource.com/c/103720
> > > > > Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
> > > > > Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
> > > > > Cr-Commit-Position: refs/heads/master@{#24974}
> > > >
> > > > TBR=mbonadei@webrtc.org,kwiberg@webrtc.org,nisse@webrtc.org
> > > >
> > > > Change-Id: I83bbc7f550fc23e823c4d055e0a6f60c828960dd
> > > > No-Presubmit: true
> > > > No-Tree-Checks: true
> > > > No-Try: true
> > > > Bug: webrtc:9419
> > > > Reviewed-on: https://webrtc-review.googlesource.com/c/103740
> > > > Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
> > > > Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
> > > > Cr-Commit-Position: refs/heads/master@{#24980}
> > >
> > > TBR=mbonadei@webrtc.org,kwiberg@webrtc.org,nisse@webrtc.org
> > >
> > > Change-Id: I4b7cfe492f2c8eeda5c8ac52520e0cfc95ade9b0
> > > No-Presubmit: true
> > > No-Tree-Checks: true
> > > No-Try: true
> > > Bug: webrtc:9419
> > > Reviewed-on: https://webrtc-review.googlesource.com/c/103801
> > > Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
> > > Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
> > > Cr-Commit-Position: refs/heads/master@{#24983}
> >
> > TBR=mbonadei@webrtc.org,kwiberg@webrtc.org,nisse@webrtc.org
> >
> > # Not skipping CQ checks because original CL landed > 1 day ago.
> >
> > Bug: webrtc:9419
> > Change-Id: Id986a0a03cdc2818690337784396882af067f7fa
> > Reviewed-on: https://webrtc-review.googlesource.com/c/104602
> > Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
> > Reviewed-by: Niels Moller <nisse@webrtc.org>
> > Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#25049}
>
> TBR=mbonadei@webrtc.org,kwiberg@webrtc.org,nisse@webrtc.org
>
> Change-Id: I6f58b9c90defccdb160307783fb55271ab424fa1
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: webrtc:9419
> Reviewed-on: https://webrtc-review.googlesource.com/c/104623
> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
> Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#25050}
TBR=mbonadei@webrtc.org,kwiberg@webrtc.org,nisse@webrtc.org
Change-Id: I4d01ed96ae40a8f9ca42c466be5c87653d75d7c1
Bug: webrtc:9419
Reviewed-on: https://webrtc-review.googlesource.com/c/104641
Reviewed-by: Yves Gerey <yvesg@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25108}
diff --git a/api/audio/BUILD.gn b/api/audio/BUILD.gn
index 43dc420..1ab6812 100644
--- a/api/audio/BUILD.gn
+++ b/api/audio/BUILD.gn
@@ -42,6 +42,7 @@
deps = [
"../../rtc_base:rtc_base_approved",
"../../rtc_base:safe_minmax",
+ "../../rtc_base/system:rtc_export",
]
}
@@ -55,6 +56,7 @@
":aec3_config",
"../../rtc_base:rtc_base_approved",
"../../rtc_base:rtc_json",
+ "../../rtc_base/system:rtc_export",
"//third_party/abseil-cpp/absl/strings:strings",
]
}
@@ -72,6 +74,7 @@
":echo_control",
"../../modules/audio_processing/aec3",
"../../rtc_base:rtc_base_approved",
+ "../../rtc_base/system:rtc_export",
"//third_party/abseil-cpp/absl/memory",
]
}
diff --git a/api/audio/echo_canceller3_config.h b/api/audio/echo_canceller3_config.h
index 64e3383..f180a44 100644
--- a/api/audio/echo_canceller3_config.h
+++ b/api/audio/echo_canceller3_config.h
@@ -13,10 +13,12 @@
#include <stddef.h> // size_t
+#include "rtc_base/system/rtc_export.h"
+
namespace webrtc {
// Configuration struct for EchoCanceller3
-struct EchoCanceller3Config {
+struct RTC_EXPORT EchoCanceller3Config {
// Checks and updates the parameters in a config to lie within reasonable
// ranges. Returns true if and only of the config did not need to be changed.
static bool Validate(EchoCanceller3Config* config);
diff --git a/api/audio/echo_canceller3_factory.h b/api/audio/echo_canceller3_factory.h
index f6db116..9052d99 100644
--- a/api/audio/echo_canceller3_factory.h
+++ b/api/audio/echo_canceller3_factory.h
@@ -15,10 +15,11 @@
#include "api/audio/echo_canceller3_config.h"
#include "api/audio/echo_control.h"
+#include "rtc_base/system/rtc_export.h"
namespace webrtc {
-class EchoCanceller3Factory : public EchoControlFactory {
+class RTC_EXPORT EchoCanceller3Factory : public EchoControlFactory {
public:
// Factory producing EchoCanceller3 instances with the default configuration.
EchoCanceller3Factory();
diff --git a/api/audio_codecs/L16/BUILD.gn b/api/audio_codecs/L16/BUILD.gn
index 9724805..e362067 100644
--- a/api/audio_codecs/L16/BUILD.gn
+++ b/api/audio_codecs/L16/BUILD.gn
@@ -25,6 +25,7 @@
"../../../modules/audio_coding:pcm16b",
"../../../rtc_base:rtc_base_approved",
"../../../rtc_base:safe_minmax",
+ "../../../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_encoder_L16.h b/api/audio_codecs/L16/audio_encoder_L16.h
index 340e3af..eef4da6 100644
--- a/api/audio_codecs/L16/audio_encoder_L16.h
+++ b/api/audio_codecs/L16/audio_encoder_L16.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 @@
// CreateAudioEncoderFactory<...>().
//
// NOTE: This struct is still under development and may change without notice.
-struct AudioEncoderL16 {
+struct RTC_EXPORT AudioEncoderL16 {
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 169172a..860ba3d 100644
--- a/api/audio_codecs/g711/BUILD.gn
+++ b/api/audio_codecs/g711/BUILD.gn
@@ -25,6 +25,7 @@
"../../../modules/audio_coding:g711",
"../../../rtc_base:rtc_base_approved",
"../../../rtc_base:safe_minmax",
+ "../../../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_encoder_g711.h b/api/audio_codecs/g711/audio_encoder_g711.h
index 6b6eb5f..8dbc881 100644
--- a/api/audio_codecs/g711/audio_encoder_g711.h
+++ b/api/audio_codecs/g711/audio_encoder_g711.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 @@
// CreateAudioEncoderFactory<...>().
//
// NOTE: This struct is still under development and may change without notice.
-struct AudioEncoderG711 {
+struct RTC_EXPORT AudioEncoderG711 {
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 50b1396..d69596b 100644
--- a/api/audio_codecs/g722/BUILD.gn
+++ b/api/audio_codecs/g722/BUILD.gn
@@ -33,6 +33,7 @@
"../../../modules/audio_coding:g722",
"../../../rtc_base:rtc_base_approved",
"../../../rtc_base:safe_minmax",
+ "../../../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_encoder_g722.h b/api/audio_codecs/g722/audio_encoder_g722.h
index b97fe1b..3029e11 100644
--- a/api/audio_codecs/g722/audio_encoder_g722.h
+++ b/api/audio_codecs/g722/audio_encoder_g722.h
@@ -19,6 +19,7 @@
#include "api/audio_codecs/audio_encoder.h"
#include "api/audio_codecs/audio_format.h"
#include "api/audio_codecs/g722/audio_encoder_g722_config.h"
+#include "rtc_base/system/rtc_export.h"
namespace webrtc {
@@ -26,7 +27,7 @@
// CreateAudioEncoderFactory<...>().
//
// NOTE: This struct is still under development and may change without notice.
-struct AudioEncoderG722 {
+struct RTC_EXPORT AudioEncoderG722 {
using Config = AudioEncoderG722Config;
static absl::optional<AudioEncoderG722Config> SdpToConfig(
const SdpAudioFormat& audio_format);
diff --git a/api/audio_codecs/isac/BUILD.gn b/api/audio_codecs/isac/BUILD.gn
index ed9d962..e1bed07 100644
--- a/api/audio_codecs/isac/BUILD.gn
+++ b/api/audio_codecs/isac/BUILD.gn
@@ -131,6 +131,7 @@
"../../..: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_decoder_isac_float.h b/api/audio_codecs/isac/audio_decoder_isac_float.h
index cc13963..b0793e4 100644
--- a/api/audio_codecs/isac/audio_decoder_isac_float.h
+++ b/api/audio_codecs/isac/audio_decoder_isac_float.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 @@
// parameter to CreateAudioDecoderFactory<...>().
//
// NOTE: This struct is still under development and may change without notice.
-struct AudioDecoderIsacFloat {
+struct RTC_EXPORT AudioDecoderIsacFloat {
struct Config {
bool IsOk() const {
return sample_rate_hz == 16000 || sample_rate_hz == 32000;
diff --git a/api/audio_codecs/opus/BUILD.gn b/api/audio_codecs/opus/BUILD.gn
index 800abbe..9c9bf33 100644
--- a/api/audio_codecs/opus/BUILD.gn
+++ b/api/audio_codecs/opus/BUILD.gn
@@ -44,6 +44,7 @@
"..:audio_codecs_api",
"../../../modules/audio_coding:webrtc_opus",
"../../../rtc_base:rtc_base_approved",
+ "../../../rtc_base/system:rtc_export",
"//third_party/abseil-cpp/absl/types:optional",
]
}
@@ -60,6 +61,7 @@
"../../..:webrtc_common",
"../../../modules/audio_coding:webrtc_opus",
"../../../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/opus/audio_decoder_opus.h b/api/audio_codecs/opus/audio_decoder_opus.h
index de26026..0fc720b 100644
--- a/api/audio_codecs/opus/audio_decoder_opus.h
+++ b/api/audio_codecs/opus/audio_decoder_opus.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 @@
// CreateAudioDecoderFactory<...>().
//
// NOTE: This struct is still under development and may change without notice.
-struct AudioDecoderOpus {
+struct RTC_EXPORT AudioDecoderOpus {
struct Config {
int num_channels;
};
diff --git a/api/audio_codecs/opus/audio_encoder_opus.h b/api/audio_codecs/opus/audio_encoder_opus.h
index 20aaaf7..bb4aa27 100644
--- a/api/audio_codecs/opus/audio_encoder_opus.h
+++ b/api/audio_codecs/opus/audio_encoder_opus.h
@@ -19,6 +19,7 @@
#include "api/audio_codecs/audio_encoder.h"
#include "api/audio_codecs/audio_format.h"
#include "api/audio_codecs/opus/audio_encoder_opus_config.h"
+#include "rtc_base/system/rtc_export.h"
namespace webrtc {
@@ -26,7 +27,7 @@
// CreateAudioEncoderFactory<...>().
//
// NOTE: This struct is still under development and may change without notice.
-struct AudioEncoderOpus {
+struct RTC_EXPORT AudioEncoderOpus {
using Config = AudioEncoderOpusConfig;
static absl::optional<AudioEncoderOpusConfig> SdpToConfig(
const SdpAudioFormat& audio_format);