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