ARDSettingsModel.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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. #import <Foundation/Foundation.h>
  11. NS_ASSUME_NONNULL_BEGIN
  12. /**
  13. * Model class for user defined settings.
  14. *
  15. * Handles storing the settings and provides default values if setting is not
  16. * set. Also provides list of available options for different settings. Stores
  17. * for example video codec, video resolution and maximum bitrate.
  18. */
  19. @interface ARDSettingsModel : NSObject
  20. /**
  21. * Returns array of available capture resoultions.
  22. *
  23. * The capture resolutions are represented as strings in the following format
  24. * [width]x[height]
  25. */
  26. - (NSArray<NSString *> *)availableVideoResolutions;
  27. /**
  28. * Returns current video resolution string.
  29. * If no resolution is in store, default value of 640x480 is returned.
  30. * When defaulting to value, the default is saved in store for consistency reasons.
  31. */
  32. - (NSString *)currentVideoResolutionSettingFromStore;
  33. - (NSString *)readableResolution:(NSString *)resolution;
  34. - (int)currentVideoResolutionWidthFromStore;
  35. - (int)currentVideoResolutionHeightFromStore;
  36. /**
  37. * Stores the provided video resolution string into the store.
  38. *
  39. * If the provided resolution is no part of the available video resolutions
  40. * the store operation will not be executed and NO will be returned.
  41. * @param resolution the string to be stored.
  42. * @return YES/NO depending on success.
  43. */
  44. - (BOOL)storeVideoResolutionSetting:(NSString *)resolution;
  45. /**
  46. * Video disabled by default on call starts
  47. */
  48. - (BOOL)videoDisabledSettingFromStore;
  49. - (void)storeVideoDisabledDefault:(BOOL)disabled;
  50. /**
  51. * Returns array of available video codecs.
  52. */
  53. - (NSArray<NSString *> *)availableVideoCodecs;
  54. /**
  55. * Returns current video codec setting from store if present or default (H264) otherwise.
  56. */
  57. - (NSString *)currentVideoCodecSettingFromStore;
  58. /**
  59. * Stores the provided video codec setting into the store.
  60. *
  61. * If the provided video codec is not part of the available video codecs
  62. * the store operation will not be executed and NO will be returned.
  63. * @param video codec settings the string to be stored.
  64. * @return YES/NO depending on success.
  65. */
  66. - (BOOL)storeVideoCodecSetting:(NSString *)videoCodec;
  67. /**
  68. * Returns current max bitrate setting from store if present.
  69. */
  70. - (nullable NSNumber *)currentMaxBitrateSettingFromStore;
  71. /**
  72. * Stores the provided bitrate value into the store.
  73. *
  74. * @param bitrate NSNumber representation of the max bitrate value.
  75. */
  76. - (void)storeMaxBitrateSetting:(nullable NSNumber *)bitrate;
  77. @end
  78. NS_ASSUME_NONNULL_END