pre-PR cleanup

// FREEBIE
pull/1/head
Michael Kirk 8 years ago
parent f837a46245
commit c3dc8508ab

@ -8,7 +8,6 @@ import PromiseKit
// TODO: Add category so that button handlers can be defined where button is created. // TODO: Add category so that button handlers can be defined where button is created.
// TODO: Ensure buttons enabled & disabled as necessary. // TODO: Ensure buttons enabled & disabled as necessary.
//class CallViewController: OWSViewController, CallObserver, CallServiceObserver, RTCEAGLVideoViewDelegate {
class CallViewController: OWSViewController, CallObserver, CallServiceObserver { class CallViewController: OWSViewController, CallObserver, CallServiceObserver {
let TAG = "[CallViewController]" let TAG = "[CallViewController]"
@ -231,10 +230,9 @@ class CallViewController: OWSViewController, CallObserver, CallServiceObserver {
} }
func createVideoViews() { func createVideoViews() {
localVideoView = RTCCameraPreviewView()
remoteVideoView = RemoteVideoView() remoteVideoView = RemoteVideoView()
remoteVideoView.isUserInteractionEnabled = false remoteVideoView.isUserInteractionEnabled = false
localVideoView = RTCCameraPreviewView()
remoteVideoView.isHidden = true remoteVideoView.isHidden = true
localVideoView.isHidden = true localVideoView.isHidden = true

@ -418,8 +418,11 @@ struct AudioSource: Hashable {
guard let availableInputs = session.availableInputs else { guard let availableInputs = session.availableInputs else {
// I'm not sure when this would happen. // I'm not sure when this would happen.
// TODO this happens when the call ends (at leas ton iOS8) if #available(iOS 9.0, *) {
// owsFail("No available inputs or inputs not ready") // Fails on iOS8. We *could* remove this assert, but it might
// still be helfpul in catching a bug in a more used platform.
owsFail("No available inputs or inputs not ready")
}
return [AudioSource.builtInSpeaker] return [AudioSource.builtInSpeaker]
} }

@ -5,8 +5,8 @@
#import <WebRTC/RTCVideoRenderer.h> #import <WebRTC/RTCVideoRenderer.h>
/** /**
* Drives the full screen remote video, this class is backed by either the modern MetalKit backed view on supported * Drives the full screen remote video. This is *not* a swift class
* systems or the leagacy EAGL view. MetalKit is supported on 64bit systems running iOS8 or newer. * so we can take advantage of some compile time constants from WebRTC
*/ */
@interface RemoteVideoView : UIView <RTCVideoRenderer> @interface RemoteVideoView : UIView <RTCVideoRenderer>

@ -79,12 +79,13 @@ NS_ASSUME_NONNULL_BEGIN
return self; return self;
} }
// On iOS8: prints a message saying the feature is unavailable.
if (!SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(9, 0)) { if (!SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(9, 0)) {
_videoRenderer = [NullVideoRenderer new]; _videoRenderer = [NullVideoRenderer new];
} }
// On 64-bit, iOS9+: uses the MetalKit backed view for improved battery/rendering performance.
if (_videoRenderer == nil) { if (_videoRenderer == nil) {
// This class is defined in objc in order to access this compile time macro
// Currently RTC only supports metal on 64bit machines // Currently RTC only supports metal on 64bit machines
#if defined(RTC_SUPPORTS_METAL) #if defined(RTC_SUPPORTS_METAL)
// RTCMTLVideoView requires the MTKView class, available in the iOS9+ MetalKit framework // RTCMTLVideoView requires the MTKView class, available in the iOS9+ MetalKit framework
@ -94,7 +95,9 @@ NS_ASSUME_NONNULL_BEGIN
#endif #endif
} }
// On 32-bit: uses the legacy EAGL backed view.
if (_videoRenderer == nil) { if (_videoRenderer == nil) {
OWSAssert(!__arm64__);
RTCEAGLVideoView *eaglVideoView = [[RTCEAGLVideoView alloc] initWithFrame:CGRectZero]; RTCEAGLVideoView *eaglVideoView = [[RTCEAGLVideoView alloc] initWithFrame:CGRectZero];
eaglVideoView.delegate = self; eaglVideoView.delegate = self;
_videoRenderer = eaglVideoView; _videoRenderer = eaglVideoView;

Loading…
Cancel
Save