• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 #import <WebRTC/RTCVideoCodecInfo.h>
14 
15 NS_ASSUME_NONNULL_BEGIN
16 
17 /**
18  * Model class for user defined settings.
19  *
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.
23  */
24 @interface ARDSettingsModel : NSObject
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  */
32 - (NSArray<NSString *> *)availableVideoResolutions;
33 
34 /**
35  * Returns current video resolution string.
36  * 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 reasons.
38  */
39 - (NSString *)currentVideoResolutionSettingFromStore;
40 - (int)currentVideoResolutionWidthFromStore;
41 - (int)currentVideoResolutionHeightFromStore;
42 
43 /**
44  * Stores the provided video resolution string into the store.
45  *
46  * If the provided resolution is no part of the available video resolutions
47  * the store operation will not be executed and NO will be returned.
48  * @param resolution the string to be stored.
49  * @return YES/NO depending on success.
50  */
51 - (BOOL)storeVideoResolutionSetting:(NSString *)resolution;
52 
53 /**
54  * Returns array of available video codecs.
55  */
56 - (NSArray<RTC_OBJC_TYPE(RTCVideoCodecInfo) *> *)availableVideoCodecs;
57 
58 /**
59  * Returns current video codec setting from store if present or default (H264) otherwise.
60  */
61 - (RTC_OBJC_TYPE(RTCVideoCodecInfo) *)currentVideoCodecSettingFromStore;
62 
63 /**
64  * Stores the provided video codec setting into the store.
65  *
66  * If the provided video codec is not part of the available video codecs
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  */
71 - (BOOL)storeVideoCodecSetting:(RTC_OBJC_TYPE(RTCVideoCodecInfo) *)videoCodec;
72 
73 /**
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 
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 /**
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 
122 @end
123 NS_ASSUME_NONNULL_END
124