blob: 47c7defacdf3a52b3e115ef4de55e86608a6c6a0 [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
Mirko Bonadei19640aa2020-10-19 16:12:43 +020013#import "sdk/objc/base/RTCVideoCodecInfo.h"
Anders Carlsson6bf43d22017-10-16 13:51:43 +020014
denicijad17d5362016-11-02 02:56:09 -070015NS_ASSUME_NONNULL_BEGIN
Anders Carlssone1500582017-06-15 16:05:13 +020016
denicijad17d5362016-11-02 02:56:09 -070017/**
denicija2256e042016-11-09 06:26:18 -080018 * Model class for user defined settings.
denicijad17d5362016-11-02 02:56:09 -070019 *
sakalc522e752017-04-05 12:17:48 -070020 * 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.
denicijad17d5362016-11-02 02:56:09 -070023 */
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 */
sakalc522e752017-04-05 12:17:48 -070032- (NSArray<NSString *> *)availableVideoResolutions;
denicijad17d5362016-11-02 02:56:09 -070033
34/**
sakalc522e752017-04-05 12:17:48 -070035 * Returns current video resolution string.
36 * If no resolution is in store, default value of 640x480 is returned.
denicijad17d5362016-11-02 02:56:09 -070037 * When defaulting to value, the default is saved in store for consistency reasons.
38 */
sakalc522e752017-04-05 12:17:48 -070039- (NSString *)currentVideoResolutionSettingFromStore;
40- (int)currentVideoResolutionWidthFromStore;
41- (int)currentVideoResolutionHeightFromStore;
denicijad17d5362016-11-02 02:56:09 -070042
43/**
sakalc522e752017-04-05 12:17:48 -070044 * Stores the provided video resolution string into the store.
denicijad17d5362016-11-02 02:56:09 -070045 *
sakalc522e752017-04-05 12:17:48 -070046 * If the provided resolution is no part of the available video resolutions
denicijad17d5362016-11-02 02:56:09 -070047 * the store operation will not be executed and NO will be returned.
sakalc522e752017-04-05 12:17:48 -070048 * @param resolution the string to be stored.
denicijad17d5362016-11-02 02:56:09 -070049 * @return YES/NO depending on success.
50 */
sakalc522e752017-04-05 12:17:48 -070051- (BOOL)storeVideoResolutionSetting:(NSString *)resolution;
denicijad17d5362016-11-02 02:56:09 -070052
53/**
sakal68b5df92017-03-17 09:01:59 -070054 * Returns array of available video codecs.
55 */
Mirko Bonadeia81e9c82020-05-04 16:14:32 +020056- (NSArray<RTC_OBJC_TYPE(RTCVideoCodecInfo) *> *)availableVideoCodecs;
sakal68b5df92017-03-17 09:01:59 -070057
58/**
sakal268862c2017-04-11 05:36:43 -070059 * Returns current video codec setting from store if present or default (H264) otherwise.
sakal68b5df92017-03-17 09:01:59 -070060 */
Mirko Bonadeia81e9c82020-05-04 16:14:32 +020061- (RTC_OBJC_TYPE(RTCVideoCodecInfo) *)currentVideoCodecSettingFromStore;
sakal68b5df92017-03-17 09:01:59 -070062
63/**
64 * Stores the provided video codec setting into the store.
65 *
sakalc522e752017-04-05 12:17:48 -070066 * If the provided video codec is not part of the available video codecs
sakal68b5df92017-03-17 09:01:59 -070067 * 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 */
Mirko Bonadeia81e9c82020-05-04 16:14:32 +020071- (BOOL)storeVideoCodecSetting:(RTC_OBJC_TYPE(RTCVideoCodecInfo) *)videoCodec;
sakal68b5df92017-03-17 09:01:59 -070072
73/**
denicija9af2b602016-11-17 00:43:43 -080074 * 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 Carlssone1500582017-06-15 16:05:13 +020085/**
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 Carlssone1500582017-06-15 16:05:13 +0200110 * 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
denicijad17d5362016-11-02 02:56:09 -0700122@end
123NS_ASSUME_NONNULL_END