blob: 0f07389b1554a3b322e9cf070b75ad17994cb0b9 [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 *
sakalc522e752017-04-05 12:17:48 -070017 * 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.
denicijad17d5362016-11-02 02:56:09 -070020 */
denicija2256e042016-11-09 06:26:18 -080021@interface ARDSettingsModel : NSObject
denicijad17d5362016-11-02 02:56:09 -070022
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 */
sakalc522e752017-04-05 12:17:48 -070029- (NSArray<NSString *> *)availableVideoResolutions;
denicijad17d5362016-11-02 02:56:09 -070030
31/**
sakalc522e752017-04-05 12:17:48 -070032 * Returns current video resolution string.
33 * If no resolution is in store, default value of 640x480 is returned.
denicijad17d5362016-11-02 02:56:09 -070034 * When defaulting to value, the default is saved in store for consistency reasons.
35 */
sakalc522e752017-04-05 12:17:48 -070036- (NSString *)currentVideoResolutionSettingFromStore;
37- (int)currentVideoResolutionWidthFromStore;
38- (int)currentVideoResolutionHeightFromStore;
denicijad17d5362016-11-02 02:56:09 -070039
40/**
sakalc522e752017-04-05 12:17:48 -070041 * Stores the provided video resolution string into the store.
denicijad17d5362016-11-02 02:56:09 -070042 *
sakalc522e752017-04-05 12:17:48 -070043 * If the provided resolution is no part of the available video resolutions
denicijad17d5362016-11-02 02:56:09 -070044 * the store operation will not be executed and NO will be returned.
sakalc522e752017-04-05 12:17:48 -070045 * @param resolution the string to be stored.
denicijad17d5362016-11-02 02:56:09 -070046 * @return YES/NO depending on success.
47 */
sakalc522e752017-04-05 12:17:48 -070048- (BOOL)storeVideoResolutionSetting:(NSString *)resolution;
denicijad17d5362016-11-02 02:56:09 -070049
50/**
sakal68b5df92017-03-17 09:01:59 -070051 * Returns array of available video codecs.
52 */
53- (NSArray<NSString *> *)availableVideoCodecs;
54
55/**
sakal268862c2017-04-11 05:36:43 -070056 * Returns current video codec setting from store if present or default (H264) otherwise.
sakal68b5df92017-03-17 09:01:59 -070057 */
58- (NSString *)currentVideoCodecSettingFromStore;
59
60/**
61 * Stores the provided video codec setting into the store.
62 *
sakalc522e752017-04-05 12:17:48 -070063 * If the provided video codec is not part of the available video codecs
sakal68b5df92017-03-17 09:01:59 -070064 * 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/**
denicija9af2b602016-11-17 00:43:43 -080071 * 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
denicijad17d5362016-11-02 02:56:09 -070082@end
83NS_ASSUME_NONNULL_END