blob: 0eb7b31aebbecc1726268c4ea576a97867d28af0 [file] [log] [blame]
denicijad17d5362016-11-02 02:56:09 -07001/*
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
13NS_ASSUME_NONNULL_BEGIN
14/**
denicija2256e042016-11-09 06:26:18 -080015 * Model class for user defined settings.
denicijad17d5362016-11-02 02:56:09 -070016 *
denicija2256e042016-11-09 06:26:18 -080017 * Currently used for streaming media constraints and bitrate only.
denicijad17d5362016-11-02 02:56:09 -070018 * In future audio media constraints support can be added as well.
19 * Offers list of avaliable video resolutions that can construct streaming media constraint.
20 * Exposes methods for reading and storing media constraints from persistent store.
21 * Also translates current user defined media constraint into RTCMediaConstraints
22 * dictionary.
23 */
denicija2256e042016-11-09 06:26:18 -080024@interface ARDSettingsModel : NSObject
denicijad17d5362016-11-02 02:56:09 -070025
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 *> *)availableVideoResoultionsMediaConstraints;
33
34/**
35 * Returns current video resolution media constraint string.
36 * If no constraint 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 *)currentVideoResoultionConstraintFromStore;
40
41/**
42 * Stores the provided video resolution media constraint string into the store.
43 *
44 * If the provided constraint is no part of the available video resolutions
45 * the store operation will not be executed and NO will be returned.
46 * @param constraint the string to be stored.
47 * @return YES/NO depending on success.
48 */
49- (BOOL)storeVideoResoultionConstraint:(NSString *)constraint;
50
51/**
sakal68b5df92017-03-17 09:01:59 -070052 * Returns array of available video codecs.
53 */
54- (NSArray<NSString *> *)availableVideoCodecs;
55
56/**
57 * Returns current video codec setting from store if present.
58 */
59- (NSString *)currentVideoCodecSettingFromStore;
60
61/**
62 * Stores the provided video codec setting into the store.
63 *
64 * If the provided constraint is not part of the available video codecs
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/**
denicijad17d5362016-11-02 02:56:09 -070072 * Converts the current media constraints from store into dictionary with RTCMediaConstraints
73 * values.
74 *
75 * @return NSDictionary with RTC width and height parameters
76 */
77- (nullable NSDictionary *)currentMediaConstraintFromStoreAsRTCDictionary;
denicija9af2b602016-11-17 00:43:43 -080078
79/**
80 * Returns current max bitrate setting from store if present.
81 */
82- (nullable NSNumber *)currentMaxBitrateSettingFromStore;
83
84/**
85 * Stores the provided bitrate value into the store.
86 *
87 * @param bitrate NSNumber representation of the max bitrate value.
88 */
89- (void)storeMaxBitrateSetting:(nullable NSNumber *)bitrate;
90
denicijad17d5362016-11-02 02:56:09 -070091@end
92NS_ASSUME_NONNULL_END