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 |
| 14 | /** |
denicija | 2256e04 | 2016-11-09 06:26:18 -0800 | [diff] [blame] | 15 | * Model class for user defined settings. |
denicija | d17d536 | 2016-11-02 02:56:09 -0700 | [diff] [blame] | 16 | * |
sakal | c522e75 | 2017-04-05 12:17:48 -0700 | [diff] [blame^] | 17 | * Handles storing the settings and provides default values if setting is not |
| 18 | * set. Also provides list of available options for different settings. Stores |
| 19 | * for example video codec, video resolution and maximum bitrate. |
denicija | d17d536 | 2016-11-02 02:56:09 -0700 | [diff] [blame] | 20 | */ |
denicija | 2256e04 | 2016-11-09 06:26:18 -0800 | [diff] [blame] | 21 | @interface ARDSettingsModel : NSObject |
denicija | d17d536 | 2016-11-02 02:56:09 -0700 | [diff] [blame] | 22 | |
| 23 | /** |
| 24 | * Returns array of available capture resoultions. |
| 25 | * |
| 26 | * The capture resolutions are represented as strings in the following format |
| 27 | * [width]x[height] |
| 28 | */ |
sakal | c522e75 | 2017-04-05 12:17:48 -0700 | [diff] [blame^] | 29 | - (NSArray<NSString *> *)availableVideoResolutions; |
denicija | d17d536 | 2016-11-02 02:56:09 -0700 | [diff] [blame] | 30 | |
| 31 | /** |
sakal | c522e75 | 2017-04-05 12:17:48 -0700 | [diff] [blame^] | 32 | * Returns current video resolution string. |
| 33 | * If no resolution is in store, default value of 640x480 is returned. |
denicija | d17d536 | 2016-11-02 02:56:09 -0700 | [diff] [blame] | 34 | * When defaulting to value, the default is saved in store for consistency reasons. |
| 35 | */ |
sakal | c522e75 | 2017-04-05 12:17:48 -0700 | [diff] [blame^] | 36 | - (NSString *)currentVideoResolutionSettingFromStore; |
| 37 | - (int)currentVideoResolutionWidthFromStore; |
| 38 | - (int)currentVideoResolutionHeightFromStore; |
denicija | d17d536 | 2016-11-02 02:56:09 -0700 | [diff] [blame] | 39 | |
| 40 | /** |
sakal | c522e75 | 2017-04-05 12:17:48 -0700 | [diff] [blame^] | 41 | * Stores the provided video resolution string into the store. |
denicija | d17d536 | 2016-11-02 02:56:09 -0700 | [diff] [blame] | 42 | * |
sakal | c522e75 | 2017-04-05 12:17:48 -0700 | [diff] [blame^] | 43 | * If the provided resolution is no part of the available video resolutions |
denicija | d17d536 | 2016-11-02 02:56:09 -0700 | [diff] [blame] | 44 | * the store operation will not be executed and NO will be returned. |
sakal | c522e75 | 2017-04-05 12:17:48 -0700 | [diff] [blame^] | 45 | * @param resolution the string to be stored. |
denicija | d17d536 | 2016-11-02 02:56:09 -0700 | [diff] [blame] | 46 | * @return YES/NO depending on success. |
| 47 | */ |
sakal | c522e75 | 2017-04-05 12:17:48 -0700 | [diff] [blame^] | 48 | - (BOOL)storeVideoResolutionSetting:(NSString *)resolution; |
denicija | d17d536 | 2016-11-02 02:56:09 -0700 | [diff] [blame] | 49 | |
| 50 | /** |
sakal | 68b5df9 | 2017-03-17 09:01:59 -0700 | [diff] [blame] | 51 | * Returns array of available video codecs. |
| 52 | */ |
| 53 | - (NSArray<NSString *> *)availableVideoCodecs; |
| 54 | |
| 55 | /** |
| 56 | * Returns current video codec setting from store if present. |
| 57 | */ |
| 58 | - (NSString *)currentVideoCodecSettingFromStore; |
| 59 | |
| 60 | /** |
| 61 | * Stores the provided video codec setting into the store. |
| 62 | * |
sakal | c522e75 | 2017-04-05 12:17:48 -0700 | [diff] [blame^] | 63 | * If the provided video codec is not part of the available video codecs |
sakal | 68b5df9 | 2017-03-17 09:01:59 -0700 | [diff] [blame] | 64 | * the store operation will not be executed and NO will be returned. |
| 65 | * @param video codec settings the string to be stored. |
| 66 | * @return YES/NO depending on success. |
| 67 | */ |
| 68 | - (BOOL)storeVideoCodecSetting:(NSString *)videoCodec; |
| 69 | |
| 70 | /** |
denicija | 9af2b60 | 2016-11-17 00:43:43 -0800 | [diff] [blame] | 71 | * Returns current max bitrate setting from store if present. |
| 72 | */ |
| 73 | - (nullable NSNumber *)currentMaxBitrateSettingFromStore; |
| 74 | |
| 75 | /** |
| 76 | * Stores the provided bitrate value into the store. |
| 77 | * |
| 78 | * @param bitrate NSNumber representation of the max bitrate value. |
| 79 | */ |
| 80 | - (void)storeMaxBitrateSetting:(nullable NSNumber *)bitrate; |
| 81 | |
denicija | d17d536 | 2016-11-02 02:56:09 -0700 | [diff] [blame] | 82 | @end |
| 83 | NS_ASSUME_NONNULL_END |