Skip to content

Commit ba50cb3

Browse files
kthelgasonWebRTC LUCI CQ
authored andcommitted
Reland "Delete deprecated NSGLVideoView."
This is a reland of commit 54d7547 Original change's description: > Delete deprecated NSGLVideoView. > > Bug: b/288827308 > Change-Id: I08f731d893ebc947b7c4db6deb33ed695dcf53b5 > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/310622 > Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> > Commit-Queue: Kári Helgason <kthelgason@webrtc.org> > Auto-Submit: Kári Helgason <kthelgason@webrtc.org> > Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org> > Cr-Commit-Position: refs/heads/main@{#40368} Bug: b/288827308 Change-Id: Ib6c0972c62a0ca97bd3bb1b8e7b1c11f9fe49725 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/310783 Commit-Queue: Kári Helgason <kthelgason@webrtc.org> Reviewed-by: Kári Helgason <kthelgason@webrtc.org> Cr-Commit-Position: refs/heads/main@{#40380}
1 parent f92cc6d commit ba50cb3

File tree

7 files changed

+37
-329
lines changed

7 files changed

+37
-329
lines changed

examples/BUILD.gn

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ if (is_ios || (is_mac && target_cpu != "x86")) {
352352
"../sdk:videocapture_objc",
353353
"../sdk:videocodec_objc",
354354
]
355-
if (rtc_ios_macos_use_opengl_rendering) {
355+
if (rtc_ios_use_opengl_rendering) {
356356
deps += [ "../sdk:opengl_ui_objc" ]
357357
}
358358

@@ -509,7 +509,7 @@ if (is_ios || (is_mac && target_cpu != "x86")) {
509509
"../sdk:videotoolbox_objc",
510510
]
511511

512-
if (rtc_ios_macos_use_opengl_rendering) {
512+
if (rtc_ios_use_opengl_rendering) {
513513
deps += [ "../sdk:opengl_ui_objc" ]
514514
}
515515
}
@@ -548,7 +548,6 @@ if (is_ios || (is_mac && target_cpu != "x86")) {
548548
"../sdk:helpers_objc",
549549
"../sdk:mediaconstraints_objc",
550550
"../sdk:metal_objc",
551-
"../sdk:opengl_ui_objc",
552551
"../sdk:peerconnectionfactory_base_objc",
553552
"../sdk:peerconnectionfactory_base_objc",
554553
"../sdk:videocapture_objc",

examples/objc/AppRTCMobile/mac/APPRTCViewController.m

Lines changed: 5 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
#import "sdk/objc/api/peerconnection/RTCVideoTrack.h"
1616
#import "sdk/objc/components/renderer/metal/RTCMTLNSVideoView.h"
17-
#import "sdk/objc/components/renderer/opengl/RTCNSGLVideoView.h"
1817

1918
#import "ARDAppClient.h"
2019
#import "ARDCaptureController.h"
@@ -45,7 +44,7 @@ - (void)displayLogMessage:(NSString*)message;
4544

4645
@end
4746

48-
@interface APPRTCMainView () <NSTextFieldDelegate, RTC_OBJC_TYPE (RTCNSGLVideoViewDelegate)>
47+
@interface APPRTCMainView () <NSTextFieldDelegate, RTC_OBJC_TYPE (RTCVideoViewDelegate)>
4948
@end
5049
@implementation APPRTCMainView {
5150
NSScrollView* _scrollView;
@@ -178,9 +177,9 @@ - (void)startCall:(id)sender {
178177
[self setNeedsUpdateConstraints:YES];
179178
}
180179

181-
#pragma mark - RTC_OBJC_TYPE(RTCNSGLVideoViewDelegate)
180+
#pragma mark - RTCVideoViewDelegate
182181

183-
- (void)videoView:(RTC_OBJC_TYPE(RTCNSGLVideoView) *)videoView didChangeVideoSize:(NSSize)size {
182+
- (void)videoView:(id<RTC_OBJC_TYPE(RTCVideoRenderer)>)videoView didChangeVideoSize:(CGSize)size {
184183
if (videoView == _remoteVideoView) {
185184
_remoteVideoSize = size;
186185
} else if (videoView == _localVideoView) {
@@ -216,38 +215,8 @@ - (void)setupViews {
216215
[_scrollView setDocumentView:_logView];
217216
[self addSubview:_scrollView];
218217

219-
// NOTE (daniela): Ignoring Clang diagonstic here.
220-
// We're performing run time check to make sure class is available on runtime.
221-
// If not we're providing sensible default.
222-
#pragma clang diagnostic push
223-
#pragma clang diagnostic ignored "-Wpartial-availability"
224-
if ([RTC_OBJC_TYPE(RTCMTLNSVideoView) class] &&
225-
[RTC_OBJC_TYPE(RTCMTLNSVideoView) isMetalAvailable]) {
226-
_remoteVideoView = [[RTC_OBJC_TYPE(RTCMTLNSVideoView) alloc] initWithFrame:NSZeroRect];
227-
_localVideoView = [[RTC_OBJC_TYPE(RTCMTLNSVideoView) alloc] initWithFrame:NSZeroRect];
228-
}
229-
#pragma clang diagnostic pop
230-
if (_remoteVideoView == nil) {
231-
NSOpenGLPixelFormatAttribute attributes[] = {
232-
NSOpenGLPFADoubleBuffer,
233-
NSOpenGLPFADepthSize, 24,
234-
NSOpenGLPFAOpenGLProfile,
235-
NSOpenGLProfileVersion3_2Core,
236-
0
237-
};
238-
NSOpenGLPixelFormat* pixelFormat =
239-
[[NSOpenGLPixelFormat alloc] initWithAttributes:attributes];
240-
241-
RTC_OBJC_TYPE(RTCNSGLVideoView)* remote =
242-
[[RTC_OBJC_TYPE(RTCNSGLVideoView) alloc] initWithFrame:NSZeroRect pixelFormat:pixelFormat];
243-
remote.delegate = self;
244-
_remoteVideoView = remote;
245-
246-
RTC_OBJC_TYPE(RTCNSGLVideoView)* local =
247-
[[RTC_OBJC_TYPE(RTCNSGLVideoView) alloc] initWithFrame:NSZeroRect pixelFormat:pixelFormat];
248-
local.delegate = self;
249-
_localVideoView = local;
250-
}
218+
_remoteVideoView = [[RTC_OBJC_TYPE(RTCMTLNSVideoView) alloc] initWithFrame:NSZeroRect];
219+
_localVideoView = [[RTC_OBJC_TYPE(RTCMTLNSVideoView) alloc] initWithFrame:NSZeroRect];
251220

252221
[_remoteVideoView setTranslatesAutoresizingMaskIntoConstraints:NO];
253222
[self addSubview:_remoteVideoView];

sdk/BUILD.gn

Lines changed: 28 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -230,9 +230,6 @@ if (is_ios || is_mac) {
230230
"objc/native/api/audio_device_module.h",
231231
"objc/native/api/audio_device_module.mm",
232232
]
233-
if (is_mac) {
234-
frameworks = [ "AudioUnit.framework" ]
235-
}
236233

237234
deps = [
238235
":audio_device",
@@ -253,6 +250,33 @@ if (is_ios || is_mac) {
253250
deps = [ "../rtc_base:threading" ]
254251
}
255252

253+
rtc_library("opengl_ui_objc") {
254+
visibility = [ "*" ]
255+
allow_poison = [
256+
"audio_codecs", # TODO(bugs.webrtc.org/8396): Remove.
257+
"default_task_queue",
258+
]
259+
sources = [
260+
"objc/components/renderer/opengl/RTCDisplayLinkTimer.h",
261+
"objc/components/renderer/opengl/RTCDisplayLinkTimer.m",
262+
"objc/components/renderer/opengl/RTCEAGLVideoView.h",
263+
"objc/components/renderer/opengl/RTCEAGLVideoView.m",
264+
]
265+
266+
# TODO(bugs.webrtc.org/12937): Remove OpenGL deprecation warning
267+
# workaround.
268+
defines = [ "GLES_SILENCE_DEPRECATION" ]
269+
configs += [ "..:common_objc" ]
270+
deps = [
271+
":base_objc",
272+
":helpers_objc",
273+
":metal_objc",
274+
":opengl_objc",
275+
":videocapture_objc",
276+
":videoframebuffer_objc",
277+
]
278+
}
279+
256280
rtc_library("audio_device") {
257281
visibility = [ "*" ]
258282

@@ -578,41 +602,6 @@ if (is_ios || is_mac) {
578602
]
579603
}
580604

581-
rtc_library("opengl_ui_objc") {
582-
visibility = [ "*" ]
583-
allow_poison = [
584-
"audio_codecs", # TODO(bugs.webrtc.org/8396): Remove.
585-
"default_task_queue",
586-
]
587-
if (is_ios) {
588-
sources = [
589-
"objc/components/renderer/opengl/RTCDisplayLinkTimer.h",
590-
"objc/components/renderer/opengl/RTCDisplayLinkTimer.m",
591-
"objc/components/renderer/opengl/RTCEAGLVideoView.h",
592-
"objc/components/renderer/opengl/RTCEAGLVideoView.m",
593-
]
594-
595-
# TODO(bugs.webrtc.org/12937): Remove OpenGL deprecation warning
596-
# workaround.
597-
defines = [ "GLES_SILENCE_DEPRECATION" ]
598-
}
599-
if (is_mac) {
600-
sources = [
601-
"objc/components/renderer/opengl/RTCNSGLVideoView.h",
602-
"objc/components/renderer/opengl/RTCNSGLVideoView.m",
603-
]
604-
}
605-
configs += [ "..:common_objc" ]
606-
deps = [
607-
":base_objc",
608-
":helpers_objc",
609-
":metal_objc",
610-
":opengl_objc",
611-
":videocapture_objc",
612-
":videoframebuffer_objc",
613-
]
614-
}
615-
616605
rtc_library("metal_objc") {
617606
visibility = [ "*" ]
618607
allow_poison = [
@@ -1202,7 +1191,7 @@ if (is_ios || is_mac) {
12021191
"//third_party/libyuv",
12031192
]
12041193

1205-
if (rtc_ios_macos_use_opengl_rendering) {
1194+
if (rtc_ios_use_opengl_rendering) {
12061195
deps += [ ":opengl_objc" ]
12071196
}
12081197

@@ -1383,9 +1372,6 @@ if (is_ios || is_mac) {
13831372
":videocodec_objc",
13841373
":videotoolbox_objc",
13851374
]
1386-
if (rtc_ios_macos_use_opengl_rendering) {
1387-
deps += [ ":opengl_ui_objc" ]
1388-
}
13891375
if (!build_with_chromium) {
13901376
deps += [
13911377
":callback_logger_objc",
@@ -1489,7 +1475,6 @@ if (is_ios || is_mac) {
14891475
"objc/components/capturer/RTCCameraVideoCapturer.h",
14901476
"objc/components/capturer/RTCFileVideoCapturer.h",
14911477
"objc/components/renderer/metal/RTCMTLNSVideoView.h",
1492-
"objc/components/renderer/opengl/RTCNSGLVideoView.h",
14931478
"objc/components/renderer/opengl/RTCVideoViewShading.h",
14941479
"objc/components/video_codec/RTCCodecSpecificInfoH264.h",
14951480
"objc/components/video_codec/RTCDefaultVideoDecoderFactory.h",
@@ -1514,7 +1499,6 @@ if (is_ios || is_mac) {
15141499
":default_codec_factory_objc",
15151500
":native_api",
15161501
":native_video",
1517-
":opengl_ui_objc",
15181502
":peerconnectionfactory_base_objc",
15191503
":videocapture_objc",
15201504
":videocodec_objc",

sdk/objc/components/renderer/metal/RTCMTLNSVideoView.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212

1313
#import "RTCVideoRenderer.h"
1414

15-
NS_AVAILABLE_MAC(10.11)
16-
1715
RTC_OBJC_EXPORT
1816
@interface RTC_OBJC_TYPE (RTCMTLNSVideoView) : NSView <RTC_OBJC_TYPE(RTCVideoRenderer)>
1917

sdk/objc/components/renderer/opengl/RTCNSGLVideoView.h

Lines changed: 0 additions & 42 deletions
This file was deleted.

0 commit comments

Comments
 (0)