| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2016 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2016 The WebRTC Project Authors. All rights reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| 11 #import <Foundation/Foundation.h> | 11 #import <Foundation/Foundation.h> |
| 12 | 12 |
| 13 NS_ASSUME_NONNULL_BEGIN | 13 NS_ASSUME_NONNULL_BEGIN |
| 14 /** | 14 /** |
| 15 * Model class for user defined settings. | 15 * Model class for user defined settings. |
| 16 * | 16 * |
| 17 * Currently used for streaming media constraints and bitrate only. | 17 * Handles storing the settings and provides default values if setting is not |
| 18 * In future audio media constraints support can be added as well. | 18 * set. Also provides list of available options for different settings. Stores |
| 19 * Offers list of avaliable video resolutions that can construct streaming media
constraint. | 19 * for example video codec, video resolution and maximum bitrate. |
| 20 * Exposes methods for reading and storing media constraints from persistent sto
re. | |
| 21 * Also translates current user defined media constraint into RTCMediaConstraint
s | |
| 22 * dictionary. | |
| 23 */ | 20 */ |
| 24 @interface ARDSettingsModel : NSObject | 21 @interface ARDSettingsModel : NSObject |
| 25 | 22 |
| 26 /** | 23 /** |
| 27 * Returns array of available capture resoultions. | 24 * Returns array of available capture resoultions. |
| 28 * | 25 * |
| 29 * The capture resolutions are represented as strings in the following format | 26 * The capture resolutions are represented as strings in the following format |
| 30 * [width]x[height] | 27 * [width]x[height] |
| 31 */ | 28 */ |
| 32 - (NSArray<NSString *> *)availableVideoResoultionsMediaConstraints; | 29 - (NSArray<NSString *> *)availableVideoResolutions; |
| 33 | 30 |
| 34 /** | 31 /** |
| 35 * Returns current video resolution media constraint string. | 32 * Returns current video resolution string. |
| 36 * If no constraint is in store, default value of 640x480 is returned. | 33 * If no resolution is in store, default value of 640x480 is returned. |
| 37 * When defaulting to value, the default is saved in store for consistency reaso
ns. | 34 * When defaulting to value, the default is saved in store for consistency reaso
ns. |
| 38 */ | 35 */ |
| 39 - (NSString *)currentVideoResoultionConstraintFromStore; | 36 - (NSString *)currentVideoResolutionSettingFromStore; |
| 37 - (int)currentVideoResolutionWidthFromStore; |
| 38 - (int)currentVideoResolutionHeightFromStore; |
| 40 | 39 |
| 41 /** | 40 /** |
| 42 * Stores the provided video resolution media constraint string into the store. | 41 * Stores the provided video resolution string into the store. |
| 43 * | 42 * |
| 44 * If the provided constraint is no part of the available video resolutions | 43 * If the provided resolution is no part of the available video resolutions |
| 45 * the store operation will not be executed and NO will be returned. | 44 * the store operation will not be executed and NO will be returned. |
| 46 * @param constraint the string to be stored. | 45 * @param resolution the string to be stored. |
| 47 * @return YES/NO depending on success. | 46 * @return YES/NO depending on success. |
| 48 */ | 47 */ |
| 49 - (BOOL)storeVideoResoultionConstraint:(NSString *)constraint; | 48 - (BOOL)storeVideoResolutionSetting:(NSString *)resolution; |
| 50 | 49 |
| 51 /** | 50 /** |
| 52 * Returns array of available video codecs. | 51 * Returns array of available video codecs. |
| 53 */ | 52 */ |
| 54 - (NSArray<NSString *> *)availableVideoCodecs; | 53 - (NSArray<NSString *> *)availableVideoCodecs; |
| 55 | 54 |
| 56 /** | 55 /** |
| 57 * Returns current video codec setting from store if present. | 56 * Returns current video codec setting from store if present. |
| 58 */ | 57 */ |
| 59 - (NSString *)currentVideoCodecSettingFromStore; | 58 - (NSString *)currentVideoCodecSettingFromStore; |
| 60 | 59 |
| 61 /** | 60 /** |
| 62 * Stores the provided video codec setting into the store. | 61 * Stores the provided video codec setting into the store. |
| 63 * | 62 * |
| 64 * If the provided constraint is not part of the available video codecs | 63 * If the provided video codec is not part of the available video codecs |
| 65 * the store operation will not be executed and NO will be returned. | 64 * the store operation will not be executed and NO will be returned. |
| 66 * @param video codec settings the string to be stored. | 65 * @param video codec settings the string to be stored. |
| 67 * @return YES/NO depending on success. | 66 * @return YES/NO depending on success. |
| 68 */ | 67 */ |
| 69 - (BOOL)storeVideoCodecSetting:(NSString *)videoCodec; | 68 - (BOOL)storeVideoCodecSetting:(NSString *)videoCodec; |
| 70 | 69 |
| 71 /** | 70 /** |
| 72 * Converts the current media constraints from store into dictionary with RTCMed
iaConstraints | |
| 73 * values. | |
| 74 * | |
| 75 * @return NSDictionary with RTC width and height parameters | |
| 76 */ | |
| 77 - (nullable NSDictionary *)currentMediaConstraintFromStoreAsRTCDictionary; | |
| 78 | |
| 79 /** | |
| 80 * Returns current max bitrate setting from store if present. | 71 * Returns current max bitrate setting from store if present. |
| 81 */ | 72 */ |
| 82 - (nullable NSNumber *)currentMaxBitrateSettingFromStore; | 73 - (nullable NSNumber *)currentMaxBitrateSettingFromStore; |
| 83 | 74 |
| 84 /** | 75 /** |
| 85 * Stores the provided bitrate value into the store. | 76 * Stores the provided bitrate value into the store. |
| 86 * | 77 * |
| 87 * @param bitrate NSNumber representation of the max bitrate value. | 78 * @param bitrate NSNumber representation of the max bitrate value. |
| 88 */ | 79 */ |
| 89 - (void)storeMaxBitrateSetting:(nullable NSNumber *)bitrate; | 80 - (void)storeMaxBitrateSetting:(nullable NSNumber *)bitrate; |
| 90 | 81 |
| 91 @end | 82 @end |
| 92 NS_ASSUME_NONNULL_END | 83 NS_ASSUME_NONNULL_END |
| OLD | NEW |