Skip to content
This repository was archived by the owner on Oct 25, 2024. It is now read-only.

Commit 7550929

Browse files
committed
Some changes for building with OWT.
1 parent 9863f3d commit 7550929

File tree

9 files changed

+53
-16
lines changed

9 files changed

+53
-16
lines changed

BUILD.gn

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,25 @@ config("common_inherited_config") {
140140
target_gen_dir,
141141
]
142142
}
143+
if (build_with_owt) {
144+
include_dirs = [
145+
# The overrides must be included first as that is the mechanism for
146+
# selecting the override headers in Chromium.
147+
#"../webrtc_overrides",
148+
149+
# Allow includes to be prefixed with webrtc/ in case it is not an
150+
# immediate subdirectory of the top-level.
151+
".",
152+
153+
# Just like the root WebRTC directory is added to include path, the
154+
# corresponding directory tree with generated files needs to be added too.
155+
# Note: this path does not change depending on the current target, e.g.
156+
# it is always "//gen/third_party/webrtc" when building with Chromium.
157+
# See also: http://cs.chromium.org/?q=%5C"default_include_dirs
158+
# https://gn.googlesource.com/gn/+/master/docs/reference.md#target_gen_dir
159+
target_gen_dir,
160+
]
161+
}
143162
if (is_posix || is_fuchsia) {
144163
defines += [ "WEBRTC_POSIX" ]
145164
}
@@ -245,7 +264,7 @@ config("common_config") {
245264
defines += [ "WEBRTC_USE_H264" ]
246265
}
247266

248-
if (build_with_chromium) {
267+
if (build_with_chromium || build_with_owt) {
249268
defines += [
250269
# NOTICE: Since common_inherited_config is used in public_configs for our
251270
# targets, there's no point including the defines in that config here.
@@ -382,7 +401,7 @@ if (!build_with_chromium) {
382401
# Target to build all the WebRTC production code.
383402
rtc_static_library("webrtc") {
384403
# Only the root target should depend on this.
385-
visibility = [ "//:default" ]
404+
visibility = [ ".:default" ]
386405

387406
sources = []
388407
complete_static_lib = true

examples/BUILD.gn

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ if (rtc_include_tests) {
8181
deps = [
8282
":read_auth_file",
8383
"../test:test_main",
84-
"//test:test_support",
84+
"../test:test_support",
8585
"//testing/gtest",
8686
]
8787
}
@@ -618,7 +618,7 @@ if (is_ios || (is_mac && target_cpu != "x86")) {
618618
":AppRTCMobile_lib",
619619
":apprtcmobile_test_sources",
620620
"../sdk:framework_objc",
621-
"//test:test_support",
621+
"../test:test_support",
622622
]
623623
ldflags = [ "-all_load" ]
624624
}

rtc_base/BUILD.gn

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -612,6 +612,7 @@ rtc_static_library("rtc_numerics") {
612612
}
613613

614614
rtc_source_set("rtc_json") {
615+
visibility = [ "*", "//talk/owt:owt_deps" ]
615616
defines = []
616617
sources = [
617618
"strings/json.cc",

sdk/BUILD.gn

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -358,11 +358,11 @@ if (is_ios || is_mac) {
358358
]
359359
deps = [
360360
":base_objc",
361-
"//api/video:video_frame",
362-
"//api/video:video_frame_i420",
363-
"//common_video",
364-
"//rtc_base:checks",
365-
"//rtc_base:rtc_base_approved",
361+
"../api/video:video_frame",
362+
"../api/video:video_frame_i420",
363+
"../common_video",
364+
"../rtc_base:checks",
365+
"../rtc_base:rtc_base_approved",
366366
"//third_party/libyuv",
367367
]
368368
configs += [
@@ -1119,7 +1119,7 @@ if (is_ios || is_mac) {
11191119
":peerconnectionfactory_base_objc",
11201120
":sdk_unittests_bundle_data",
11211121
":sdk_unittests_sources",
1122-
"//test:test_support",
1122+
"../test:test_support",
11231123
]
11241124
ldflags = [ "-all_load" ]
11251125
}
@@ -1137,7 +1137,7 @@ if (is_ios || is_mac) {
11371137
deps = [
11381138
":framework_objc+link",
11391139
":ios_framework_bundle",
1140-
"//test:test_support",
1140+
"../test:test_support",
11411141
]
11421142
}
11431143
}

sdk/objc/api/peerconnection/RTCPeerConnectionFactory+Native.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ class NetworkControllerFactoryInterface;
2222
class VideoEncoderFactory;
2323
class VideoDecoderFactory;
2424
class AudioProcessing;
25+
class PeerConnectionFactoryInterface;
2526

2627
} // namespace webrtc
2728

@@ -87,6 +88,9 @@ NS_ASSUME_NONNULL_BEGIN
8788
decoderFactory:(nullable id<RTCVideoDecoderFactory>)decoderFactory
8889
mediaTransportFactory:
8990
(std::unique_ptr<webrtc::MediaTransportFactory>)mediaTransportFactory;
91+
92+
- (instancetype)initWithNativePeerConnectionFactory:(
93+
rtc::scoped_refptr<webrtc::PeerConnectionFactoryInterface>)factory;
9094
@end
9195

9296
NS_ASSUME_NONNULL_END

sdk/objc/api/peerconnection/RTCPeerConnectionFactory.mm

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,13 @@ - (instancetype)initWithNativeAudioEncoderFactory:
240240
}
241241
return self;
242242
}
243+
- (instancetype)initWithNativePeerConnectionFactory:
244+
(rtc::scoped_refptr<webrtc::PeerConnectionFactoryInterface>)factory {
245+
if (self = [self initNative]) {
246+
_nativeFactory = factory;
247+
}
248+
return self;
249+
}
243250

244251
- (RTCAudioSource *)audioSourceWithConstraints:(nullable RTCMediaConstraints *)constraints {
245252
std::unique_ptr<webrtc::MediaConstraints> nativeConstraints;

sdk/objc/native/src/objc_video_decoder_factory.mm

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,10 @@ int32_t RegisterDecodeCompleteCallback(DecodedImageCallback *callback) override
9898
if ([codecName isEqualToString:codecInfo.name]) {
9999
id<RTCVideoDecoder> decoder = [decoder_factory_ createDecoder:codecInfo];
100100

101-
if ([decoder isKindOfClass:[RTCWrappedNativeVideoDecoder class]]) {
101+
// Because of symbol conflict, isKindOfClass doesn't work as expected.
102+
// See https://bugs.webkit.org/show_bug.cgi?id=198782.
103+
// if ([decoder isKindOfClass:[RTCWrappedNativeVideoDecoder class]]) {
104+
if ([codecName isEqual:@"VP8"] || [codecName isEqual:@"VP9"]) {
102105
return [(RTCWrappedNativeVideoDecoder *)decoder releaseWrappedDecoder];
103106
} else {
104107
return std::unique_ptr<ObjCVideoDecoder>(new ObjCVideoDecoder(decoder));

sdk/objc/native/src/objc_video_encoder_factory.mm

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,10 @@ void SetRates(const RateControlParameters &parameters) override {
147147
const SdpVideoFormat &format) {
148148
RTCVideoCodecInfo *info = [[RTCVideoCodecInfo alloc] initWithNativeSdpVideoFormat:format];
149149
id<RTCVideoEncoder> encoder = [encoder_factory_ createEncoder:info];
150-
if ([encoder isKindOfClass:[RTCWrappedNativeVideoEncoder class]]) {
150+
// Because of symbol conflict, isKindOfClass doesn't work as expected.
151+
// See https://bugs.webkit.org/show_bug.cgi?id=198782.
152+
// if ([encoder isKindOfClass:[RTCWrappedNativeVideoEncoder class]]) {
153+
if ([info.name isEqual:@"VP8"] || [info.name isEqual:@"VP9"]) {
151154
return [(RTCWrappedNativeVideoEncoder *)encoder releaseWrappedEncoder];
152155
} else {
153156
return std::unique_ptr<ObjCVideoEncoder>(new ObjCVideoEncoder(encoder));

webrtc.gni

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -694,7 +694,7 @@ if (is_ios) {
694694
action("umbrella_header_$target_name") {
695695
forward_variables_from(invoker, [ "public_headers" ])
696696

697-
script = "//tools_webrtc/ios/generate_umbrella_header.py"
697+
script = "../tools_webrtc/ios/generate_umbrella_header.py"
698698

699699
outputs = [
700700
umbrella_header_path,
@@ -769,7 +769,7 @@ if (is_mac) {
769769
}
770770

771771
action("modulemap_$this_target_name") {
772-
script = "//tools_webrtc/ios/generate_modulemap.py"
772+
script = "../tools_webrtc/ios/generate_modulemap.py"
773773
args = [
774774
"--out",
775775
rebase_path(modulemap_path, root_build_dir),
@@ -796,7 +796,7 @@ if (is_mac) {
796796
action("umbrella_header_$this_target_name") {
797797
forward_variables_from(invoker, [ "sources" ])
798798

799-
script = "//tools_webrtc/ios/generate_umbrella_header.py"
799+
script = "../tools_webrtc/ios/generate_umbrella_header.py"
800800

801801
outputs = [
802802
umbrella_header_path,

0 commit comments

Comments
 (0)