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}
146 lines
5.3 KiB
C++
146 lines
5.3 KiB
C++
/*
|
|
* Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
|
|
*
|
|
* Use of this source code is governed by a BSD-style license
|
|
* that can be found in the LICENSE file in the root of the source
|
|
* tree. An additional intellectual property rights grant can be found
|
|
* in the file PATENTS. All contributing project authors may
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
*/
|
|
#ifndef MODULES_DESKTOP_CAPTURE_DESKTOP_CAPTURE_OPTIONS_H_
|
|
#define MODULES_DESKTOP_CAPTURE_DESKTOP_CAPTURE_OPTIONS_H_
|
|
|
|
#include "rtc_base/constructormagic.h"
|
|
#include "rtc_base/scoped_ref_ptr.h"
|
|
#include "rtc_base/system/rtc_export.h"
|
|
|
|
#if defined(USE_X11)
|
|
#include "modules/desktop_capture/x11/shared_x_display.h"
|
|
#endif
|
|
|
|
#if defined(WEBRTC_MAC) && !defined(WEBRTC_IOS)
|
|
#include "modules/desktop_capture/mac/desktop_configuration_monitor.h"
|
|
#include "modules/desktop_capture/mac/full_screen_chrome_window_detector.h"
|
|
#endif
|
|
|
|
namespace webrtc {
|
|
|
|
// An object that stores initialization parameters for screen and window
|
|
// capturers.
|
|
class RTC_EXPORT DesktopCaptureOptions {
|
|
public:
|
|
// Returns instance of DesktopCaptureOptions with default parameters. On Linux
|
|
// also initializes X window connection. x_display() will be set to null if
|
|
// X11 connection failed (e.g. DISPLAY isn't set).
|
|
static DesktopCaptureOptions CreateDefault();
|
|
|
|
DesktopCaptureOptions();
|
|
DesktopCaptureOptions(const DesktopCaptureOptions& options);
|
|
DesktopCaptureOptions(DesktopCaptureOptions&& options);
|
|
~DesktopCaptureOptions();
|
|
|
|
DesktopCaptureOptions& operator=(const DesktopCaptureOptions& options);
|
|
DesktopCaptureOptions& operator=(DesktopCaptureOptions&& options);
|
|
|
|
#if defined(USE_X11)
|
|
SharedXDisplay* x_display() const { return x_display_; }
|
|
void set_x_display(rtc::scoped_refptr<SharedXDisplay> x_display) {
|
|
x_display_ = x_display;
|
|
}
|
|
#endif
|
|
|
|
#if defined(WEBRTC_MAC) && !defined(WEBRTC_IOS)
|
|
// TODO(zijiehe): Remove both DesktopConfigurationMonitor and
|
|
// FullScreenChromeWindowDetector out of DesktopCaptureOptions. It's not
|
|
// reasonable for external consumers to set these two parameters.
|
|
DesktopConfigurationMonitor* configuration_monitor() const {
|
|
return configuration_monitor_;
|
|
}
|
|
// If nullptr is set, ScreenCapturer won't work and WindowCapturer may return
|
|
// inaccurate result from IsOccluded() function.
|
|
void set_configuration_monitor(
|
|
rtc::scoped_refptr<DesktopConfigurationMonitor> m) {
|
|
configuration_monitor_ = m;
|
|
}
|
|
|
|
// TODO(zijiehe): Instead of FullScreenChromeWindowDetector, provide a
|
|
// FullScreenWindowDetector for external consumers to detect the target
|
|
// fullscreen window.
|
|
FullScreenChromeWindowDetector* full_screen_chrome_window_detector() const {
|
|
return full_screen_window_detector_;
|
|
}
|
|
void set_full_screen_chrome_window_detector(
|
|
rtc::scoped_refptr<FullScreenChromeWindowDetector> detector) {
|
|
full_screen_window_detector_ = detector;
|
|
}
|
|
|
|
bool allow_iosurface() const { return allow_iosurface_; }
|
|
void set_allow_iosurface(bool allow) { allow_iosurface_ = allow; }
|
|
#endif
|
|
|
|
// Flag indicating that the capturer should use screen change notifications.
|
|
// Enables/disables use of XDAMAGE in the X11 capturer.
|
|
bool use_update_notifications() const { return use_update_notifications_; }
|
|
void set_use_update_notifications(bool use_update_notifications) {
|
|
use_update_notifications_ = use_update_notifications;
|
|
}
|
|
|
|
// Flag indicating if desktop effects (e.g. Aero) should be disabled when the
|
|
// capturer is active. Currently used only on Windows.
|
|
bool disable_effects() const { return disable_effects_; }
|
|
void set_disable_effects(bool disable_effects) {
|
|
disable_effects_ = disable_effects;
|
|
}
|
|
|
|
// Flag that should be set if the consumer uses updated_region() and the
|
|
// capturer should try to provide correct updated_region() for the frames it
|
|
// generates (e.g. by comparing each frame with the previous one).
|
|
bool detect_updated_region() const { return detect_updated_region_; }
|
|
void set_detect_updated_region(bool detect_updated_region) {
|
|
detect_updated_region_ = detect_updated_region;
|
|
}
|
|
|
|
#if defined(WEBRTC_WIN)
|
|
bool allow_use_magnification_api() const {
|
|
return allow_use_magnification_api_;
|
|
}
|
|
void set_allow_use_magnification_api(bool allow) {
|
|
allow_use_magnification_api_ = allow;
|
|
}
|
|
// Allowing directx based capturer or not, this capturer works on windows 7
|
|
// with platform update / windows 8 or upper.
|
|
bool allow_directx_capturer() const { return allow_directx_capturer_; }
|
|
void set_allow_directx_capturer(bool enabled) {
|
|
allow_directx_capturer_ = enabled;
|
|
}
|
|
#endif
|
|
|
|
private:
|
|
#if defined(USE_X11)
|
|
rtc::scoped_refptr<SharedXDisplay> x_display_;
|
|
#endif
|
|
|
|
#if defined(WEBRTC_MAC) && !defined(WEBRTC_IOS)
|
|
rtc::scoped_refptr<DesktopConfigurationMonitor> configuration_monitor_;
|
|
rtc::scoped_refptr<FullScreenChromeWindowDetector>
|
|
full_screen_window_detector_;
|
|
bool allow_iosurface_ = false;
|
|
#endif
|
|
|
|
#if defined(WEBRTC_WIN)
|
|
bool allow_use_magnification_api_ = false;
|
|
bool allow_directx_capturer_ = false;
|
|
#endif
|
|
#if defined(USE_X11)
|
|
bool use_update_notifications_ = false;
|
|
#else
|
|
bool use_update_notifications_ = true;
|
|
#endif
|
|
bool disable_effects_ = true;
|
|
bool detect_updated_region_ = false;
|
|
};
|
|
|
|
} // namespace webrtc
|
|
|
|
#endif // MODULES_DESKTOP_CAPTURE_DESKTOP_CAPTURE_OPTIONS_H_
|