denicija | d17d536 | 2016-11-02 02:56:09 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2016 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 <Foundation/Foundation.h> |
| 12 | |
| 13 | NS_ASSUME_NONNULL_BEGIN |
Anders Carlsson | e150058 | 2017-06-15 16:05:13 +0200 | [diff] [blame^] | 14 | |
denicija | d17d536 | 2016-11-02 02:56:09 -0700 | [diff] [blame] | 15 | /** |
denicija | 2256e04 | 2016-11-09 06:26:18 -0800 | [diff] [blame] | 16 | * Model class for user defined settings. |
denicija | d17d536 | 2016-11-02 02:56:09 -0700 | [diff] [blame] | 17 | * |
sakal | c522e75 | 2017-04-05 12:17:48 -0700 | [diff] [blame] | 18 | * Handles storing the settings and provides default values if setting is not |
| 19 | * set. Also provides list of available options for different settings. Stores |
| 20 | * for example video codec, video resolution and maximum bitrate. |
denicija | d17d536 | 2016-11-02 02:56:09 -0700 | [diff] [blame] | 21 | */ |
denicija | 2256e04 | 2016-11-09 06:26:18 -0800 | [diff] [blame] | 22 | @interface ARDSettingsModel : NSObject |
denicija | d17d536 | 2016-11-02 02:56:09 -0700 | [diff] [blame] | 23 | |
| 24 | /** |
| 25 | * Returns array of available capture resoultions. |
| 26 | * |
| 27 | * The capture resolutions are represented as strings in the following format |
| 28 | * [width]x[height] |
| 29 | */ |
sakal | c522e75 | 2017-04-05 12:17:48 -0700 | [diff] [blame] | 30 | - (NSArray<NSString *> *)availableVideoResolutions; |
denicija | d17d536 | 2016-11-02 02:56:09 -0700 | [diff] [blame] | 31 | |
| 32 | /** |
sakal | c522e75 | 2017-04-05 12:17:48 -0700 | [diff] [blame] | 33 | * Returns current video resolution string. |
| 34 | * If no resolution is in store, default value of 640x480 is returned. |
denicija | d17d536 | 2016-11-02 02:56:09 -0700 | [diff] [blame] | 35 | * When defaulting to value, the default is saved in store for consistency reasons. |
| 36 | */ |
sakal | c522e75 | 2017-04-05 12:17:48 -0700 | [diff] [blame] | 37 | - (NSString *)currentVideoResolutionSettingFromStore; |
| 38 | - (int)currentVideoResolutionWidthFromStore; |
| 39 | - (int)currentVideoResolutionHeightFromStore; |
denicija | d17d536 | 2016-11-02 02:56:09 -0700 | [diff] [blame] | 40 | |
| 41 | /** |
sakal | c522e75 | 2017-04-05 12:17:48 -0700 | [diff] [blame] | 42 | * Stores the provided video resolution string into the store. |
denicija | d17d536 | 2016-11-02 02:56:09 -0700 | [diff] [blame] | 43 | * |
sakal | c522e75 | 2017-04-05 12:17:48 -0700 | [diff] [blame] | 44 | * If the provided resolution is no part of the available video resolutions |
denicija | d17d536 | 2016-11-02 02:56:09 -0700 | [diff] [blame] | 45 | * the store operation will not be executed and NO will be returned. |
sakal | c522e75 | 2017-04-05 12:17:48 -0700 | [diff] [blame] | 46 | * @param resolution the string to be stored. |
denicija | d17d536 | 2016-11-02 02:56:09 -0700 | [diff] [blame] | 47 | * @return YES/NO depending on success. |
| 48 | */ |
sakal | c522e75 | 2017-04-05 12:17:48 -0700 | [diff] [blame] | 49 | - (BOOL)storeVideoResolutionSetting:(NSString *)resolution; |
denicija | d17d536 | 2016-11-02 02:56:09 -0700 | [diff] [blame] | 50 | |
| 51 | /** |
sakal | 68b5df9 | 2017-03-17 09:01:59 -0700 | [diff] [blame] | 52 | * Returns array of available video codecs. |
| 53 | */ |
| 54 | - (NSArray<NSString *> *)availableVideoCodecs; |
| 55 | |
| 56 | /** |
sakal | 268862c | 2017-04-11 05:36:43 -0700 | [diff] [blame] | 57 | * Returns current video codec setting from store if present or default (H264) otherwise. |
sakal | 68b5df9 | 2017-03-17 09:01:59 -0700 | [diff] [blame] | 58 | */ |
| 59 | - (NSString *)currentVideoCodecSettingFromStore; |
| 60 | |
| 61 | /** |
| 62 | * Stores the provided video codec setting into the store. |
| 63 | * |
sakal | c522e75 | 2017-04-05 12:17:48 -0700 | [diff] [blame] | 64 | * If the provided video codec is not part of the available video codecs |
sakal | 68b5df9 | 2017-03-17 09:01:59 -0700 | [diff] [blame] | 65 | * the store operation will not be executed and NO will be returned. |
| 66 | * @param video codec settings the string to be stored. |
| 67 | * @return YES/NO depending on success. |
| 68 | */ |
| 69 | - (BOOL)storeVideoCodecSetting:(NSString *)videoCodec; |
| 70 | |
| 71 | /** |
denicija | 9af2b60 | 2016-11-17 00:43:43 -0800 | [diff] [blame] | 72 | * Returns current max bitrate setting from store if present. |
| 73 | */ |
| 74 | - (nullable NSNumber *)currentMaxBitrateSettingFromStore; |
| 75 | |
| 76 | /** |
| 77 | * Stores the provided bitrate value into the store. |
| 78 | * |
| 79 | * @param bitrate NSNumber representation of the max bitrate value. |
| 80 | */ |
| 81 | - (void)storeMaxBitrateSetting:(nullable NSNumber *)bitrate; |
| 82 | |
Anders Carlsson | e150058 | 2017-06-15 16:05:13 +0200 | [diff] [blame^] | 83 | /** |
| 84 | * Returns current audio only setting from store if present or default (NO) otherwise. |
| 85 | */ |
| 86 | - (BOOL)currentAudioOnlySettingFromStore; |
| 87 | |
| 88 | /** |
| 89 | * Stores the provided audio only setting into the store. |
| 90 | * |
| 91 | * @param setting the boolean value to be stored. |
| 92 | */ |
| 93 | - (void)storeAudioOnlySetting:(BOOL)audioOnly; |
| 94 | |
| 95 | /** |
| 96 | * Returns current create AecDump setting from store if present or default (NO) otherwise. |
| 97 | */ |
| 98 | - (BOOL)currentCreateAecDumpSettingFromStore; |
| 99 | |
| 100 | /** |
| 101 | * Stores the provided create AecDump setting into the store. |
| 102 | * |
| 103 | * @param setting the boolean value to be stored. |
| 104 | */ |
| 105 | - (void)storeCreateAecDumpSetting:(BOOL)createAecDump; |
| 106 | |
| 107 | /** |
| 108 | * Returns current setting whether to use level controller from store if present or default (NO) |
| 109 | * otherwise. |
| 110 | */ |
| 111 | - (BOOL)currentUseLevelControllerSettingFromStore; |
| 112 | |
| 113 | /** |
| 114 | * Stores the provided use level controller setting into the store. |
| 115 | * |
| 116 | * @param setting the boolean value to be stored. |
| 117 | */ |
| 118 | - (void)storeUseLevelControllerSetting:(BOOL)useLevelController; |
| 119 | |
| 120 | /** |
| 121 | * Returns current setting whether to use manual audio config from store if present or default (YES) |
| 122 | * otherwise. |
| 123 | */ |
| 124 | - (BOOL)currentUseManualAudioConfigSettingFromStore; |
| 125 | |
| 126 | /** |
| 127 | * Stores the provided use manual audio config setting into the store. |
| 128 | * |
| 129 | * @param setting the boolean value to be stored. |
| 130 | */ |
| 131 | - (void)storeUseManualAudioConfigSetting:(BOOL)useManualAudioConfig; |
| 132 | |
denicija | d17d536 | 2016-11-02 02:56:09 -0700 | [diff] [blame] | 133 | @end |
| 134 | NS_ASSUME_NONNULL_END |