Donald E Curtis | a873644 | 2015-08-05 15:48:13 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2013 The WebRTC Project Authors. All rights reserved. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license |
| 5 | * that can be found in the LICENSE file in the root of the source |
| 6 | * tree. An additional intellectual property rights grant can be found |
| 7 | * in the file PATENTS. All contributing project authors may |
| 8 | * be found in the AUTHORS file in the root of the source tree. |
| 9 | */ |
| 10 | |
| 11 | #import "ARDAppDelegate.h" |
| 12 | |
tkchin | 9eeb624 | 2016-04-27 01:54:20 -0700 | [diff] [blame] | 13 | #import "WebRTC/RTCFieldTrials.h" |
| 14 | #import "WebRTC/RTCLogging.h" |
| 15 | #import "WebRTC/RTCSSLAdapter.h" |
| 16 | #import "WebRTC/RTCTracing.h" |
Donald E Curtis | a873644 | 2015-08-05 15:48:13 -0700 | [diff] [blame] | 17 | |
| 18 | #import "ARDMainViewController.h" |
| 19 | |
| 20 | @implementation ARDAppDelegate { |
| 21 | UIWindow *_window; |
| 22 | } |
| 23 | |
| 24 | #pragma mark - UIApplicationDelegate methods |
| 25 | |
| 26 | - (BOOL)application:(UIApplication *)application |
| 27 | didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { |
tkchin | 4cd6221 | 2016-12-15 13:17:54 -0800 | [diff] [blame] | 28 | NSDictionary *fieldTrials = @{ |
Alex Narest | dc9ca93 | 2017-10-19 17:31:53 +0200 | [diff] [blame^] | 29 | kRTCFieldTrialH264HighProfileKey: kRTCFieldTrialEnabledValue, |
tkchin | 4cd6221 | 2016-12-15 13:17:54 -0800 | [diff] [blame] | 30 | }; |
| 31 | RTCInitFieldTrialDictionary(fieldTrials); |
hjon | 79858f8 | 2016-03-13 22:08:26 -0700 | [diff] [blame] | 32 | RTCInitializeSSL(); |
tkchin | d1fb26d | 2016-02-03 01:51:18 -0800 | [diff] [blame] | 33 | RTCSetupInternalTracer(); |
Donald E Curtis | a873644 | 2015-08-05 15:48:13 -0700 | [diff] [blame] | 34 | _window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; |
| 35 | [_window makeKeyAndVisible]; |
| 36 | ARDMainViewController *viewController = [[ARDMainViewController alloc] init]; |
denicija | 6d6762c | 2016-10-28 04:53:16 -0700 | [diff] [blame] | 37 | |
| 38 | UINavigationController *root = |
| 39 | [[UINavigationController alloc] initWithRootViewController:viewController]; |
| 40 | root.navigationBar.translucent = NO; |
| 41 | _window.rootViewController = root; |
Donald E Curtis | a873644 | 2015-08-05 15:48:13 -0700 | [diff] [blame] | 42 | |
tfarina | a41ab93 | 2015-10-30 16:08:48 -0700 | [diff] [blame] | 43 | #if defined(NDEBUG) |
Donald E Curtis | a873644 | 2015-08-05 15:48:13 -0700 | [diff] [blame] | 44 | // In debug builds the default level is LS_INFO and in non-debug builds it is |
| 45 | // disabled. Continue to log to console in non-debug builds, but only |
| 46 | // warnings and errors. |
tkchin | 8b9ca95 | 2016-03-31 12:08:03 -0700 | [diff] [blame] | 47 | RTCSetMinDebugLogLevel(RTCLoggingSeverityWarning); |
Donald E Curtis | a873644 | 2015-08-05 15:48:13 -0700 | [diff] [blame] | 48 | #endif |
| 49 | |
| 50 | return YES; |
| 51 | } |
| 52 | |
Donald E Curtis | a873644 | 2015-08-05 15:48:13 -0700 | [diff] [blame] | 53 | - (void)applicationWillTerminate:(UIApplication *)application { |
tkchin | d1fb26d | 2016-02-03 01:51:18 -0800 | [diff] [blame] | 54 | RTCShutdownInternalTracer(); |
hjon | 79858f8 | 2016-03-13 22:08:26 -0700 | [diff] [blame] | 55 | RTCCleanupSSL(); |
Donald E Curtis | a873644 | 2015-08-05 15:48:13 -0700 | [diff] [blame] | 56 | } |
| 57 | |
| 58 | @end |