Index: webrtc/examples/objc/AppRTCMobile/mac/APPRTCViewController.m |
diff --git a/webrtc/examples/objc/AppRTCMobile/mac/APPRTCViewController.m b/webrtc/examples/objc/AppRTCMobile/mac/APPRTCViewController.m |
index bcf26b258e745076693a60778653b98b5cc83dbf..28ac9e29321ab81a7fd151fa5bdc801747b138ec 100644 |
--- a/webrtc/examples/objc/AppRTCMobile/mac/APPRTCViewController.m |
+++ b/webrtc/examples/objc/AppRTCMobile/mac/APPRTCViewController.m |
@@ -12,6 +12,7 @@ |
#import <AVFoundation/AVFoundation.h> |
+#import "WebRTC/RTCMTLNSVideoView.h" |
#import "WebRTC/RTCNSGLVideoView.h" |
#import "WebRTC/RTCVideoTrack.h" |
@@ -35,7 +36,7 @@ static NSUInteger const kBottomViewHeight = 200; |
@property(nonatomic, weak) id<APPRTCMainViewDelegate> delegate; |
@property(nonatomic, readonly) RTCNSGLVideoView* localVideoView; |
-@property(nonatomic, readonly) RTCNSGLVideoView* remoteVideoView; |
+@property(nonatomic, readonly) NSView<RTCVideoRenderer>* remoteVideoView; |
- (void)displayLogMessage:(NSString*)message; |
@@ -177,7 +178,7 @@ static NSUInteger const kBottomViewHeight = 200; |
#pragma mark - RTCNSGLVideoViewDelegate |
- (void)videoView:(RTCNSGLVideoView*)videoView |
- didChangeVideoSize:(NSSize)size { |
+didChangeVideoSize:(NSSize)size { |
magjed_webrtc
2017/03/28 11:20:29
Indentation must be wrong here?
daniela-webrtc
2017/03/28 14:58:05
Done.
|
if (videoView == _remoteVideoView) { |
_remoteVideoSize = size; |
} else if (videoView == _localVideoView) { |
@@ -222,10 +223,24 @@ static NSUInteger const kBottomViewHeight = 200; |
}; |
NSOpenGLPixelFormat* pixelFormat = |
[[NSOpenGLPixelFormat alloc] initWithAttributes:attributes]; |
- _remoteVideoView = [[RTCNSGLVideoView alloc] initWithFrame:NSZeroRect |
- pixelFormat:pixelFormat]; |
+ |
+// NOTE (daniela): Ignoring Clang diagonstic here. |
+// We're performing run time check to make sure class is available on runtime. |
+// If not we're providing sensible default. |
+#pragma clang diagnostic push |
+#pragma clang diagnostic ignored "-Wpartial-availability" |
+ if ([RTCMTLNSVideoView class]) { |
+ _remoteVideoView = [[RTCMTLNSVideoView alloc] initWithFrame:NSZeroRect]; |
+ } else { |
+ RTCNSGLVideoView* remote = |
+ [[RTCNSGLVideoView alloc] initWithFrame:NSZeroRect pixelFormat:pixelFormat]; |
+ remote.delegate = self; |
+ _remoteVideoView = remote; |
+ } |
+#pragma clang diagnostic pop |
+ |
[_remoteVideoView setTranslatesAutoresizingMaskIntoConstraints:NO]; |
- _remoteVideoView.delegate = self; |
+ |
[self addSubview:_remoteVideoView]; |
_localVideoView = [[RTCNSGLVideoView alloc] initWithFrame:NSZeroRect |